Nginx response time
In order to optimize my nginx system I have used the following 3 tutorials/tips.
1. A few tips I used to boost my nginx system
Tip 1 – Accelerate and Secure Applications with a Reverse Proxy Server
Tip 2 – Add a Load Balancer
Tip 3 – Cache Static and Dynamic Content
Tip 4 – Compress Data
Tip 5 – Optimize SSL/TLS
Tip 6 – Implement HTTP/2 or SPDY
Tip 7 – Update Software Versions
Tip 8 – Tune Linux for Performance
Tip 9 – Tune Your Web Server for Performance
Tip 10 – Monitor Live Activity to Resolve Issues and Bottlenecks
More info: https://www.nginx.com/blog/10-tips-for-10x-application-performance/
2. Very good tutorial to optimize Nginx configuration
https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration
3. Tracking Application Response Time with Nginx
I added the following block to /etc/nginx/nginx.conf
log_format timed_combined '$remote_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent" ' '$request_time $upstream_response_time $pipe';
Next we modify our access_log directives to use the new format:
access_log /var/log/nginx/yourdomain.com.access.log timed_combined;
Here’s an example of the log output:
66.249.71.173 - - [08/Nov/2010:14:16:18 -0600] "GET /blog/2010/apr/30/installing-geodjango-dependencies-homebrew/ HTTP/1.1" 200 6569 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" 0.640 0.640 .
The last part will show you the time it took to serve:
0.640 in this case
Some clever log filtering can now show you exactly where and when your stack is slowing down, giving you clues about where to start optimizing.
More info: https://lincolnloop.com/blog/tracking-application-response-time-nginx/