-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RAM usage climbing, should I have a cron job to restart nginx periodically? #442
Comments
Sounds like a memory fragmentation issue. Are you using Docker? If so, is jemalloc enabled there? Lines 74 to 75 in 4133e2f
Lines 48 to 49 in 4133e2f
The pre-built Docker image at For the same reason Redis ships with jemalloc by default since version 2.4.
|
To answer the question in the issue title, I think restarting nginx via a cron job is unnecessary. If you've already tried this and noticed an improvement in memory usage, it might indicate an issue with the proxy cache. Did you also modify the following nginx configuration?: images/ngx_conf/imagesweserv.conf Lines 1 to 3 in 4133e2f
|
Thanks for the info, Im looking into jemalloc now. But I assume its already on because my dockerfile is basically just inheriting from the standard Docker file for this project right? Here's my Dockerfile
and here's the modifications I made to the nginx conf, mainly to increase the timeouts and also to use disk cache instead of memory cache:
thanks for your insight, much appreciated! |
jemalloc should already be enabled if you're inheriting from the pre-built Docker image. The custom nginx config changes looks fine, except for the following lines: weserv_limit_input_pixels 0;
weserv_limit_output_pixels 0; You should be careful with that, especially if you're processing untrusted input. There are PNG decompression bombs available that could burn all the available memory. |
yeah, probably should set a sensible number there. thanks for the tip. for the "memory growth" issue, jemalloc I guess cant be the issue since its based on the pre-built docker image.
|
Hi there,
big fan of this project, its been working out very well for me!
quick q- I noticed that over time the server RAM usage goes up slowly.
Is this normal? I'm using the base nginx.conf with some small modifications (e.g. using nginx disk cache instead of memory cache).
Thanks guys!
The text was updated successfully, but these errors were encountered: