Answer the question
In order to leave comments, you need to log in
Distribution of small statics. 1500 rps. How to speed up?
There is a need to distribute many thumbnails of pictures. Now the servers are suffocating, at rush hour there are big delays in the return of statics.
The size of pictures is 5-10kb.
Conducted testing with ab
result 1473 rps. In fact, it's worse because ab asked for the same picture, but in reality there are several million of them.
Do you think there is an opportunity to significantly increase the performance of servers? What can be tweaked in nginx and tcp / ip for a quick return on the picture?
nginx config
worker_processes 8;
events
{
worker_connections 4096;
multi_accept on;
}
access_log off;
log_not_found off;
error_log /var/log/nginx-error.log warn;
open_file_cache max=2000 inactive=20s;
open_file_cache_valid 60s;
open_file_cache_min_uses 5;
open_file_cache_errors off;
client_max_body_size 50M;
client_body_buffer_size 1m;
client_body_timeout 15;
client_header_timeout 15;
keepalive_timeout 2 2;
send_timeout 15;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
Answer the question
In order to leave comments, you need to log in
if you requested 1500rps on an empty server, then this is not enough for one file for ab to be at least 5000rps (or did you run tests on a 100Mbps network?)
suffocate - what is it expressed in? cpu, io?
while it really looks more like that everything rests on Io,
but how do you have these 1k images on the disk (an example of the full path to 1 of them)?
well, the config in the studio
What if you connect CloudFlare, set up headers when serving static from the server, and enjoy the free CDN?
If there is memory or another server, then there are 2 options:
- balancer from nginx
- put varnish before nginx
Turn on the caching of log records, in which data is written for image requests. Something like this:
access_log /var/log/nginx/access.log main buffer=32k;
Check the number of active connections on the machine.
Are there any messages in dmesg about nf_conntrack table overflowing?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question