Optimization request [single server]

  • 1. Dedicated Server

    2. Server Specs:

    AMD Opteron 242
    4GB RAM
    2x73GB SCSI
    CentOS 4.4
    lighttpd-1.4.15 (if you think apache or apache2 is better, willing to try it out)
    PHP 4.4.7
    MySQL 4.1.22

    3. vBulletin 3.6.4

    4. No innodb database in server, only has forum's database

    5. Binary installed

    6. Top stats

    top - 08:34:16 up 19 days, 11:25, 2 users, load average: 37.86, 42.91, 43.79
    Tasks: 173 total, 4 running, 169 sleeping, 0 stopped, 0 zombie
    Cpu(s): 76.3% us, 23.3% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 0.0% si
    Mem: 3960528k total, 3884232k used, 76296k free, 132332k buffers
    Swap: 2096440k total, 2448k used, 2093992k free, 1560204k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    29879 mysql 17 0 379m 306m 2700 R 62 7.9 3175:05 mysqld
    19021 root 15 0 145m 17m 9596 S 28 0.4 0:03.86 php
    9612 root 15 0 147m 23m 14m S 11 0.6 1:00.34 php
    11316 root 16 0 145m 24m 16m S 9 0.6 1:05.31 php
    15681 root 15 0 145m 23m 15m S 9 0.6 0:31.55 php
    17411 root 15 0 144m 20m 12m S 9 0.5 0:11.74 php
    14523 root 16 0 146m 22m 14m S 8 0.6 0:35.70 php
    14760 root 16 0 146m 22m 14m S 8 0.6 0:39.85 php
    9886 root 16 0 144m 23m 14m S 5 0.6 1:08.78 php
    14672 root 16 0 144m 22m 14m S 4 0.6 0:35.60 php
    31038 root 15 0 652m 648m 624 S 4 16.8 203:28.38 lighttpd
    7. my.cnf

    [mysqld]
    ft_min_word_len=3
    datadir=/var/lib/mysql
    max_connections=700
    key_buffer_size=128M
    query_cache_size=64M
    myisam_sort_buffer_size=128M
    join_buffer=1M
    record_buffer=1M
    sort_buffer=2M
    table_cache=1024
    thread_cache_size=32
    wait_timeout=7200
    connect_timeout=10
    max_allowed_packet=64M
    max_connect_errors=10
    skip-innodb
    skip-locking
    interactive_timeout=30
    thread_concurrency=2

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

    [mysqldump]
    quick
    max_allowed_packet=16M

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

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

    [mysqlhotcopy]
    interactive-timeout

    [client]
    socket=/tmp/mysql.sock
    8. var ext stat ver

    +---------------------------------+------------------------------------------+
    Variable_name Value
    +---------------------------------+------------------------------------------+
    back_log 50
    basedir /
    binlog_cache_size 32768
    bulk_insert_buffer_size 8388608
    character_set_client latin1
    character_set_connection latin1
    character_set_database latin1
    character_set_results latin1
    character_set_server latin1
    character_set_system utf8
    character_sets_dir /usr/share/mysql/charsets/
    collation_connection latin1_swedish_ci
    collation_database latin1_swedish_ci
    collation_server latin1_swedish_ci
    concurrent_insert ON
    connect_timeout 10
    datadir /var/lib/mysql/
    date_format %Y-%m-%d
    datetime_format %Y-%m-%d %H:%i:%s
    default_week_format 0
    delay_key_write ON
    delayed_insert_limit 100
    delayed_insert_timeout 300
    delayed_queue_size 1000
    expire_logs_days 0
    flush OFF
    flush_time 0
    ft_boolean_syntax + -><()~*:""&
    ft_max_word_len 84
    ft_min_word_len 3
    ft_query_expansion_limit 20
    ft_stopword_file (built-in)
    group_concat_max_len 1024
    have_archive YES
    have_bdb NO
    have_blackhole_engine NO
    have_compress YES
    have_crypt YES
    have_csv NO
    have_example_engine NO
    have_geometry YES
    have_innodb DISABLED
    have_isam NO
    have_merge_engine YES
    have_ndbcluster NO
    have_openssl NO
    have_query_cache YES
    have_raid NO
    have_rtree_keys YES
    have_symlink YES
    init_connect
    init_file
    init_slave
    innodb_additional_mem_pool_size 1048576
    innodb_autoextend_increment 8
    innodb_buffer_pool_awe_mem_mb 0
    innodb_buffer_pool_size 8388608
    innodb_data_file_path
    innodb_data_home_dir
    innodb_fast_shutdown ON
    innodb_file_io_threads 4
    innodb_file_per_table OFF
    innodb_flush_log_at_trx_commit 1
    innodb_flush_method
    innodb_force_recovery 0
    innodb_lock_wait_timeout 50
    innodb_locks_unsafe_for_binlog OFF
    innodb_log_arch_dir
    innodb_log_archive OFF
    innodb_log_buffer_size 1048576
    innodb_log_file_size 5242880
    innodb_log_files_in_group 2
    innodb_log_group_home_dir
    innodb_max_dirty_pages_pct 90
    innodb_max_purge_lag 0
    innodb_mirrored_log_groups 1
    innodb_open_files 300
    innodb_table_locks ON
    innodb_thread_concurrency 8
    interactive_timeout 30
    join_buffer_size 1044480
    key_buffer_size 134217728
    key_cache_age_threshold 300
    key_cache_block_size 1024
    key_cache_division_limit 100
    language /usr/share/mysql/english/
    large_files_support ON
    lc_time_names en_US
    license GPL
    local_infile ON
    locked_in_memory OFF
    log OFF
    log_bin OFF
    log_error
    log_slave_updates OFF
    log_slow_queries OFF
    log_update OFF
    log_warnings 1
    long_query_time 10
    low_priority_updates OFF
    lower_case_file_system OFF
    lower_case_table_names 0
    max_allowed_packet 67107840
    max_binlog_cache_size 4294967295
    max_binlog_size 1073741824
    max_connect_errors 10
    max_connections 700
    max_delayed_threads 20
    max_error_count 64
    max_heap_table_size 16777216
    max_insert_delayed_threads 20
    max_join_size 18446744073709551615
    max_length_for_sort_data 1024
    max_prepared_stmt_count 16382
    max_relay_log_size 0
    max_seeks_for_key 4294967295
    max_sort_length 1024
    max_tmp_tables 32
    max_user_connections 0
    max_write_lock_count 4294967295
    myisam_data_pointer_size 4
    myisam_max_extra_sort_file_size 2147483648
    myisam_max_sort_file_size 2147483647
    myisam_recover_options OFF
    myisam_repair_threads 1
    myisam_sort_buffer_size 134217728
    myisam_stats_method nulls_unequal
    net_buffer_length 16384
    net_read_timeout 30
    net_retry_count 10
    net_write_timeout 60
    new OFF
    old_passwords OFF
    open_files_limit 3500
    pid_file /var/lib/mysql/zerotohundred.com.pid
    port 3306
    preload_buffer_size 32768
    prepared_stmt_count 0
    protocol_version 10
    query_alloc_block_size 8192
    query_cache_limit 1048576
    query_cache_min_res_unit 4096
    query_cache_size 67108864
    query_cache_type ON
    query_cache_wlock_invalidate OFF
    query_prealloc_size 8192
    range_alloc_block_size 2048
    read_buffer_size 1044480
    read_only OFF
    read_rnd_buffer_size 262144
    relay_log_purge ON
    relay_log_space_limit 0
    rpl_recovery_rank 0
    secure_auth OFF
    server_id 0
    skip_external_locking ON
    skip_networking OFF
    skip_show_database OFF
    slave_net_timeout 3600
    slave_transaction_retries 0
    slow_launch_time 2
    socket /var/lib/mysql/mysql.sock
    sort_buffer_size 2097144
    sql_mode
    sql_notes ON
    sql_warnings ON
    storage_engine MyISAM
    sync_binlog 0
    sync_frm ON
    sync_replication 0
    sync_replication_slave_id 0
    sync_replication_timeout 0
    system_time_zone GMT
    table_cache 1024
    table_type MyISAM
    thread_cache_size 32
    thread_stack 196608
    time_format %H:%i:%s
    time_zone SYSTEM
    tmp_table_size 33554432
    tmpdir
    transaction_alloc_block_size 8192
    transaction_prealloc_size 4096
    tx_isolation REPEATABLE-READ
    version 4.1.22-standard
    version_comment MySQL Community Edition - Standard (GPL)
    version_compile_machine i686
    version_compile_os pc-linux-gnu
    wait_timeout 7200
    +---------------------------------+------------------------------------------+

    +----------------------------+------------+
    Variable_name Value
    +----------------------------+------------+
    Aborted_clients 48
    Aborted_connects 32
    Binlog_cache_disk_use 0
    Binlog_cache_use 0
    Bytes_received 3792667756
    Bytes_sent 437695819
    Com_admin_commands 0
    Com_alter_db 0
    Com_alter_table 0
    Com_analyze 0
    Com_backup_table 0
    Com_begin 0
    Com_change_db 5205247
    Com_change_master 0
    Com_check 0
    Com_checksum 0
    Com_commit 0
    Com_create_db 0
    Com_create_function 0
    Com_create_index 0
    Com_create_table 0
    Com_dealloc_sql 0
    Com_delete 79963
    Com_delete_multi 0
    Com_do 0
    Com_drop_db 0
    Com_drop_function 0
    Com_drop_index 0
    Com_drop_table 0
    Com_drop_user 0
    Com_execute_sql 0
    Com_flush 0
    Com_grant 0
    Com_ha_close 0
    Com_ha_open 0
    Com_ha_read 0
    Com_help 0
    Com_insert 712960
    Com_insert_select 1752
    Com_kill 0
    Com_load 0
    Com_load_master_data 0
    Com_load_master_table 0
    Com_lock_tables 52421
    Com_optimize 0
    Com_preload_keys 0
    Com_prepare_sql 0
    Com_purge 0
    Com_purge_before_date 0
    Com_rename_table 0
    Com_repair 0
    Com_replace 111039
    Com_replace_select 0
    Com_reset 0
    Com_restore_table 0
    Com_revoke 0
    Com_revoke_all 0
    Com_rollback 0
    Com_savepoint 0
    Com_select 10995245
    Com_set_option 587690
    Com_show_binlog_events 0
    Com_show_binlogs 0
    Com_show_charsets 0
    Com_show_collations 0
    Com_show_column_types 0
    Com_show_create_db 0
    Com_show_create_table 0
    Com_show_databases 0
    Com_show_errors 0
    Com_show_fields 105
    Com_show_grants 0
    Com_show_innodb_status 0
    Com_show_keys 2
    Com_show_logs 0
    Com_show_master_status 0
    Com_show_ndb_status 0
    Com_show_new_master 0
    Com_show_open_tables 0
    Com_show_privileges 0
    Com_show_processlist 79
    Com_show_slave_hosts 0
    Com_show_slave_status 0
    Com_show_status 81
    Com_show_storage_engines 0
    Com_show_tables 2
    Com_show_variables 32
    Com_show_warnings 0
    Com_slave_start 0
    Com_slave_stop 0
    Com_stmt_close 0
    Com_stmt_execute 0
    Com_stmt_prepare 0
    Com_stmt_reset 0
    Com_stmt_send_long_data 0
    Com_truncate 0
    Com_unlock_tables 52421
    Com_update 2775895
    Com_update_multi 0
    Connections 5709039
    Created_tmp_disk_tables 84226
    Created_tmp_files 383112
    Created_tmp_tables 1370796
    Delayed_errors 0
    Delayed_insert_threads 0
    Delayed_writes 0
    Flush_commands 1
    Handler_commit 0
    Handler_delete 239275
    Handler_discover 0
    Handler_read_first 1302656
    Handler_read_key 135656710
    Handler_read_next 1299113067
    Handler_read_prev 15292615
    Handler_read_rnd 5188024
    Handler_read_rnd_next 1791663748
    Handler_rollback 0
    Handler_update 3610398
    Handler_write 6267914
    Key_blocks_not_flushed 0
    Key_blocks_unused 0
    Key_blocks_used 115980
    Key_read_requests 1240708813
    Key_reads 495911
    Key_write_requests 2381758
    Key_writes 1460111
    Max_used_connections 205
    Not_flushed_delayed_rows 0
    Open_files 1065
    Open_streams 0
    Open_tables 1024
    Opened_tables 2455
    Qcache_free_blocks 6706
    Qcache_free_memory 37166104
    Qcache_hits 15431167
    Qcache_inserts 10708560
    Qcache_lowmem_prunes 217971
    Qcache_not_cached 234250
    Qcache_queries_in_cache 10810
    Qcache_total_blocks 29009
    Questions 41715265
    Rpl_status NULL
    Select_full_join 38
    Select_full_range_join 0
    Select_range 3360772
    Select_range_check 0
    Select_scan 2871583
    Slave_open_temp_tables 0
    Slave_retried_transactions 0
    Slave_running OFF
    Slow_launch_threads 2329
    Slow_queries 27635
    Sort_merge_passes 231283
    Sort_range 3289589
    Sort_rows 3052318071
    Sort_scan 375391
    Table_locks_immediate 24160909
    Table_locks_waited 840918
    Threads_cached 7
    Threads_connected 105
    Threads_created 110129
    Threads_running 28
    Uptime 492838
    +----------------------------+------------+

    Uptime: 492865 Threads: 99 Questions: 41718874 Slow queries: 27644 Opens: 2455 Flush tables: 1 Open tables: 1024 Queries per second avg: 84.646
    mysqladmin Ver 8.41 Distrib 4.1.22, for pc-linux-gnu on i686
    (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
    This software comes with ABSOLUTELY NO WARRANTY. This is free software,
    and you are welcome to modify and redistribute it under the GPL license

    Server version 4.1.22-standard
    Protocol version 10
    Connection Localhost via UNIX socket
    UNIX socket /tmp/mysql.sock
    Uptime: 5 days 16 hours 54 min 25 sec

    Threads: 99 Questions: 41718874 Slow queries: 27644 Opens: 2455 Flush tables: 1 Open tables: 1024 Queries per second avg: 84.646
    Mysql report

    MySQL 4.1.22-standard uptime 5 16:58:47 Wed May 30 08:46:08 2007

    __ Key __________________________________________________ _______________
    Buffer usage 113.26M of 128.00M %Used: 88.49
    Write ratio 0.61
    Read ratio 0.00

    __ Questions __________________________________________________ _________
    Total 41.75M 84.67/s
    QC Hits 15.44M 31.32/s %Total: 36.99
    DMS 14.69M 29.79/s 35.18
    Com_ 5.90M 11.97/s 14.14
    COM_QUIT 5.71M 11.59/s 13.69
    +Unknown 93 0.00/s 0.00
    Slow 27.75k 0.06/s 0.07 %DMS: 0.19
    DMS 14.69M 29.79/s 35.18
    SELECT 11.00M 22.31/s 26.36 74.91
    UPDATE 2.78M 5.63/s 6.65 18.92
    INSERT 715.29k 1.45/s 1.71 4.87
    REPLACE 111.10k 0.23/s 0.27 0.76
    DELETE 80.03k 0.16/s 0.19 0.54
    Com_ 5.90M 11.97/s 14.14
    change_db 5.21M 10.56/s 12.48
    set_option 588.52k 1.19/s 1.41
    lock_tables 52.54k 0.11/s 0.13

    __ SELECT and Sort __________________________________________________ ___
    Scan 2.87M 5.83/s %SELECT: 26.12
    Range 3.36M 6.82/s 30.57
    Full join 38 0.00/s 0.00
    Range check 0 0.00/s 0.00
    Full rng join 0 0.00/s 0.00
    Sort scan 375.73k 0.76/s
    Sort range 3.29M 6.68/s
    Sort mrg pass 231.55k 0.47/s

    __ Query Cache __________________________________________________ _______
    Memory usage 28.24M of 64.00M %Used: 44.12
    Block Fragmnt 26.42%
    Hits 15.44M 31.32/s
    Inserts 10.72M 21.73/s
    Prunes 217.97k 0.44/s
    Insrt:Prune 49.16:1 21.29/s
    Hit:Insert 1.44:1

    __ Table Locks __________________________________________________ _______
    Waited 844.26k 1.71/s %Total: 3.37
    Immediate 24.18M 49.03/s

    __ Tables __________________________________________________ ____________
    Open 1.02k of 1024 %Cache: 100.00
    Opened 2.46k 0.00/s

    __ Connections __________________________________________________ _______
    Max used 205 of 700 %Max: 29.29
    Total 5.71M 11.59/s

    __ Created Temp __________________________________________________ ______
    Disk table 84.34k 0.17/s
    Table 1.37M 2.78/s
    File 383.53k 0.78/s

    __ Threads __________________________________________________ ___________
    Running 74 of 154
    Cache 15 %Hit: 98.07
    Created 110.51k 0.22/s
    Slow 2342 0.00/s

    __ Aborted __________________________________________________ ___________
    Clients 48 0.00/s
    Connects 32 0.00/s

    __ Bytes __________________________________________________ _____________
    Sent 670.62M 1.36k/s
    Received 3.80G 7.70k/s
    9. vb and two phpAds

    10.
    roughly, we disable the who's online feature
    average user: 500~600
    max concurrent user: 1316
    cookie timeout : 600sec

    11. http://www.zerotohundred.com/info.php

    12.
    server.max-fds = 2048
    server.max-connections = 700
    server.max-keep-alive-requests = 10
    server.max-keep-alive-idle = 5

    13. none exceed 2GB

    14.

    Linux zerotohundred.com 2.6.9-42.0.10.ELsmp #1 SMP Tue Feb 27 10:11:19 EST 2007 i686 athlon i386 GNU/Linux

    core file size (blocks, -c) unlimited
    data seg size (kbytes, -d) unlimited
    file size (blocks, -f) unlimited
    pending signals (-i) 1024
    max locked memory (kbytes, -l) 32
    max memory size (kbytes, -m) unlimited
    open files (-n) 1024
    pipe size (512 bytes, -p) 8
    POSIX message queues (bytes, -q) 819200
    stack size (kbytes, -s) unlimited
    cpu time (seconds, -t) unlimited
    max user processes (-u) 62463
    virtual memory (kbytes, -v) unlimited
    file locks (-x) unlimited

    processor : 0
    vendor_id : AuthenticAMD
    cpu family : 15
    model : 5
    model name : AMD Opteron(tm) Processor 242
    stepping : 10
    cpu MHz : 1594.051
    cache size : 1024 KB
    fdiv_bug : no
    hlt_bug : no
    f00f_bug : no
    coma_bug : no
    fpu : yes
    fpu_exception : yes
    cpuid level : 1
    wp : yes
    flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext lm 3dnowext 3dnow
    bogomips : 3189.98

    processor : 1
    vendor_id : AuthenticAMD
    cpu family : 15
    model : 5
    model name : AMD Opteron(tm) Processor 242
    stepping : 10
    cpu MHz : 1594.051
    cache size : 1024 KB
    fdiv_bug : no
    hlt_bug : no
    f00f_bug : no
    coma_bug : no
    fpu : yes
    fpu_exception : yes
    cpuid level : 1
    wp : yes
    flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext lm 3dnowext 3dnow
    bogomips : 3186.47


  • where you getting 5.4% from ??

    but yes i expected cpu loads to drop somewhat :)


  • Here's the top and free result with disabled memcache since the last post.


    Sorted by memory
    top - 17:48:56 up 28 days, 20:39, 2 users, load average: 4.20, 3.72, 3.85
    Tasks: 150 total, 1 running, 149 sleeping, 0 stopped, 0 zombie
    Cpu0 : 60.7% us, 22.7% sy, 0.0% ni, 16.7% id, 0.0% wa, 0.0% hi, 0.0% si
    Cpu1 : 57.5% us, 33.2% sy, 0.0% ni, 9.3% id, 0.0% wa, 0.0% hi, 0.0% si
    Mem: 3960528k total, 3886920k used, 73608k free, 182380k buffers
    Swap: 2096440k total, 768k used, 2095672k free, 1982484k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    8272 mysql 10 -5 314m 280m 2864 S 90 7.3 2058:55 mysqld
    25531 root 15 0 212m 208m 596 S 1 5.4 88:03.26 lighttpd
    2946 root 16 0 144m 20m 12m S 0 0.5 0:06.21 php
    2233 root 16 0 144m 20m 12m S 0 0.5 0:04.73 php
    2905 root 16 0 144m 19m 12m S 21 0.5 0:06.76 php
    2730 root 16 0 144m 19m 12m S 0 0.5 0:03.54 php
    2483 root 19 0 145m 19m 11m R 7 0.5 0:02.40 php
    2945 root 16 0 144m 18m 11m S 0 0.5 0:01.20 php

    # free -m
    total used free shared buffers cached
    Mem: 3867 3792 75 0 178 1936
    -/+ buffers/cache: 1677 2190
    Swap: 2047 0 2046

    I'll post with memcache after a day or two.

    Regarding the tweak you gave, it has dropped the load by almost half. You really did an amazing job. I'll attach our load average graph.

    http://rixv.net/zth_Lavg.png

    For lighttpd, does 5.4% memory considered as big ? If compare to previous, 16% i think this is considered small, let me know if its not.


  • my first post indicate that lighttpd is using 16.8% of memory

    31038 root 15 0 652m 648m 624 S 4 16.8 203:28.38 lighttpd
    while my second shows 5.4%

    25531 root 15 0 212m 208m 596 S 1 5.4 88:03.26 lighttpd


    With memcache result since last post

    total used free shared buffers cached
    Mem: 3867 3772 95 0 168 1882
    -/+ buffers/cache: 1722 2145
    Swap: 2047 1 2046



    top - 07:46:34 up 31 days, 10:37, 1 user, load average: 71.70, 64.91, 54.17
    Tasks: 151 total, 65 running, 86 sleeping, 0 stopped, 0 zombie
    Cpu(s): 84.0% us, 15.8% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.2% hi, 0.0% si
    Mem: 3960528k total, 3876448k used, 84080k free, 172480k buffers
    Swap: 2096440k total, 1276k used, 2095164k free, 1927840k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    8272 mysql 10 -5 320m 286m 2872 S 49 7.4 3546:20 mysqld
    25531 root 15 0 212m 208m 596 S 4 5.4 137:29.29 lighttpd
    22560 root 21 0 144m 21m 13m R 0 0.5 0:06.01 php
    22806 root 18 0 145m 20m 12m R 0 0.5 0:02.14 php
    22430 root 20 0 144m 20m 12m R 0 0.5 0:04.01 php
    22633 root 19 0 145m 19m 11m R 3 0.5 0:04.60 php
    22832 root 21 0 144m 19m 11m R 3 0.5 0:01.51 php
    22528 root 21 0 144m 18m 10m R 3 0.5 0:04.74 php
    22682 root 19 0 144m 18m 10m R 0 0.5 0:04.69 php
    22684 root 25 0 144m 18m 10m R 3 0.5 0:03.39 php
    22397 root 21 0 145m 18m 10m R 0 0.5 0:08.31 php
    3048 nobody 15 0 56688 18m 392 S 0 0.5 8:34.95 memcached


  • try disabling memcache and see what it does for memory usage..

    what does

    top

    and

    free -m

    output report


  • ah there.. yeah much less memory used indeed.. :)


  • probably need to run either enabled or disabled for longer than 2 minutes.. maybe a whole day or two ?


  • Before disable memcache

    top - 17:31:57 up 25 days, 20:22, 2 users, load average: 1.88, 2.77, 3.62
    Tasks: 153 total, 3 running, 150 sleeping, 0 stopped, 0 zombie
    Cpu0 : 21.9% us, 5.3% sy, 0.0% ni, 72.4% id, 0.0% wa, 0.3% hi, 0.0% si
    Cpu1 : 27.2% us, 13.2% sy, 0.0% ni, 59.6% id, 0.0% wa, 0.0% hi, 0.0% si
    Mem: 3960528k total, 3903520k used, 57008k free, 204368k buffers
    Swap: 2096440k total, 2184k used, 2094256k free, 2023632k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    9270 mysql 10 -5 311m 280m 2588 S 21 7.2 980:07.91 mysqld
    7698 root 16 0 144m 16m 9068 S 14 0.4 0:08.35 php
    7699 root 19 0 144m 15m 8352 S 11 0.4 0:06.96 php
    7785 root 19 0 143m 11m 5636 S 7 0.3 0:00.22 php
    7780 root 17 0 143m 13m 6932 R 4 0.3 0:00.81 php
    25531 root 15 0 15208 10m 548 S 2 0.3 11:11.19 lighttpd

    # free -m
    total used free shared buffers cached
    Mem: 3867 3823 44 0 199 1976
    -/+ buffers/cache: 1647 2220
    Swap: 2047 2 2045


    After disable memcache

    top - 17:33:50 up 25 days, 20:24, 2 users, load average: 1.61, 2.40, 3.39
    Tasks: 152 total, 6 running, 146 sleeping, 0 stopped, 0 zombie
    Cpu0 : 37.3% us, 5.0% sy, 0.0% ni, 57.0% id, 0.7% wa, 0.0% hi, 0.0% si
    Cpu1 : 41.2% us, 4.3% sy, 0.0% ni, 51.2% id, 3.3% wa, 0.0% hi, 0.0% si
    Mem: 3960528k total, 3865264k used, 95264k free, 204496k buffers
    Swap: 2096440k total, 772k used, 2095668k free, 2024412k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    7800 root 19 0 144m 14m 7088 S 16 0.4 0:01.26 php
    7788 root 20 0 144m 16m 9640 S 14 0.4 0:04.93 php
    7787 root 20 0 144m 17m 9888 S 13 0.4 0:07.13 php
    7805 root 20 0 143m 12m 6512 S 11 0.3 0:01.25 php
    9270 mysql 10 -5 311m 280m 2588 S 7 7.2 980:28.82 mysqld
    7794 root 18 0 144m 15m 7392 S 6 0.4 0:01.95 php
    7678 root 17 0 143m 15m 8260 S 5 0.4 0:08.03 php
    7785 root 18 0 144m 16m 9076 S 5 0.4 0:04.64 php
    7782 root 17 0 143m 16m 9104 R 3 0.4 0:03.77 php
    7717 root 17 0 144m 15m 8648 R 2 0.4 0:03.81 php
    25531 root 15 0 15208 10m 548 S 1 0.3 11:12.97 lighttpd

    # free -m
    total used free shared buffers cached
    Mem: 3867 3798 69 0 199 1976
    -/+ buffers/cache: 1622 2245
    Swap: 2047 0 2046


  • thanks eva, we've implemented your suggestion and still monitoring server's load and cpu. will get back to you on how it goes. Meanwhile, i was wondering if upgrading the ram would be a good solution for us and also how much will be sufficient ?

    8588 root 16 0 23464 19m 548 R 2 0.5 30:50.06 lighttpd


    i think lighttpd doesn't use that much memory now, perhaps it was leaking but disabling several modules that weren't use solves this.

    we also installed apc and memcache but we didn't see any difference. perhaps we could tweak this as well.

    let me know if memory upgrade would help us.

    Thanks eva and alexanderT, i appreciate your help.


  • 31038 root 15 0 652m 648m 624 S 4 16.8 203:28.38 lighttpd
    Your lighttpd process seems to be leaking memory. What extensions do you have enabled? Try to disable everything you don't need and restart the process.

    Your Lighttpd process seems to have been running for a long time... do you not rotate logs?


  • Besides checking with lighttpd folks about possible memory leaks, try the following in this exact order. You can ignore any of the suggestions that you have already done.

    1. Edit /etc/my.cnf and place the following mysql server settings in /etc/my.cnf and restart mysql server afterwards


    [client]
    socket=/tmp/mysql.sock

    [mysqld]
    ft_min_word_len=3
    datadir=/var/lib/mysql
    safe-show-database
    old_passwords
    back_log = 75
    skip-innodb
    max_connections = 500
    key_buffer = 192M
    myisam_sort_buffer_size = 64M
    join_buffer_size = 1M
    read_buffer_size = 1M
    sort_buffer_size = 3M
    table_cache = 2500
    thread_cache_size = 384
    wait_timeout = 45
    connect_timeout = 10
    tmp_table_size = 128M
    max_heap_table_size = 128M
    max_allowed_packet = 64M
    max_connect_errors = 10
    thread_concurrency = 4
    read_rnd_buffer_size = 524288
    bulk_insert_buffer_size = 8M
    query_cache_limit = 3M
    query_cache_size = 48M
    query_cache_type = 1
    query_prealloc_size = 131072
    query_alloc_block_size = 65536
    default-storage-engine = MyISAM

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

    [mysqld_safe]
    log-error=/var/log/mysqld-err.log
    #log-slow-queries=/var/log/mysqld-slow.log
    pid-file=/var/lib/mysql/mysql.pid
    nice = -5
    open_files_limit = 8192

    [mysqldump]
    quick
    max_allowed_packet = 16M

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

    [mysqlhotcopy]
    interactive-timeout


    2. Try the PHP caching software, Xcache - http://www.vbulletin.com/forum/showthread.php?t=213267

    3. Upgrade to vB 3.6.7 http://www.vbulletin.com/forum/showthread.php?t=229950 if you're on vB 3.6.x

    4. If you just upgraded to vB 3.5.x/3.6.x try to disable these 4 options:

    Admin CP -> vBulletin Options -> Forums Home Page Options -> Display Logged in Users?

    Admin CP -> vBulletin Options -> Forum Display Options (forumdisplay) -> Show Users Browsing Forums

    Admin CP -> vBulletin Options -> Thread Display Options -> Show Users Browsing Thread

    Admin CP -> vBulletin Options -> Message Searching Options -> Automatic Similar Thread search

    5. PHPADS disable persistent connections in config settings


  • Here are the list of modules enabled


    mod_rewrite
    mod_redirect
    mod_alias
    mod_access
    mod_auth
    mod_status
    mod_setenv
    mod_fastcgi
    mod_userdir
    mod_cgi
    mod_accesslog
    I didn't rotate the log because only error.log were recorded.

    I restarted lighttpd and here's the new status

    19442 root 15 0 19132 13m 648 S 3 0.4 31:12.89 lighttpd







  • #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 Optimization request [single server] , Please add it free.