Welcome! Log In Create A New Profile

Advanced

Nginx cache is slow

August 19, 2011 03:58AM
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 ?
Subject Author Posted

Nginx cache is slow

ddarko August 19, 2011 03:58AM

Re: Nginx cache is slow

Maxim Dounin August 19, 2011 04:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 175
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