[HELP] Best way to config nginx to handle 25k concurrent users from a former Apache guy
Posted by StartupTim@reddit | linuxadmin | View on Reddit | 8 comments
Hey all,
I've been using Apache for quite some time on various community sites I've built. I've always used Apache and really enjoy the project to the point of doing what I can to support the ASF.
Now I need to use Nginx for something that would be hard for Apache to handle. I'm about to build something that needs to handle 25,000 - 50,000 concurrent, though very light, users. I have some very beefy servers, both in CPU, disk, and RAM, and network. The server will be serving some very lightweight, custom pages, generated with PHP.
Could you guys make some recommendations on configurations, possibly on a "per 5k user session" basis, or something global to handle 25,000 concurrent users?
EDIT: However, if somebody knows how to configure Apache to handle 25k-50k concurrent sessions, let me know!
Thanks in advance!!
t0c@reddit
25k concurrent users is a LOT of traffic, 216000000 hits per day! Until you know your bottlenecks you cannot know what you need to look at.
The general way I'd go is nginx + php-fpm. Use php 5.5+ + opcache. How much static content will you have? You'll likely want to put a varnish cache on top of all of this, depending on how much static content you'll have. The stack would look like Proxy (Varnish -> haproxy) --> App_Server(Nginx + php-fpm). Like this you can scale horizontally as well as vertically quite easy.
ExaminationNo1515@reddit
what is a hit ?
t0c@reddit
Requests on a path, one http GET.
ExaminationNo1515@reddit
oh wow thanks man , these wierd lingos makes the Tech career so obscure . Thanks for the help 😁👍
t0c@reddit
No worries. Every technical career has its own language. The first hurdle is learning the right words to Google, then you’ll slowly get the hang of it. First steps are hard, keep going it will make sense sooner or later! Good luck!
ExaminationNo1515@reddit
Thanks for the valuable guidance bro , highly appreciated ❤️
t0c@reddit
Hit me up if you have other questions, I’m passively around.
ExaminationNo1515@reddit
Sure bro , I am delighted to get to know you . Take love ❤️😊