Results 1 to 12 of 12
  1. #1

    Question [Help] Server with high load


    I run a server with about 500 sites. All of then have MySQL connections.

    Apart this I send a newsletter every day for 20K contacts.

    I have load avarage all day. Load Averages: 26.19 26.59 26.42

    My Server:

    Dell Poweredge
    Dual 2 x 2.8GHz Xeon
    4GB DDR2
    2x320GBs SATA II

    I already try to optimized the server, but with no affect.

    WHM Optimization

    ***WHM/cPanel Optimization***

    Spam Assassin
    Spam Assassin can take up a lot of memory and make it really hard to host just a few sites on a VPS, but there is a way around this...

    Login to WHM as root, scroll down to "cPanel 10.8.1-R15" (it may be slightly different depending on what version you are using) then goto "Addon Modules" and install "spamdconf". Once it's done, refresh the WHM page, scroll down to "Add-ons" on the nav bar and then click on 'Setup Spamd Startup Configuration". Set "Maximum Children" to "2". Then hit Submit. Wait a few seconds (15-30, but usually less) for exim to restart and you're done .

    cPanel Tweak Setings
    Login to WHM as root, and under "Server Configuration" on the nav bar hit "Tweak Settings".

    Here are some suggested settings:
    Default catch-all/default address behavior for new accounts. fail will generally save the most CPU time.
    - Use "FAIL". If you already have some accounts setup not to use "FAIL" (by default it will not) then run this command to convert to FAIL from BLACKHOLE --> perl -pi -e "s/:blackhole:/:fail:/g;" /etc/valiases/*

    - Mailman tends to use a lot of resources, so if you don't need cpanel mailing lists then uncheck this.

    Number of minutes between mail server queue runs (default is 60).:
    - You may want to set this to 180 to reduce load.

    Track the origin of messages sent though the mail server by adding the X-Source headers (exim 4.34+ required)
    - This is just generally a good idea. So check this.

    Analog Stats
    - I find this useless, so uncheck this. If you want to delete the existing analog stats files just run this command --> rm -rf /home/*/tmp/analog/*

    Awstats Reverse Dns Resolution
    - Make sure this is unchecked, I find it pretty much useless for most users.

    Awstats Stats
    - You can check this if you need a robust stats software that integrates with cPanel, if you don't need it, then don't check it. *Note most hosting clients will want to use this. If you want to delete the existing awstats stats files just run this command --> rm -rf /home/*/tmp/awstats/*

    Webalizer Stats
    - Not many hosting clients will want to use this so, you can uncheck this to reduce load. If you want to delete the existing webalizer stats files just run this command --> rm -rf /home/*/tmp/webalizer/*

    Delete each domain's access logs after stats run
    - Make sure this is checked, otherwise disk space usage can really rack up!


    max_connections = 400
    key_buffer = 64M
    join_buffer_size = 1M
    read_buffer_size = 1M
    sort_buffer_size = 2M
    table_cache = 1024
    thread_cache_size = 286
    interactive_timeout = 25
    wait_timeout = 1000
    connect_timeout = 10
    max_heap_table_size = 128M
    max_allowed_packet = 16M
    max_connect_errors = 10
    read_rnd_buffer_size = 524288
    query_cache_limit = 1M
    query_cache_size = 16M
    query_cache_type = 1
    query_prealloc_size = 163840
    tmp_table_size = 32M
    myisam_sort_buffer_size = 32M
    query_alloc_block_size = 32768
    bulk_insert_buffer_size = 16M

    open_files_limit = 8192

    max_allowed_packet = 16M

    key_buffer = 32M
    sort_buffer = 32M
    read_buffer = 16M
    write_buffer = 16M

    Any advice for a better optimization?

  2. #2
    Join Date
    Mar 2005
    optimize mysql and your apache for better and if possible limit your user download/upload speed
    ||| JFOC Network Solution - Affordable Web Hosting
    ||| Web Site:
    ||| Retelling Story - Share Your Story, anything
    ||| Web Site:

  3. #3
    Join Date
    Apr 2009
    1st thing I'd do is to cache the hell out of everything.

    A lot of dynamic pages could be generated once, cached and served to multiple users. This GREATLY reduces load on your application & MySQL. To do that, you could put a caching reverse proxy like Squid or Varnish in front of your web server.

    Also use memcached to cache your MySQL query results. This further reduces load on your MySQL.

    I noticed you're using MyISAM, which is bad for tables that are frequently updated because it uses table lock. If your tables are frequently updated by users, switch them to InnoDB, which uses row-level locks and could give you a big speed up if your writes are currently blocking your reads.

    Optimize your table design & SQL. Are there any queries that run especially slowly? Try to limit joins. Are you using index correctly? remove unnecessary indexes and create indexes that help speed up your queries.

    If possible, switch from Apache to Nginx, which should further reduce load.

    Those are all software optimizations that could speed things up a lot. But if you don't have the time or expertise to do that, you could always just throw more hardware at the problem:

    -get a quad core processor, preferably a Nehalem
    -more RAM is always better, try 8G or more
    -if your workload is IO-bound, try RAID 10 with SAS disks. A RAID 10 controller with BBU could work wonder.

  4. #4
    Join Date
    Apr 2009
    New York City
    I would limit the users download and upload speed. It should help a little bit i'd say.

  5. #5
    Join Date
    Aug 2001
    Orange County, CA
    MySQLTuner can give you some useful suggestions once the MySQL process has been running and collecting stats for a while:

    You say your load is in the 20s constantly, but what does 'top' show is eating the most CPU? MySQL? If so, you may also want to look at moving the MySQL temporary directory to another disk. Turn on the slow query log and see if busy tables are missing indexes (though with shared hosting you'll likely need to let those users know to upgrade their software or isolate them).

    And I know it's heresy in shared hosting, but you may just need to spread those sites over more than a single box; moving the heaviest trafficked sites first.
    Jeff Standen, Chief of R&D, WebGroup Media LLC. - LinkedIn
    Cerb is a fast and flexible web-based platform for business collaboration and automation.

  6. #6
    I have had success tweaking with the ServerLimit and MaxClients. I agree caching can really speed things up.

  7. #7
    Join Date
    Feb 2006
    North West England
    It may be worth moving the MySQL server onto a seperate box, and have the web server on the current box. If you've got that many sites running on one server, all using MySQL, then its likely to be the DB thats causing the issue.

    For a DB server, i'd try and go for:

    Quad core Xeon
    8Gb RAM
    Dual SAS drives (or even velociraptors)

    Caching can speed things up tremendously, but a load of 26 may be a little too much even for that - personally i'd throw another box in, and cache everything - you'll have much more breathing room then.

    Host High - reliable UK hosting

  8. #8
    Join Date
    Jun 2009
    San Francisco, CA
    As someone already mentioned, you should figure out what's eating up system resources. Run top to see memory and cpu utilization by process. Also, check on I/O wait times and overall memory utilization. See if your system is swapping memory.

    Before you know what to fix, you need to know what the problem is. :-)

    With load in the 20's, your system must be very slow.


  9. #9
    Join Date
    Mar 2005
    Limiting speed will be possible using cband. Just search from google about this cband.

    Here is quick refference:

    Best Regards
    ||| JFOC Network Solution - Affordable Web Hosting
    ||| Web Site:
    ||| Retelling Story - Share Your Story, anything
    ||| Web Site:

  10. #10
    Join Date
    Mar 2009
    Chicago, IL
    I'd stay away from limiting your connections or networking in any way, shape or form. You end up killing the quality of your service to reduce the serverload. Not a good tradeoff in my book.

    First big thing would be to use a PHP Caching agent of some sort. We've personally had very good luck with XCache when it's configured and setup properly. However you can't just install it with the base configs and assume it's going to save your machine. and are a couple of writeups we did regarding it. Follow those and you'll see a fairly decent drop in serverload.

    Now, as to MySQL, it really just depends here. As has been stated several times, we'd love to see the output of top while your server is heavily loaded as that'll help us quite a bit. There's simply not a "golden config" that we can give you as every MySQL instance is a bit different and unique.

    Also it should be noted that memcached will be of no use to you unless your applications are specifically written to take advantage of it.

    Paste the output of top and we can help out a bit further.

  11. #11
    Join Date
    Jun 2006
    Ahh' UnderPants

  12. #12
    I have a similar problem.
    Here's some information:

    Web Server with Apache 2.2.
    Mysql ver. 5.0.45 via socket on x86_64 centos 5.2, 1 CPU 4core with 4 Gb RAM, 3Tb SATA disk space
    Load avg: 0.81 (1 min) 0.68 (5 mins) 0.73 (15 mins)
    Real memory 3.86 GB total, 1.38 GB used
    Virtual memory 4 GB total, 288 kB used
    [[email protected] init.d]# top
    top - 14:59:07 up 1 day, 34 min,  1 user,  load average: 9.94, 10.91, 11.07
    Mem:   6231956k total,  4825868k used,  1406088k free,   410000k buffers
    Swap:  2040212k total,        0k used,  2040212k free,  3164740k cached
    24804 mysql     16   0 1451m 410m 4476 S 132.5  6.7   1468:33 mysqld
     4874 root      16   0  5400 2800 1308 S  0.0  0.0   0:19.15 hald
    These are the red marked rows on Runtime Information in phpMyAdmiin
    Slow_queries  	14 k
    Innodb_buffer_pool_reads  	33
    Handler_read_rnd  	24 M
    Handler_read_rnd_next  	3,316.21 M
    Slow_launch_threads  	2
    Created_tmp_disk_tables  	3,624 
    Select_full_join  	621
    Select_range_check  	1 
    Opened_tables  	12 k
    Table_locks_waited  	17 k
    At the moment I'm setting up slow log to detect the slow queries.

    phpMyAdmin on high Handler_read_rnd_next:
    The number of requests to read the next row in the data file. This is high if you are doing a lot of table scans. Generally this suggests that your tables are not properly indexed or that your queries are not written to take advantage of the indexes you have.
    So I am going to check the indexing of tables.
    The biggest table has over 40,000 rows.

    I appreciate any suggestions and help.

Similar Threads

  1. high server load / high swap / lots of httpd
    By hbhb in forum Hosting Security and Technology
    Replies: 12
    Last Post: 02-22-2008, 09:17 AM
  2. Server load: How high is too high?
    By t325 in forum Dedicated Server
    Replies: 5
    Last Post: 05-02-2007, 12:56 AM
  3. Please.. Help high server load
    By dinodonk in forum Hosting Security and Technology
    Replies: 5
    Last Post: 06-29-2006, 05:24 AM
  4. Server load not very high but pages load slowly
    By singtel22 in forum Hosting Security and Technology
    Replies: 17
    Last Post: 01-27-2005, 02:43 PM
  5. How high Server load is high
    By Chris2001 in forum Hosting Security and Technology
    Replies: 14
    Last Post: 03-09-2004, 09:02 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts