Why you should use #nginx + microcache?
Everybody knows how hard is to push out as much as possible from your #webserver(s). In my daily occupation as a hosting engineer that means I fairly often get the same question, “Wow, cool website, but can it cope with big-time traffic?”.
Lets make a simlpe ab(apache benchmark) test of out site:
ab -n 1000 -c 100 http://board.local/
Tested on my travel notebook – AMD A8-4500M + 8GB RAM.
So as you can see, we have 10rps without #cache.
Now lets implement it. We will start with modifig config: board.local.conf
And we will need to add microcache zone settings to http section of nginx.conf:
fastcgi_cache_path /var/cache/nginx2 levels=1:2 keys_zone=microcache:5m max_size=1000m;
log_format cache '$remote_addr - $remote_user [$time_local] "$request" '
'$status $upstream_cache_status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
And lets test it again:
ab -n 1000 -c 100 http://board.local/
As you can see we have a HUGE growth of speed.
Yes the test is not very accurate,but the result can be easily estimated.