nappedeptrole

welcome to my space

01/09/2009 (7:33 am)

Optimization request (low CPU, high memory)

Filed under: nappedeptrole.com edit
  • Hi:
    Starting a few weeks ago I started noticing very high memory usage most of the time 80%-90% while server load remains low (0.9). It does seem to be affecting site speed, and Vbulletin for the first time even hung yesterday, creating processes that took up most of the server resources before I killed them.

    1. Server Type
    Dedicated. Only one site running on it.

    2. Server Specs
    P4 3.0ghz single CPU
    1 gig RAM
    Linux Apache 1.3.33
    PHP version: 4.3.11
    MySQL version: 4.0.25-standard

    3. innodb type databases/tables
    Not sure

    4. how mysql was compiled/installed
    Not sure

    5. Top Status


    top - 05:33:50 up 109 days, 20:57, 1 user, load average: 0.15, 0.11, 0.09
    Tasks: 277 total, 1 running, 275 sleeping, 0 stopped, 1 zombie
    Cpu(s): 1.3% us, 0.8% sy, 0.0% ni, 96.9% id, 0.7% wa, 0.0% hi, 0.3% si
    Mem: 1002260k total, 978040k used, 24220k free, 20180k buffers
    Swap: 5116692k total, 78544k used, 5038148k free, 115912k cached
    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    2856 nobody 15 0 23512 11m 4968 S 0.7 1.2 0:02.31 httpd
    8395 nobody 15 0 20264 8456 4672 S 0.7 0.8 0:00.11 httpd
    2872 nobody 15 0 23656 11m 4968 S 0.3 1.2 0:03.03 httpd
    2876 nobody 15 0 23432 11m 4968 S 0.3 1.2 0:02.62 httpd
    2888 nobody 15 0 23528 11m 4968 S 0.3 1.2 0:01.90 httpd
    2892 nobody 15 0 23440 11m 4968 S 0.3 1.2 0:02.26 httpd
    2931 nobody 15 0 23488 11m 4968 S 0.3 1.2 0:02.16 httpd
    2945 nobody 15 0 23396 11m 4968 S 0.3 1.2 0:02.42 httpd
    2957 nobody 15 0 23484 11m 4968 S 0.3 1.2 0:02.25 httpd
    9098 nobody 15 0 23364 11m 4960 S 0.3 1.2 0:00.16 httpd
    9165 gchiang 16 0 2244 1016 728 R 0.3 0.1 0:00.03 top
    1 root 16 0 2904 324 300 S 0.0 0.0 0:12.90 init
    2 root RT 0 0 0 0 S 0.0 0.0 0:04.05 migration/0
    3 root 34 19 0 0 0 S 0.0 0.0 0:06.86 ksoftirqd/0
    4 root RT 0 0 0 0 S 0.0 0.0 0:04.04 migration/1
    5 root 34 19 0 0 0 S 0.0 0.0 0:03.97 ksoftirqd/1
    6 root 5 -10 0 0 0 S 0.0 0.0 5:18.60 events/0


    6. my.cnf settings
    Well, either my server is actually using another file other than /etc/my.cnf, or it's seriously lacking:

    [mysqld]
    set-variable = max_connections=500
    safe-show-database

    7. extended-service

    +--------------------------+------------+
    Variable_name Value
    +--------------------------+------------+
    Aborted_clients 377
    Aborted_connects 32970
    Bytes_received 2206052782
    Bytes_sent 3432958250
    Com_admin_commands 0
    Com_alter_table 497
    Com_analyze 0
    Com_backup_table 0
    Com_begin 39
    Com_change_db 8196708
    Com_change_master 0
    Com_check 350
    Com_commit 39
    Com_create_db 27
    Com_create_function 0
    Com_create_index 481
    Com_create_table 285
    Com_delete 195847
    Com_delete_multi 0
    Com_drop_db 0
    Com_drop_function 0
    Com_drop_index 0
    Com_drop_table 1
    Com_flush 80
    Com_grant 296
    Com_ha_close 0
    Com_ha_open 0
    Com_ha_read 0
    Com_insert 2567015
    Com_insert_select 3450
    Com_kill 0
    Com_load 0
    Com_load_master_data 0
    Com_load_master_table 0
    Com_lock_tables 80531
    Com_optimize 350
    Com_purge 0
    Com_rename_table 0
    Com_repair 0
    Com_replace 259503
    Com_replace_select 0
    Com_reset 0
    Com_restore_table 0
    Com_revoke 26
    Com_rollback 0
    Com_savepoint 0
    Com_select 65610285
    Com_set_option 155190
    Com_show_binlog_events 0
    Com_show_binlogs 17
    Com_show_create 12295
    Com_show_databases 473
    Com_show_fields 12334
    Com_show_grants 45
    Com_show_keys 53
    Com_show_logs 0
    Com_show_master_status 0
    Com_show_new_master 0
    Com_show_open_tables 0
    Com_show_processlist 31746
    Com_show_slave_hosts 0
    Com_show_slave_status 0
    Com_show_status 2
    Com_show_innodb_status 0
    Com_show_tables 13201
    Com_show_variables 447
    Com_slave_start 0
    Com_slave_stop 0
    Com_truncate 0
    Com_unlock_tables 80531
    Com_update 7675861
    Com_update_multi 56797
    Connections 8423170
    Created_tmp_disk_tables 683
    Created_tmp_tables 208530
    Created_tmp_files 3
    Delayed_insert_threads 0
    Delayed_writes 0
    Delayed_errors 0
    Flush_commands 1
    Handler_commit 0
    Handler_delete 1445644
    Handler_read_first 14616721
    Handler_read_key 552449112
    Handler_read_next 169747181
    Handler_read_prev 4235067
    Handler_read_rnd 76696083
    Handler_read_rnd_next 4141392144
    Handler_rollback 0
    Handler_update 7927860
    Handler_write 25286660
    Key_blocks_used 7793
    Key_read_requests 1180681109
    Key_reads 711660
    Key_write_requests 3148891
    Key_writes 2304069
    Max_used_connections 293
    Not_flushed_key_blocks 0
    Not_flushed_delayed_rows 0
    Open_tables 64
    Open_files 116
    Open_streams 0
    Opened_tables 91598
    Questions 93344728
    Qcache_queries_in_cache 0
    Qcache_inserts 0
    Qcache_hits 0
    Qcache_lowmem_prunes 0
    Qcache_not_cached 0
    Qcache_free_memory 0
    Qcache_free_blocks 0
    Qcache_total_blocks 0
    Rpl_status NULL
    Select_full_join 6349
    Select_full_range_join 0
    Select_range 15453617
    Select_range_check 0
    Select_scan 17224555
    Slave_open_temp_tables 0
    Slave_running OFF
    Slow_launch_threads 581
    Slow_queries 372
    Sort_merge_passes 0
    Sort_range 4519043
    Sort_rows 116094062
    Sort_scan 1445249
    Table_locks_immediate 112600880
    Table_locks_waited 7460
    Threads_cached 0
    Threads_created 8423169
    Threads_connected 2
    Threads_running 1
    Uptime 9492287
    +--------------------------+------------+

    8. Is vb the only thing running?
    No, but it's the only dynamic portion. The rest of the site is just shtml calling no server scripts.

    9. how many average and max concurrent users...
    50-250 users, though it seems mostly search engine and other bots. Actual daily posts is only around 20.

    10. create a PHPinfo file...
    http://www.dynamicdrive.com/phpinfo.php

    11. httpd.conf file

    Timeout 300
    KeepAlive On
    MaxKeepAliveRequests 100
    KeepAliveTimeout 15
    MinSpareServers 30
    MaxSpareServers 50
    StartServers 30
    MaxClients 512
    MaxRequestsPerChild 10000

    12. what version of vB are you running ?
    3.52

    13. check to see if any files
    Nope, no 2 gig files...

    Thanks for any help. If possible at all, I'd prefer to just optimize any MySQL settings such as my.cnf and not install additional software or accelerators. The server is mantained by the host, and I'd like to keep it simple for their sake.

    Thanks, and definitely bedtime now for me. :)


  • Don't read the WHM readout of what the server is using, login to SSH and issue the top command and read that.

    Yes you can use the my.cnf without upgrading, but I'd advise doing it as soon as possible.,


  • Just an update, I've went ahead and just upgraded the RAM from 1 gig to 2 gig, and that basically fixed the swap issue- 0 now. hehe. One thing's for sure, vBulletin 3.5 definitely seems to require more memory than 3.0, since nothing had changed apart from the upgrade that suddenly led to the memory problems. :)


  • Glad it helped.. yes 3.5.x does use more memory due to the additional features :)


  • well looks like it might be lack of ram if you need 400+ maxclients set - means to server more concurrent users you need more ram as 1GB won't be enough.. i'd suggest at least 2GB to start


  • Hi Zachery:
    Thanks. Can I use your new my.cnf without performing the previous two upgrades first (apache/ php)? My web host performs these updates on a particular cycle, so usually I'd prefer to just let them do that when they're ready. I gather the .cnf settings given are not PHP/Apache sensitive.

    Regarding RAM usage, I'm aware the server will tend to try and use as much as possible, though until recently, it's usually just hovers around 50%, though these days, it's always 70-90%, with SWAP around 10%-15%. But bottom line, I'm noticing a sluggishness
    Thanks,


  • We'll definately need the httpd.conf details as well.

    :)


  • Just thought I'd post the top process right now, which shows mySQL seems to be the culprit here (sort by memory):


    top - 13:41:14 up 115 days, 5:04, 1 user, load average: 0.06, 0.08, 0.08
    Tasks: 335 total, 1 running, 333 sleeping, 0 stopped, 1 zombie
    Cpu(s): 7.3% us, 1.3% sy, 0.0% ni, 90.9% id, 0.0% wa, 0.0% hi, 0.5% si
    Mem: 1002260k total, 980732k used, 21528k free, 12812k buffers
    Swap: 5116692k total, 377692k used, 4739000k free, 104504k cached
    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    24554 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:27.72 mysqld
    24555 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:01.97 mysqld
    24556 mysql 16 0 90924 20m 1256 S 0.0 2.1 1:05.18 mysqld
    24559 mysql 16 0 90924 20m 1256 S 0.0 2.1 3:35.96 mysqld
    24571 mysql 16 0 90924 20m 1256 S 0.0 2.1 3:41.56 mysqld
    24843 mysql 15 0 90924 20m 1256 S 0.0 2.1 3:35.13 mysqld
    26003 mysql 16 0 90924 20m 1256 S 0.0 2.1 3:23.98 mysqld
    14738 mysql 15 0 90924 20m 1256 S 0.0 2.1 1:40.95 mysqld
    21766 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:25.78 mysqld
    6757 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:06.28 mysqld
    6758 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:06.22 mysqld
    6759 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.79 mysqld
    6760 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:06.64 mysqld
    6761 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.19 mysqld
    6765 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:06.10 mysqld
    6766 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.73 mysqld
    6770 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.74 mysqld
    6774 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.56 mysqld
    6775 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:06.43 mysqld
    6777 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.69 mysqld
    6778 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:07.11 mysqld
    6779 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:06.00 mysqld
    6797 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.17 mysqld
    6798 mysql 15 0 90924 20m 1256 S 0.0 2.1 0:05.61 mysqld
    6799 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.81 mysqld
    6800 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.79 mysqld
    6801 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.14 mysqld
    6802 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.36 mysqld
    6803 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.68 mysqld
    6804 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:06.25 mysqld
    6806 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.10 mysqld
    6810 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.55 mysqld
    6813 mysql 17 0 90924 20m 1256 S 0.0 2.1 0:05.38 mysqld
    6817 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.69 mysqld
    6818 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.86 mysqld
    6819 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:04.95 mysqld
    6824 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.69 mysqld
    6826 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.63 mysqld
    6827 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.86 mysqld
    6831 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.28 mysqld
    6832 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.72 mysqld
    6833 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.89 mysqld
    6834 mysql 16 0 90924 20m 1256 S 1.3 2.1 0:05.77 mysqld
    6835 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.76 mysqld
    6838 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.98 mysqld
    6840 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:06.33 mysqld
    6841 mysql 15 0 90924 20m 1256 S 0.0 2.1 0:05.05 mysqld
    6843 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.60 mysqld
    6844 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.16 mysqld
    6859 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.58 mysqld
    6863 mysql 15 0 90924 20m 1256 S 0.0 2.1 0:05.70 mysqld
    6864 mysql 16 0 90924 20m 1256 S 0.3 2.1 0:06.82 mysqld
    6866 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.55 mysqld
    6867 mysql 16 0 90924 20m 1256 S 0.0 2.1 0:05.35 mysqld


  • Hi;
    Just an update, I've gone ahead and did the following:

    1) Modified the my.cnf file with the new settings
    2) Updated Apache to 1.3.34
    3) Updated PHP to 4.4.1
    4) Modified httpd.conf and lowered certain values:

    MinSpareServers 10
    MaxSpareServers 30
    StartServers 10
    MaxClients 400

    though based on the last few days, it's made no discernable difference. RAM usage is still close to 90% at various times, and I'm starting to get the sporadic "vBulletin error" emails a couple times a day. Can my.cnf be tightened some more in any way? I'm surprised the changes made no difference, considering my original my.cnf file was basically blank. :)

    p.s: I tried to think back at when the problem first began, and I'm pretty sure now it was right around the time I upgraded from VB 3.0x to VB 3.5x last month.

    Thanks,


  • can you repost the output for these 2 commands

    mysqladmin -u root -p variables

    mysqladmin -u root -p ext stat

    vB 3.5.x does on average use more memory due to the added features than vB 3.0.x so it could be you need more ram but let's see what the output from these 2 commands give us

    Sure thing:

    +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    Variable_name Value
    +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    back_log 50
    basedir /
    binlog_cache_size 32768
    bulk_insert_buffer_size 8388608
    character_set latin1
    character_sets latin1 big5 czech euc_kr gb2312 gbk latin1_de sjis tis620 ujis dec8 dos german1 hp8 koi8_ru latin2 swe7 usa7 cp1251 danish hebrew win1251 estonia hungarian koi8_ukr win1251ukr greek win1250 croat cp1257 latin5
    concurrent_insert ON
    connect_timeout 10
    convert_character_set
    datadir /var/lib/mysql/
    default_week_format 0
    delay_key_write ON
    delayed_insert_limit 100
    delayed_insert_timeout 300
    delayed_queue_size 1000
    flush OFF
    flush_time 0
    ft_boolean_syntax + -><()~*:""&
    ft_min_word_len 4
    ft_max_word_len 254
    ft_max_word_len_for_sort 20
    ft_stopword_file (built-in)
    have_bdb NO
    have_crypt YES
    have_innodb DISABLED
    have_isam YES
    have_raid NO
    have_symlink YES
    have_openssl NO
    have_query_cache YES
    init_file
    innodb_additional_mem_pool_size 1048576
    innodb_autoextend_increment 8
    innodb_buffer_pool_size 8388608
    innodb_data_file_path
    innodb_data_home_dir
    innodb_file_io_threads 4
    innodb_force_recovery 0
    innodb_thread_concurrency 8
    innodb_flush_log_at_trx_commit 1
    innodb_fast_shutdown ON
    innodb_flush_method
    innodb_lock_wait_timeout 50
    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_mirrored_log_groups 1
    innodb_max_dirty_pages_pct 90
    innodb_max_purge_lag 0
    innodb_table_locks ON
    interactive_timeout 28800
    join_buffer_size 1044480
    key_buffer_size 16777216
    language /usr/share/mysql/english/
    large_files_support ON
    license GPL
    local_infile ON
    locked_in_memory OFF
    log OFF
    log_update OFF
    log_bin OFF
    log_slave_updates OFF
    log_slow_queries 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 16776192
    max_binlog_cache_size 4294967295
    max_binlog_size 1073741824
    max_connections 500
    max_connect_errors 10
    max_delayed_threads 20
    max_insert_delayed_threads 20
    max_heap_table_size 16777216
    max_join_size 4294967295
    max_relay_log_size 0
    max_seeks_for_key 4294967295
    max_sort_length 1024
    max_user_connections 0
    max_tmp_tables 32
    max_write_lock_count 4294967295
    myisam_max_extra_sort_file_size 268435456
    myisam_max_sort_file_size 2147483647
    myisam_repair_threads 1
    myisam_recover_options OFF
    myisam_sort_buffer_size 67108864
    net_buffer_length 16384
    net_read_timeout 30
    net_retry_count 10
    net_write_timeout 60
    new OFF
    open_files_limit 2558
    pid_file /var/lib/mysql/siteurlremoved.com.pid
    log_error
    port 3306
    protocol_version 10
    query_alloc_block_size 8192
    query_cache_limit 1048576
    query_cache_size 33554432
    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
    rpl_recovery_rank 0
    server_id 0
    slave_net_timeout 3600
    skip_external_locking ON
    skip_networking OFF
    skip_show_database OFF
    slow_launch_time 2
    socket /var/lib/mysql/mysql.sock
    sort_buffer_size 2097144
    sql_mode 0
    table_cache 1024
    table_type MYISAM
    thread_cache_size 64
    thread_stack 126976
    tx_isolation REPEATABLE-READ
    timezone PST
    tmp_table_size 33554432
    tmpdir /tmp/
    transaction_alloc_block_size 8192
    transaction_prealloc_size 4096
    version 4.0.25-standard
    version_comment Official MySQL RPM
    version_compile_os pc-linux-gnu
    wait_timeout 180
    +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

    and:

    +--------------------------+-----------+
    Variable_name Value
    +--------------------------+-----------+
    Aborted_clients 373
    Aborted_connects 1728
    Bytes_received 967641065
    Bytes_sent 654973810
    Com_admin_commands 0
    Com_alter_table 108
    Com_analyze 0
    Com_backup_table 0
    Com_begin 12
    Com_change_db 342873
    Com_change_master 0
    Com_check 186
    Com_commit 12
    Com_create_db 8
    Com_create_function 0
    Com_create_index 148
    Com_create_table 84
    Com_delete 6259
    Com_delete_multi 0
    Com_drop_db 0
    Com_drop_function 0
    Com_drop_index 0
    Com_drop_table 0
    Com_flush 16
    Com_grant 80
    Com_ha_close 0
    Com_ha_open 0
    Com_ha_read 0
    Com_insert 132569
    Com_insert_select 182
    Com_kill 0
    Com_load 0
    Com_load_master_data 0
    Com_load_master_table 0
    Com_lock_tables 1690
    Com_optimize 186
    Com_purge 0
    Com_rename_table 0
    Com_repair 0
    Com_replace 10279
    Com_replace_select 0
    Com_reset 0
    Com_restore_table 0
    Com_revoke 8
    Com_rollback 0
    Com_savepoint 0
    Com_select 1055470
    Com_set_option 3484
    Com_show_binlog_events 0
    Com_show_binlogs 0
    Com_show_create 760
    Com_show_databases 46
    Com_show_fields 760
    Com_show_grants 0
    Com_show_keys 0
    Com_show_logs 0
    Com_show_master_status 0
    Com_show_new_master 0
    Com_show_open_tables 0
    Com_show_processlist 1617
    Com_show_slave_hosts 0
    Com_show_slave_status 0
    Com_show_status 1
    Com_show_innodb_status 0
    Com_show_tables 772
    Com_show_variables 53
    Com_slave_start 0
    Com_slave_stop 0
    Com_truncate 0
    Com_unlock_tables 1690
    Com_update 229152
    Com_update_multi 484
    Connections 349931
    Created_tmp_disk_tables 34
    Created_tmp_tables 7493
    Created_tmp_files 0
    Delayed_insert_threads 0
    Delayed_writes 0
    Delayed_errors 0
    Flush_commands 1
    Handler_commit 0
    Handler_delete 66245
    Handler_read_first 247780
    Handler_read_key 9715940
    Handler_read_next 10408915
    Handler_read_prev 204953
    Handler_read_rnd 4017593
    Handler_read_rnd_next 312068360
    Handler_rollback 0
    Handler_update 296468
    Handler_write 1409625
    Key_blocks_used 15586
    Key_read_requests 21109629
    Key_reads 26829
    Key_write_requests 129524
    Key_writes 109870
    Max_used_connections 110
    Not_flushed_key_blocks 0
    Not_flushed_delayed_rows 0
    Open_tables 170
    Open_files 248
    Open_streams 0
    Opened_tables 888
    Questions 3914446
    Qcache_queries_in_cache 2113
    Qcache_inserts 1054470
    Qcache_hits 1777436
    Qcache_lowmem_prunes 66
    Qcache_not_cached 1000
    Qcache_free_memory 24892696
    Qcache_free_blocks 439
    Qcache_total_blocks 4878
    Rpl_status NULL
    Select_full_join 485
    Select_full_range_join 0
    Select_range 102448
    Select_range_check 0
    Select_scan 332189
    Slave_open_temp_tables 0
    Slave_running OFF
    Slow_launch_threads 10
    Slow_queries 89
    Sort_merge_passes 0
    Sort_range 191562
    Sort_rows 4092021
    Sort_scan 17056
    Table_locks_immediate 2481721
    Table_locks_waited 351
    Threads_cached 62
    Threads_created 111
    Threads_connected 2
    Threads_running 1
    Uptime 483015
    +--------------------------+-----------+
    Uptime: 483015 Threads: 2 Questions: 3914447 Slow queries: 89 Opens: 888 Flush tables: 1 Open tables: 170 Queries per second avg: 8.104

    I should say the stats captured now is probably not a good reflection of the server, since swap usage at this hour tends to lower, and is currently 2%. It goes to up to 10% during the day.

    Regarding maxclients, I've set it to 400 as in the past, the default 150 or 200 has led to some max connections have been reached errors. But this setting really shouldn't be the culprit, as I've used 512 for many years now without problems.

    Thanks,


  • Just so you are aware, linux almost always is using 100% of its memory. This is not a bad thing. Its when linux starts to use swap.

    Unlike windows, linux first uses its real ram first, filling parts of it with buffers. Buffers are useful for server type programs. So instead of allocating memory on demand, it just uses some its already preped.

    Anyway, you need some major tuning.

    Upgrade in this order.
    Apache to 1.3.34 (if you are using cpanel, apache will update when php does).
    PHP to 4.4.1 or 5.1.1 (which ever your prefrence is)

    Edit your my.cnf and replace it with the following.

    [mysqld]
    max_connections = 500
    key_buffer = 16M
    myisam_sort_buffer_size = 64M
    join_buffer_size = 1M
    read_buffer_size = 1M
    sort_buffer_size = 2M
    table_cache = 1024
    thread_cache_size = 64
    wait_timeout = 180
    connect_timeout = 10
    max_allowed_packet = 16M
    max_connect_errors = 10
    query_cache_limit = 1M
    query_cache_size = 32M
    query_cache_type = 1
    skip-innodb

    [mysqld_safe]
    open_files_limit = 8192

    [mysqldump]
    quick
    max_allowed_packet = 16M

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


    And after you've recompiled apache/php change your httpd.conf to thisTimeout 300
    KeepAlive On
    MaxKeepAliveRequests 100
    KeepAliveTimeout 15
    MinSpareServers 5
    MaxSpareServers 10
    StartServers 5
    MaxClients 200
    MaxRequestsPerChild 10000Unless you have an explicit reason for it to be set like it is now


  • Ram usage isn't the issue here, its swap usage, and your swapusage is lower than before.

    Are you realisticly serving 400 reuqests per processor cycle? If you are you need more hardware, if not lower the values down to my recomended usages


  • why MaxClients 400 ? drop it back to 200 and restart apache

    as to 90% mem usage.. linux doesn't use memory like windows it will always be near 100% mem used on linux as free memory is allocated to buffers/caches to see real free memory usage type

    free -m

    in ssh telnet

    You problem is though swap usage

    can you repost the output for these 2 commands

    mysqladmin -u root -p variables

    mysqladmin -u root -p ext stat

    vB 3.5.x does on average use more memory due to the added features than vB 3.0.x so it could be you need more ram but let's see what the output from these 2 commands give us


  • Hehe ok edited above code to include httpd.conf.


  • also if memory usage is still how try to disable these 4 options:

    Admin CP -> vBulletin Options -> Server Settings and Optimization 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







  • #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 (low CPU, high memory) , Please add it free.