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.

Need help with optimization!

Discussion in 'General Discussion' started by mike_r, Jun 13, 2004.

  1. mike_r

    mike_r Well-Known Member

    Joined:
    Nov 26, 2002
    Messages:
    45
    Likes Received:
    0
    Trophy Points:
    6
    Hey,

    I need some help with optimization of Apache & mySQL as sometimes my server load gets upto 1.30+.

    Average it remains 0.40+...

    I have already optimized my.cnf file by replacing the default my.cnf with the my-huge.cnf file. I had to optimize mySQL because a site that has a mysql db of over 650 mb caused the average load to be 1.30+..

    :: MY SERVER SPECS ::
    Intel P4 2.4 Ghz
    1 GB ECC DDRAM

    ----------- MY . CNF FILE --------------------

    port = 3306
    socket = /var/lib/mysql/mysql.sock

    # Here follows entries for some specific programs

    # The MySQL server
    [mysqld]
    port = 3306
    socket = /var/lib/mysql/mysql.sock
    skip-locking
    key_buffer = 384M
    max_allowed_packet = 1M
    table_cache = 512
    sort_buffer_size = 2M
    read_buffer_size = 2M
    myisam_sort_buffer_size = 64M
    thread_cache = 8
    query_cache_size = 32M
    # Try number of CPU's*2 for thread_concurrency
    thread_concurrency = 8

    # Replication Master Server (default)
    # binary logging is required for replication
    log-bin

    # required unique id between 1 and 2^32 - 1
    # defaults to 1 if master-host is not set
    # but will not function as a master if omitted
    server-id = 1

    [mysqldump]
    quick
    max_allowed_packet = 16M

    [mysql]
    no-auto-rehash
    # Remove the next comment character if you are not familiar with SQL
    #safe-updates

    [isamchk]
    key_buffer = 256M
    sort_buffer_size = 256M
    read_buffer = 2M
    write_buffer = 2M

    [myisamchk]
    key_buffer = 256M
    sort_buffer_size = 256M
    read_buffer = 2M
    write_buffer = 2M

    [mysqlhotcopy]
    interactive-timeout

    -------------------- END MY . CNF FILE -----------

    And From HTTPD.CONF :::

    TimeOut 300
    KeepAlive On
    MaxKeepAliveRequests 500
    KeepAliveTimeout 10

    MinSpareServers 32
    MaxSpareServers 64

    StartServers 5
    MaxClients 256
    MaxRequestsPerChild 0

    Sugesstions? Please do let me know..

    BTW, I have also installed PHPAccelerator and Mod_Gzip and the site loads fast now, but the server load is still the same.
     
    #1 mike_r, Jun 13, 2004
    Last edited: Jun 13, 2004
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
  3. mike_r

    mike_r Well-Known Member

    Joined:
    Nov 26, 2002
    Messages:
    45
    Likes Received:
    0
    Trophy Points:
    6
    That query cache is already enabled and so it didn't helped much. And also my query cache was already optimized for best results.

    Thanks for sharing though. Any more ideas?
     
  4. mike_r

    mike_r Well-Known Member

    Joined:
    Nov 26, 2002
    Messages:
    45
    Likes Received:
    0
    Trophy Points:
    6
    I also see leechprotect running sometimes. and exim also takes much resources.

    But httpd and mysql takes the most. Need help with them
     
  5. mr.wonderful

    mr.wonderful BANNED

    Joined:
    Feb 1, 2004
    Messages:
    345
    Likes Received:
    0
    Trophy Points:
    0
    1.3? If you think thats high then you have issues.
     
  6. mike_r

    mike_r Well-Known Member

    Joined:
    Nov 26, 2002
    Messages:
    45
    Likes Received:
    0
    Trophy Points:
    6
    Its now started to get upto 2.50 sincei installed phpaccelerator and mod_gzip..

    I know its not due to them but increasing hits. HELP ME ...:(
     
  7. mike_r

    mike_r Well-Known Member

    Joined:
    Nov 26, 2002
    Messages:
    45
    Likes Received:
    0
    Trophy Points:
    6
    there is a forum hosted on the server that used about 50 gb transfer with all plain content and very less images.

    So you can imagine how many hits that forum gets?? 50 gb transfer in 23 days..

    Now the load sometiems spikes to 9 and server reboots are often now..

    Help please :( ..
     
  8. mosaicsites

    mosaicsites Member

    Joined:
    Jun 30, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    *bump*

    You need a faster server.

    mod_gzip will not reduce cpu load, only increase it, because of the extra work the server has to do to compress the data before it is sent.

    mod_gzip will reduce your bandwidth use some, though.
     
  9. easyhttp

    easyhttp Active Member

    Joined:
    Dec 25, 2003
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Middle East - Jordan
    # Example MySQL config file for very large systems.
    #
    # This is for a large system with memory of 1G-2G where the system runs mainly
    # MySQL.
     
Loading...

Share This Page