More Apache Worker Threads?

Discussion in 'General' started by Kira, Oct 7, 2014.

  1. Kira

    Kira Member


    lately one of my websites became rather popular and is receiving a lot of visits (260.000) and hits (60.000.000), resulting in a big slowdown of the loading time of the site.

    When looking at the cpu usage of my server, it is about 5-10%. Still, a simple HTML site loads for 10-20sec.

    I think, this may be due to the amount of hits the site gets all the time, resulting in a waiting queue for one of Apaches workers - could this be the case?

    If this may be the issue of the slowdown, what's the best way to increase the performance again? Can I increase the number of worker threads maybe?

    Any help would be appreciated, thanks a lot :)

  2. srijan

    srijan New Member HowtoForge Supporter

  3. Kira

    Kira Member

    Thanks a lot, I've installed it and will see how much it improves the performance :)

    If there are any other way to speed things up, any ideas would be very appreciated!

    EDIT: From the first obvservations, the speed increase was only very little - if at all... :(

    Last edited: Oct 8, 2014
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    What kind of site is it? Does it use a cms with mysql backend or are this plain html pages without scripts?
  5. Kira

    Kira Member

    Mixed a bit... it is mostly a single plain HTML site that's using a lot of JavaScript (about 20 *.js files).

    But there is also one script that's calling a WSGI script, that's doing a MySQL query.

    From the 60 million hits per month, it's about 25% on the WSGI Script, the rest 75% are only on the html file, javascript files and very small images.

  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, then mysql can be a bottleneck as well. You can check and optimize your mysql database e.g. with the script mysqltuner.

    For a server with that many requests, I would have used nginx instead of apache as nginx can handle the load much mor efficiently. But you cant switch easily between the two, so thts most likely an option for the next server and not the current one.

    To speed up the delivery if the static pages, you can e.g. add a varnish server in front of apache.
  7. Kira

    Kira Member

    I checked all my MySQL queries and everything MySQL related and am very sure, it is not the bottleneck.

    Unfortunately I didn't see this coming when setting up this server.. never thought I would have such a frequently used website :)

    But since I plan to move to a new server host soon anyway... does nginx work nicely with ISPConfig?

    Can I safely just install varnish? I just heard of such a thing for the first time, and do not want to risk any major down-time when installing it.

    One thing about my first idea of increasing the number of worker threads, no one said anything about this - is this because it's a bad idea to increase them?

    Thanks a lot,
  8. Kira

    Kira Member

    I just turned off KeepAlive - and now it's running super fast again :)

    I know the downsides of it.. but, it does the trick and I can see how and why on my website - so it's fine :)

    Thanks a lot for all your help!
  9. JaySM

    JaySM New Member

    KeepAlive really does slow down my site too. Are there any alternatives to KA that don't slow down your site so much?
    KeepAlive really does slow down my site too. Are there any alternatives to KA that don't slow down your site so much?
  10. Well-Known Member HowtoForge Supporter

    Nope, there is no real alternative to KA.
    But you can try to add etags / caching / add pre gzipped static content for your server to reduce the load.
    Also check your website, like just load the new content of a file by using ajax requests.
    Put static content like images/css/js on a different host which not only will make the browser to load more elements at the same time ( there is a limit how many files are loaded from the same domain simultanisly ).
    Make use of CDN or get a second IP and let something lightweight like nginx listen on that and tune it to deliver static content.

Share This Page