The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Server Load Problem

Discussion in 'General Discussion' started by zamribishan, Aug 2, 2005.

  1. zamribishan

    zamribishan Member

    Joined:
    Jan 30, 2005
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Dear All,

    I have lost my tension and lost my way to make my server load getting normal . My server load always get high and sometimes cam reach 300.

    My server spec is P4 2.8GHz with 2GB RAM

    Below is my my.cnf

    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    skip-locking
    skip-innodb
    query_cache_limit=1M
    query_cache_size=32M
    query_cache_type=1
    max_connections=500
    interactive_timeout=100
    wait_timeout=100
    connect_timeout=10
    thread_cache_size=80
    key_buffer=160M
    join_buffer=1M
    max_allowed_packet=16M
    table_cache=512
    record_buffer=1M
    sort_buffer_size=1M
    read_buffer_size=1M
    read_rnd_buffer_size=768K
    max_connect_errors=10
    #Try number of CPU's*2 for thread_concurrency
    thread_concurrency=2
    myisam_sort_buffer_size=64M
    log-bin
    server-id=1

    [mysql.server]
    user=mysql
    basedir=/var/lib

    [safe_mysqld]
    err-log=/var/log/mysqld.log
    #pid-file=/var/lib/mysql/mysql.pid
    #open_files_limit=8192

    [mysqldump]
    quick
    max_allowed_packet=16M

    [mysql]
    no-auto-rehash
    #safe-updates

    [isamchk]
    key_buffer=64M
    sort_buffer=64M
    read_buffer=16M
    write_buffer=16M

    [myisamchk]
    key_buffer=64M
    sort_buffer=64M
    read_buffer=16M
    write_buffer=16M

    [mysqlhotcopy]
    interactive-timeout

    Here is my httpd.conf setting

    Timeout 300
    KeepAlive On
    MaxKeepAliveRequests 0
    KeepAliveTimeout 2
    MinSpareServers 16
    MaxSpareServers 72
    StartServers 16
    MaxClients 200
    MaxRequestsPerChild 10000

    I normaly use MaxClient 300 , but i will make my server load high, my server has more than 50 client and mostly my client install CMS and there is about 5 popular website reside in my server.

    I would be very thankfull so much if u all can guide or help me in this matter.

    Regards in Advance
     
    #1 zamribishan, Aug 2, 2005
    Last edited: Aug 2, 2005
  2. lloyd_tennison

    lloyd_tennison Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    698
    Likes Received:
    1
    Trophy Points:
    18
    Need to know what operation is making it high.
     
  3. zamribishan

    zamribishan Member

    Joined:
    Jan 30, 2005
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    It will always my httpd and mysql
    here's the TOP

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    18573 nobody 15 0 44736 22m 10m S 9.3 1.1 0:09.40 httpd
    7828 mysql 16 0 212m 81m 1588 R 5.6 4.0 1:48.69 mysqld
    10752 nobody 15 0 45296 24m 12m S 4.6 1.2 0:18.39 httpd
    11565 nobody 16 0 43180 23m 13m S 4.6 1.2 0:14.20 httpd
    7799 mysql 15 0 212m 81m 1588 S 2.3 4.0 1:57.31 mysqld
    7801 mysql 16 0 212m 81m 1588 S 2.3 4.0 1:53.97 mysqld
    11551 nobody 15 0 43888 24m 12m S 0.7 1.2 0:08.67 httpd
    11563 nobody 16 0 43560 23m 12m S 0.7 1.1 0:13.15 httpd
    4526 mysql 16 0 212m 81m 1588 S 0.3 4.0 2:00.69 mysqld
    7817 mysql 16 0 212m 81m 1588 S 0.3 4.0 1:46.48 mysqld
    7823 mysql 15 0 212m 81m 1588 S 0.3 4.0 1:50.64 mysqld
    6001 nobody 16 0 44804 25m 14m S 0.3 1.3 0:29.57 httpd
    6002 nobody 15 0 45384 26m 13m S 0.3 1.3 0:27.96 httpd
    6067 nobody 16 0 45116 26m 14m S 0.3 1.3 0:33.02 httpd
    6109 nobody 16 0 45424 28m 15m S 0.3 1.4 0:27.45 httpd
    6111 nobody 16 0 45540 27m 14m S 0.3 1.3 0:19.84 httpd
    6114 nobody 15 0 43984 25m 14m S 0.3 1.3 0:18.46 httpd
    6120 nobody 16 0 43508 26m 15m S 0.3 1.3 0:35.19 httpd
    6122 nobody 15 0 45424 26m 14m S 0.3 1.3 0:17.71 httpd
    6214 nobody 16 0 44464 25m 13m S 0.3 1.2 0:27.76 httpd
    6285 nobody 16 0 43248 25m 14m S 0.3 1.2 0:26.99 httpd
    6821 nobody 16 0 43100 23m 13m S 0.3 1.2 0:31.50 httpd
    7302 nobody 15 0 44020 24m 12m S 0.3 1.2 0:11.59 httpd
    7304 nobody 16 0 44656 25m 13m S 0.3 1.3 0:36.42 httpd
    7361 nobody 16 0 45272 26m 13m S 0.3 1.3 0:27.56 httpd
    7369 nobody 15 0 42728 23m 13m S 0.3 1.1 0:23.08 httpd
    9648 nobody 16 0 43204 23m 13m S 0.3 1.2 0:17.23 httpd
    10482 nobody 15 0 41984 20m 11m S 0.3 1.0 0:06.53 httpd
    10742 nobody 15 0 45040 25m 13m S 0.3 1.3 0:19.28 httpd
     
    #3 zamribishan, Aug 2, 2005
    Last edited: Aug 2, 2005
  4. aby

    aby Well-Known Member

    Joined:
    May 31, 2005
    Messages:
    638
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India

    Looks like your server might be under some type of Dos attack. Anyway please have a check on the WHM.
    to see which user is taking too much resources.
     
  5. abubin

    abubin Well-Known Member

    Joined:
    Dec 7, 2004
    Messages:
    393
    Likes Received:
    1
    Trophy Points:
    18
    have you installed mod_security and APF firewall (with BFD)? If not then you must install them to at least stop some of the simple hack attempts.
     
  6. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    Even though, that won't be good enough to secure your server. You need to go after whoever is exahusting your server resources. It might be a Php/cgi script hackers can use to download, unzip and install their tools. You'll also need to remove these tools and make sure your server applications/services are up-t-date.

    We have seen this problem with so many clients and it is in your best interest to secure your server before it is too late.
     
  7. zamribishan

    zamribishan Member

    Joined:
    Jan 30, 2005
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    I think we are out of the topic here

    Back to my question, can someone here advice me on my current httpd.conf and my.cnf variable setting. Izzit ok or not with my server specification as i mentioned earlier

    Thanks
     
  8. aby

    aby Well-Known Member

    Joined:
    May 31, 2005
    Messages:
    638
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India

    You can turn off the keep alive from the httpd.conf. That will help. About the mysql and the server optimization , you can hire some one who can do the job.Atleast one should have to login to the server to tune it to your needs.
     
  9. abubin

    abubin Well-Known Member

    Joined:
    Dec 7, 2004
    Messages:
    393
    Likes Received:
    1
    Trophy Points:
    18
    you have to secure you server first to make sure that the problems are not due to some sort of attacks.

    Once you have done that, if server load is still high, then you can start tweaking apache and mysql. But I highly doubt you can reduce the load by even 20% by just tweaking apache and mysql as the standard installation is already working quite good. Maybe you can trace your server to see which sites are causing all these loads and work from there.
     
  10. PvUtrix

    PvUtrix Well-Known Member

    Joined:
    Mar 12, 2005
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Ekaterinburg - Russia
    cPanel Access Level:
    Root Administrator
    You could try increase thread_cache_size to 166
    It should be about 1/3 of the number of max_connections (adviced by MySQL)
     
Loading...

Share This Page