However, I am having problems with the memory consumption of nginx:
When I perform 10,000 requests with 20 conn/s and 2 requests/conn (using
httperf - 1), memory used by nginx grows to about 40 MB.
When I repeat this benchmark, the used memory grows from 40 to 80 MB.
The problem with this behavior is that my SoC only has 256 MB of RAM in
total (the file system also runs completely from RAM using a ramdisk).
Therefore nginx crashes the complete system by consuming all memory for
longer/extended benchmark scenarios.
Is this the intended behavior of nginx? Why isn’t it “re-using” the
already
allocated memory?
Any hints on how I can circumvent or track down this problem?
However, I am having problems with the memory consumption of nginx:
When I perform 10,000 requests with 20 conn/s and 2 requests/conn (using
httperf - 1), memory used by nginx grows to about 40 MB.
When I repeat this benchmark, the used memory grows from 40 to 80 MB.
Do you use 3rd party modules?
This request served by nginx (e. g. static files) or proxied to some
backend?
Memory usage depends on used features: SSL, SSI, gzip, limt rate, geo
module,
e. t. c.
If gzip is used for static files, better to pre-compress them, and use
ngx_http_gzip_static_module
Also yo save memory use 1 worker and set reasonable small limit on
connections:
On Monday 29 October 2012 21:13:01 peschuster wrote:
httperf - 1), memory used by nginx grows to about 40 MB.
When I repeat this benchmark, the used memory grows from 40 to 80 MB.
The problem with this behavior is that my SoC only has 256 MB of RAM in
total (the file system also runs completely from RAM using a ramdisk).
Therefore nginx crashes the complete system by consuming all memory for
longer/extended benchmark scenarios.
Is this the intended behavior of nginx? Why isn’t it “re-using” the already
allocated memory?
Nginx releases allocated memory after it completes each request.
Any hints on how I can circumvent or track down this problem?
It most likely that your system memory allocator do not return freed
memory to
the OS.