Welcome! Log In Create A New Profile

Advanced

Memory usage in nginx proxy setup and use of min_uses

Lucas Rolff
May 16, 2021 12:48PM
Hi everyone,

I have a few questions regarding proxy_cache and the use of proxy_cache_min_uses in nginx:

Let’s assume you have an nginx server with proxy_cache enabled, and you’ve set proxy_cache_min_uses to 5;

Q1: How does nginx internally keep track of the count for min_uses? Is it using SHM to do it (and counts towards the key_zone limit?), or something else?

Q2: How long time does nginx keep this information for the number of accesses. Let’s say the file gets visited once in a 24 hour period; Would nginx keep the counter at 1 for that whole period, or are there some set timeout where it’s “flushed”.

Q3: If you have a user who decides to access files with a random query string on it; We want to prevent caching this to fill up the storage (The main reason for setting the proxy_cache_min_uses in the first place) – but are we gonna fill up the memory (and keys_zone limit) regardless; If yes – is there a way to prevent this?

Basically the goal is to understand even just broadly how min_uses are counted, and possibly how to prevent memory from being eaten up in case someone decides to access the same URL once with millions of requests – if there’s any way to flush out the memory for example, for anything that haven’t yet reached the proxy_cache_min_uses if it indeed uses up memory.

Best Regards,
Lucas Rolff



_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Memory usage in nginx proxy setup and use of min_uses

Lucas Rolff May 16, 2021 12:48PM

Re: Memory usage in nginx proxy setup and use of min_uses

Maxim Dounin May 17, 2021 10:38AM

Re: Memory usage in nginx proxy setup and use of min_uses

Lucas Rolff May 17, 2021 11:32AM

Re: Memory usage in nginx proxy setup and use of min_uses

Maxim Dounin May 17, 2021 03:08PM

Re: Memory usage in nginx proxy setup and use of min_uses

Lucas Rolff May 17, 2021 03:34PM

Re: Memory usage in nginx proxy setup and use of min_uses

Maxim Dounin May 17, 2021 09:28PM

Re: Memory usage in nginx proxy setup and use of min_uses

Lucas Rolff May 19, 2021 02:46PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 180
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready