Welcome! Log In Create A New Profile

Advanced

proxy_cache_path max_size doesn't work

Elias Abacioglu
March 08, 2016 07:24AM
Hi,

I'm using nginx as a reverse proxy with caching on a ramdisk
/var/cache/nginx is a tmpfs of the size 1800m.
And this is my proxy_cache_path line in nginx:

proxy_cache_path /var/cache/nginx levels=1:2 use_temp_path=off
keys_zone=default:50m inactive=120m max_size=1500m;

This is the error message when the ramdisk is filled.

[crit] 1460#0: *14844194 pwritev() "/var/cache/nginx/temp/3/12/0001578123"
failed (28: No space left on device) while reading upstream, client: XXX,
server: , request: "GET /xxx.jpg HTTP/1.1", upstream: "
http://127.0.0.1:81/xxx.jpg", host: "xxx.com", referrer: "http://xxx.com/"


I see two problems here.
1. Why didn't max_size work and clear the space in the tmpfs mount when it
got past 1500m?
2. Why doesn't nginx just bypass the cache and serve from upstrean when the
mount is full instead of hard failing?

And what solutions do I have?
Do I increase the ramdisk/tmpfs size?
Do I decrease the max_size?
Should I run a external cronjob that restarts nginx when the ramdisk is
more than 1500MB?

Or is nginx proxy_cache_path broken and do I need to change to another
solution like squid or varnish?
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

proxy_cache_path max_size doesn't work

Elias Abacioglu March 08, 2016 07:24AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 317
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready