Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How can i get handle 5000 concurrent connections on apache2 ?
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.

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

«1

Comments

  • FoulFoul Member

    Hire a sysadmin.

  • SV_NickSV_Nick Member
    edited August 2018

    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?

    Thanked by 1inklight
  • doghouchdoghouch Member
    edited August 2018

    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! :)

  • @Foul said:
    Hire a sysadmin.

    no sir ..i have to do it by myself :smile:

  • Sounds like a job for @eva2000

    Thanked by 1inklight
  • gurupal_s said: will be hitting around 5-6k concurrent connections.

    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.

    Thanked by 1gurupal_s
  • gurupal_s said: Kindly suggest how to reach that figure.

    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.

    Thanked by 1gurupal_s
  • I have noticed that people use Litespeed more.

    Thanked by 1gurupal_s
  • Quick tips

    1. type of concurrent connection matters. Nginx can server static files natively or proxy to php-fpm server for dynamic php files.
    2. Nginx is excellent at static file serving - I have pushed Centmin Mod Nginx to 10,000 to 350,000 concurrent connections on 1x and 2x Xeon E3-1270v5/6 for testing in single and load balanced proxy_cache configs as well as via haproxy + nginx on Vultr bare-metal at https://community.centminmod.com/threads/vultr-60-discount-free-100-credit-test-drive-vultr-bare-metal-instances.13744/ (see below screenshot)
    3. PHP serving via PHP-FPM will be limitation and require layers of caching at PHP-FPM fastcgi_cache level or offload higher up at web level i.e. Varnish Cache
    4. Having Cloudflare in front will dramatically lower resource usage especially with CF page rules.
    5. TCP Kernel level tuning is a must so rules out OpenVZ VPS, need to be able to tune so dedicated/kvm vps only

    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

  • ehabehab Member

    @eva2000 said:

    would be interesting to know if you ever considered https://traefik.io/ :)

    Thanked by 2coreflux gurupal_s
  • @ehab said:

    @eva2000 said:

    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/ :)

    Thanked by 2ehab gurupal_s
  • amarcamarc Veteran

    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

    Thanked by 2ralph gurupal_s
  • using SLB - server loading balance

    Thanked by 1gurupal_s
  • 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.

    Thanked by 2NanoG6 gurupal_s
  • You sack off apache and use nginx. Honestly.

    Thanked by 1gurupal_s
  • @eva2000 said:

    @ehab said:

    @eva2000 said:

    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/ :)

    Thanked by 1gurupal_s
  • 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.

    Thanked by 1gurupal_s
  • dedipromo said: 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!

    Thanked by 1gurupal_s
  • @TheLinuxBug said:

    dedipromo said: 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!

  • deankdeank Member, Troll
    edited August 2018

    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?

    Thanked by 1inklight
  • Was expecting the same amount for my first blog

    Thanked by 1dedipromo
  • FAQ item 12 for planned OSes https://centminmod.com/faq.html ;)

    TheLinuxBug said: 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.

    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 :tongue:

    FYI, OpenLiteSpeed the open source version doesn't have such license restrictions so you can opt for that instead of LiteSpeed. Just saying :)

    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.

  • deankdeank Member, Troll

    It does still say the software may not be used for anything illegal. That covers a board range of stuff.

  • @deank said:
    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.

  • deankdeank Member, Troll
    edited August 2018

    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.

  • @deank said:
    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

    if so use provider which runs Apache 2.4 which can be configured to run just as fast as LiteSpeed

    ...

  • deankdeank Member, Troll

    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.

Sign In or Register to comment.