by TekMol · 5y ago · 0 comments
I don't know how many requests per second it can handle.
Trying a guess via curl:
time curl --insecure --header 'Host: www.mysite.com' https://127.0.0.1 > test
This gives me 0.03s
So it could handle about 30 requests per second? Or 30x the number of CPUs? What do you guys think?
Best way to figure it out is to use an application like Apache Bench from a powerful computer with a good internet connection, throw a lot of concurrent connections at the site, and see what happens.
I just tried Apache Bench:
ab -n 1000 -c 100 'https://www.mysite.com'
Concurrency Level: 100
Time taken for tests: 1.447 seconds
Complete requests: 1000
Failed requests: 0
Requests per second: 691.19 [#/sec] (mean)
Time per request: 144.679 [ms] (mean)
Time per request: 1.447 [ms] (mean, across all concurrent requests)
Wow, that is fast. Around 700 requests per second!Upping it 10x times to 10k requests ...
Requests per second: 844.99 [#/sec] (mean)
Even faster!What is more important is what kind of requests your server has to serve. Nginx can easily serve 50-80k req/s of static content; 100ks range if tuned properly.
> In practice, we currently see peaks of above 2000 requests every single second during prime time. That is multiple billions of requests per month, or more than 10 million unique monthly visitors. And all of this before actually serving images.
If I am reading that correctly, 2000r/s does not include images, and makes it unclear if $1500/month does.
But it seems you think I wanted to start a dick measuring contest?
If your question is genuine: I would serve images via a CDN. The above timing is for assembling a page by doing an auth check, a bunch of database queries and templating the result.