New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
How to benchmark Nginx?
I setup an Nginx server in front of my s3 storage as reverse proxy. Nginx proxy and also cache images in my s3 storage.
For example people people can get image via www.myNginxServer.com/image.jpeg
When i load image, i see cache status HIT.
But i wanna test it under load. How many simultaneous downloads can my server support? How can I test this?
Comments
wrk -t20 -c256 -d10 http://yourIP:80
My Golang server can hold ~1 million per second for text/html.
Image serving on nginx will probably be around 500 to 1k, but depends on the hardware of course.
Can you elaborate this command a little bit?
t for threads
c for concurrent connection
And d stands for what?
Duration in seconds.
Doesnt really matter if it's 10 or 60. Request/second should give you constant results.
Ah. Duration of course. But this test only send random http requests right? is there any way to send GET request for my cached image? To see how many download I get for that specific image per second?
I would suggest to use S3 > CF (TTL 0) > your nginx cache. That will ease ur data transfer cost. But if u r using other objectt storage, there's no CF option.
You can use wrk or some other load test tools to generate the traffics and measure at nginx end on throughput and IO including hit and misses.
İ tried that. But cname record that I created in cloudflare doesn't work. İt works on browser. İ can get file but in Nginx it doesn't work. İ don't know why. So i bypassed cloudflare
I am referring to CF = Cloudfront. Not sure which S3 you are using.
Ah i see. İ thought you were talking about cloudflare. I'm using B2 cloud storage. And bandwidth is free from B2 to Cloudflare. İ tried double layer cache(cloudflare and my own Nginx) but when I put cloudflare between Nginx and my storage, Nginx always return 502 Bad Gateway error. İ don't know why
h2load can generate HTTP/2 traffic to stress test your server.
How you did it? I am trying to do the same setup with B2 & CF, but no success.
https://help.backblaze.com/hc/en-us/articles/217666928-Using-Backblaze-B2-with-the-Cloudflare-CDN
İ followed this tutorial.
A reminder. İ assume you will use cloudflare free plan. Cloudflare doesn't allow proxying video files. And also " unappropriate number of images" also prohibited. They can terminate your account without giving you a warning. That's what their ToS says.
But if you download a couple objetcs that would be ok i guess.