Nginx cache is slow

ddarko nginx-forum at nginx.us
Fri Aug 19 07:58:09 UTC 2011


Nginx 1.1.0

location / {
	uwsgi_cache tna;
	uwsgi_cache_use_stale error timeout http_500;
	uwsgi_cache_valid  any  10m;
	uwsgi_cache_key $request_uri;
	
	include /etc/nginx/params_uwsgi;
	uwsgi_intercept_errors off;
	uwsgi_pass unix:/tmp/uwsgi-tna.sock;
}

I made a simple test: $ ab -c 10 -n 10000 http://.... on localhost.
I am sure that the request is sent to uWSGI only once and is then
cached.
result: Requests per second:    3712.93 [#/sec] (mean)

Meanwhile, on the same machine and the same nginx for static file
reaches the result:
Requests per second:    4826.62 [#/sec] (mean)

How is that static files are faster to 30%! from the cache based on
static files ?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214027,214027#msg-214027



More information about the nginx mailing list