Rss Feed

welcome to my space

Sever Config Help, please!

March 13th, 2010 by , under nnmj.com.

  • I have two vBs on one server. Both average about 45 people online at a time, with spikes of up to 75 or so.

    Hardware is as follows:
    PIII 800Mhz
    512MB RAM
    30GB IDE drive

    Software:
    RedHat 7.0
    Apache 1.3.22
    PHP 4.1.2
    MySQL 3.23.32

    I should note upfront that hardware upgrades aren't a possibility at the current time.

    My server load runs at about 1.00 on average, but sometimes spikes to 2.5 or 3.0. At times the load drops as low as 0.15. It can range from 0.15 all the way up to 3.0, with no significant difference in number of users logged in. It can go from 0.20 to 2.00 in a split second. This isn't horrible, and the performance is OK, but it seems like a high load and a wild variance for the smallish size of our forums. I'm mostly wondering if people agree with me that my load SHOULD be lower, and also looking for some expertise on PHP/Apache/MySQL optimization. Just some advice would be great.

    Here's some info that may help:

    PHP Info page:
    http://autobot.isdlab.com/test.php

    MySQL Extended Status (at a fairly average time....0.90 load).

    +--------------------------+------------+
    Variable_name Value
    +--------------------------+------------+
    Aborted_clients 0
    Aborted_connects 3
    Bytes_received 6079764
    Bytes_sent 2149209661
    Connections 336
    Created_tmp_disk_tables 31
    Created_tmp_tables 397
    Created_tmp_files 0
    Delayed_insert_threads 0
    Delayed_writes 0
    Delayed_errors 0
    Flush_commands 1
    Handler_delete 1622
    Handler_read_first 1049
    Handler_read_key 202708
    Handler_read_next 749382
    Handler_read_prev 0
    Handler_read_rnd 168317
    Handler_read_rnd_next 7903606
    Handler_update 61192
    Handler_write 15782
    Key_blocks_used 2814
    Key_read_requests 792256
    Key_reads 2807
    Key_write_requests 4077
    Key_writes 3628
    Max_used_connections 111
    Not_flushed_key_blocks 0
    Not_flushed_delayed_rows 0
    Open_tables 274
    Open_files 481
    Open_streams 0
    Opened_tables 280
    Questions 38621
    Select_full_join 72
    Select_full_range_join 0
    Select_range 5902
    Select_range_check 0
    Select_scan 5974
    Slave_running OFF
    Slave_open_temp_tables 0
    Slow_launch_threads 5
    Slow_queries 9
    Sort_merge_passes 0
    Sort_range 8485
    Sort_rows 168449
    Sort_scan 1935
    Threads_cached 19
    Threads_created 112
    Threads_connected 93
    Threads_running 1
    Uptime 1447
    +--------------------------+------------+

    At the moment, the load shows 0.90, and the mysql process list is filled with "Sleep" processes.

    Here's a current top output:

    3:50pm up 27 min, 3 users, load average: 0.50, 0.69, 0.78
    223 processes: 222 sleeping, 1 running, 0 zombie, 0 stopped
    CPU states: 20.8% user, 7.5% system, 0.0% nice, 71.5% idle
    Mem: 515884K av, 297480K used, 218404K free, 387792K shrd, 17068K buff
    Swap: 506036K av, 0K used, 506036K free 130880K cached

    Here's my my.cnf file:

    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    set-variable = max_connections=500
    set-variable = key_buffer=12M
    set-variable = myisam_sort_buffer_size=64M
    set-variable = join_buffer=2M
    set-variable = record_buffer=2M
    set-variable = sort_buffer=2M
    set-variable = table_cache=1024
    set-variable = thread_cache_size=256
    set-variable = wait_timeout=7200
    set-variable = connect_timeout=10

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

    [safe_mysqld]
    open_files_limit=8192
    pid-file=/var/run/mysqld/mysqld.pid
    err-log=/var/log/mysqld.log

    [mysqldump]
    quick
    set-variable = max_allowed_packet=128M

    [myisamchk]
    set-variable = key_buffer=64M
    set-variable = sort_buffer=64M
    set-variable = read_buffer=16M
    set-variable = write_buffer=16M

    Most of the time, when the load spikes, I see mySQL and httpd processes running high on the CPU in top, but not bad on the memory. Something like 40% CPU for mySQL isn't uncommon, and it'll be at like 2% mem.

    FWIW...basically everything installed on my box is done with RPMs, through the up2date program. However, I did configure and compile PHP myself, since RedHat doesn't have a 4.1.2 version available.

    Any help woudl be wonderful!

    Thanks in advance!


  • edit you my.cnf file and restart mysql with this


    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    set-variable = max_connections=400
    set-variable = key_buffer=16M
    set-variable = myisam_sort_buffer_size=64M
    set-variable = join_buffer=2M
    set-variable = record_buffer=2M
    set-variable = sort_buffer=4M
    set-variable = table_cache=1024
    set-variable = thread_cache_size=256
    set-variable = wait_timeout=7200
    set-variable = connect_timeout=10

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

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

    [mysqldump]
    quick
    set-variable = max_allowed_packet=128M

    [myisamchk]
    set-variable = key_buffer=64M
    set-variable = sort_buffer=64M
    set-variable = read_buffer=16M
    set-variable = write_buffer=16M
    see if that helps

    is the cpu load spikes for the 1 min, 5 min or 15 min intervals ?

    for 1 min intervals and maybe 5 min it's okay







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Sever Config Help, please! , Please add it free.