Skip to content

Commit 5440563

Browse files
committed
Remove IMGPROXY_DOWNLOAD_BUFFER_SIZE and IMGPROXY_BUFFER_POOL_CALIBRATION_THRESHOLD docs
1 parent b901370 commit 5440563

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

versioned_docs/version-4-preview/memory_usage_tweaks.mdx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,10 @@ There are some imgproxy options that can help you optimize memory usage and decr
1010
This is an advanced part. Please make sure that you know what you're doing before changing anything.
1111
:::
1212

13-
## IMGPROXY_DOWNLOAD_BUFFER_SIZE
14-
15-
imgproxy uses memory buffers to download source images. While these buffers are empty at the beginning by default, they can grow to a required size when imgproxy downloads an image. Allocating new memory to grow the buffers can cause memory fragmentation. Allocating the required memory at the beginning can eliminate much of memory fragmentation since the buffers won't grow. Setting `IMGPROXY_DOWNLOAD_BUFFER_SIZE` will tell imgproxy to initialize download buffers with _at least_ the specified size. It's recommended to use the estimated 95 percentile of your image sizes as the initial download buffers size.
16-
1713
## IMGPROXY_FREE_MEMORY_INTERVAL
1814

1915
Working with a large amount of data can result in allocating some memory that is generally not used. That's why imgproxy enforces Go's garbage collector to free as much memory as possible and return it to the OS. The default interval of this action is 10 seconds, but you can change it by setting `IMGPROXY_FREE_MEMORY_INTERVAL`. Decreasing the interval can smooth out the memory usage graph but it can also slow down imgproxy a little. Increasing it has the opposite effect.
2016

21-
## IMGPROXY_BUFFER_POOL_CALIBRATION_THRESHOLD
22-
23-
Buffer pools in imgproxy do self-calibration time by time. imgproxy collects stats about the sizes of the buffers returned to a pool and calculates the default buffer size and the maximum size of a buffer that can be returned to the pool. This allows dropping buffers that are too big for most of the images and helps save some memory. By default, imgproxy starts calibration after 1024 buffers have been returned to a pool. You can change this number with the `IMGPROXY_BUFFER_POOL_CALIBRATION_THRESHOLD` variable. Increasing the number will give you rarer but more accurate calibration.
24-
2517
## MALLOC_ARENA_MAX
2618

2719
`libvips` uses GLib for memory management, and it brings with it GLib memory fragmentation issues to heavily multi-threaded programs. And imgproxy is definitely one of these. First thing you can try if you noticed constantly growing RSS usage without Go's sys memory growth is set `MALLOC_ARENA_MAX`:

0 commit comments

Comments
 (0)