Nginx proxy cache grows then shrinks back after increasing key size

I have a 4TB disk as a dedicated nginx proxy cache. The disk usage remains constant at around 3000GB, dispite the max_size set to 3600g. When I increase the key_zone size from 15000m to 20000m, I observe the disk usage increasing over the course of a day, and then receding back.

The files being cached vary between a few kilobytes and a gigabyte, though most files would be under 100 megabytes.

Can anyone explain what is going on here? I’m just trying to get the cache to utilize as much of the disk as possible.

Any advice appreciated, thank you.

enter image description here

Read more here: Source link