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 can i get handle 5000 concurrent connections on apache2 ?
Hi, All
This is my first discussion here. I am going to live my website in 2-3 days and my server will be hitting around 5-6k concurrent connections. Please help me around to get my server handle these amount of connections.
Current Application Configuration :-
Apache2 web server with mpm_prefork module
Node js
Mysql server
PHP
Kindly suggest how to reach that figure.
Thanks
Comments
Hire a sysadmin.
Better switch to NGINX
You don't, you scrap Apache2 off for Nginx and bin mysql for MariaDB.
If you're doing 5k Concurrent connections then chuck Cloudflare in front to cache static content to relieve some strain and if you can replicate MariaDB (Article below) and your nginx server.
You could be pretty lazy on load balancing and just use round-robin DNS so users will randomly hit either web-server depending on what the DNS Server responds to them with.
Replication - MariaDB
https://mariadb.com/kb/en/library/setting-up-replication/
Roundrobin DNS - Lazy Load-Balancing
https://en.wikipedia.org/wiki/Round-robin_DNS
Apache2 cannot handle 5-6k Connections, I'd love to see someone do it though!
what kind website do you have?
caching your database query?
Step 1) yum/apt-get remove Apache/httpd
Step 2) nginx.org
Step 3) Profit?
In all seriousness, you definitely won’t achieve that many concurrent connections with Apache. It’ll choke — and believe me, Apache will hang. Anyway, you’re better off using NGINX or Litespeed as they’re far more optimized compared to Apache.
Having said that, NGINX doesn’t have “modules.” You’ll have to find someone to help or figure out how to find the necessary extensions before compiling NGINX and starting it up.
Good luck!
no sir ..i have to do it by myself
Sounds like a job for @eva2000
Apache not able to serve so many connections without spending hell a lot of resources. This is an architecture problem. Nginx can easy handle hell a lot of concurrent connections. NodeJS as far as I remember pretty fast too, at least usually in dozens of time faster than php-fpm, so why not just put nginx as front-end, nodejs as back-end.
And on nginx configure for specific pages, locations a cache for dynamic content which will expire after some time? Or setting up microcache can greatly reduce load under many concurrent connections. https://www.nginx.com/blog/benefits-of-microcaching-nginx/
If you know your app very well, you can setup a proxy_cache for your critical content, what will be taken from memory, instead of generating or waiting for your nodeJS for a response. But make sure that you know how to identify logged-in users from randoms, and will not deliver sensitive data.
I have an experience with delivering around 1k concurrent connections for around 8 hours a content though nginx to visitors in day of launching my project on super dirty cheap VPS with just nginx + php-fpm + myslq + caching mechanisms from nginx, which delivered a pretty old and heavy php dynamic app, forum, site.
Load balancers, more servers, and CDN for static resources. Also spend a bunch of time on app optimization including database and query tuning. But you're in a bad spot, launching in 3 days, not being anywhere near ready, and not being able to bring on help. Throwing more hardware can help with the read load but if there's too many updates you may be hosed.
I have noticed that people use Litespeed more.
Quick tips
example on Centmin Mod 123.09beta01 LEMP Nginx in reverse proxy mode without proxy cache handling 30,000 concurrent connections to E3-1270v6 broken down to 8 backend listening ports on same server
Centmin Mod Nginx vhost stats https://centminmod.com/nginx.html#vhoststats
would be interesting to know if you ever considered https://traefik.io/
Slower than std nginx so nope. Centmin Mod Nginx is already 20-40% faster than std Nginx distro provided binaries and has another optional 20-40% more performance by advanced config/features.
single E3-1270v6 dedicated handling 350,000 concurrent nginx connections (static files) on Centmin Mod 123.09beta01 LEMP Nginx via my wrk forked wrk-cmm
That and my custom built Haproxy load balancer is even faster https://community.centminmod.com/threads/addons-haproxy-sh-preview.12641/
Oh my.. it seems there was no website out there handling more than 5k before 2004 per LET. Hell, BBC only has around 2k visits per month.
This is Apache on 50-ish euros Hetzner server:
So yes, 1st reply to this thread makes most sense
using SLB - server loading balance
Depends on how the connections are measured :-D
If Google Analytics, Apache can easy do 12k online, if according to conntrack then easy 100k+ connections
in the end, how much req/s do you actually wanna handle? Because connections != requests per second.
You sack off apache and use nginx. Honestly.
My suggestion would be using litespeed instead, as that will read apache configuration file directly, saving you loads of time, and to be honest, it’s faster than nginx.
As long as your are not hosting porn or the items which they ban in the license, or you will end up with an very expensive and invalid license for it.
They take that serious too. So before you go litespeed be sure you read the agreement and that your contents will not break the license.
my 2 cents.
Cheers!
Would you care to provide a source for this? I can't find it in their repo.
Ty!
Just read their service agreement. It's all there.
P.S. Are they also the one that prohibits usage of any religious matters on their software?
Was expecting the same amount for my first blog
FAQ item 12 for planned OSes https://centminmod.com/faq.html
FYI, OpenLiteSpeed the open source version doesn't have such license restrictions so you can opt for that instead of LiteSpeed. Just saying FYI, Centmin Mod also have eventual plans to integrate both OpenLiteSpeed/Litespeed web servers amongst other planned features - Centmin Mod Development Roadmap
I know I know but I just can't wait
That explains why I couldn't find it. I thought we were talking about openlitespeed not the enterprise version since the OP probably doesn't want to pay for it.
And after looking at https://litespeedtech.com/docs/webserver/license-enterprise I don't see any restrictions for pornographic material only for illegal activity.
It does still say the software may not be used for anything illegal. That covers a board range of stuff.
Sure thats true and I understand that but I just wanted to point out to @TheLinuxBug that pornographic material can be allowed albeit it's legal of course.
It used to have it. I do recall Litespeed causing some controversies.
If my memory is correct, it was no porn and no religion stuff. Now, this is a long time ago, like 2008 or so.
After searching for it I've found some posts about litespeed not allowing it that date around 2006-2009 so maybe they've changed it to only prohibit illegal activity around that time?
a post from 2016 someone is stating that litespeed doesn't allow it but he also said in the same reply that and I quote
...
Well, they seem to be sticking to their principles. Can't blame them for that.
As said though, the free one is less restrictive for OP's needs.