New Server - please help me optimize

Author: cfz  |  Category: enart.gzfn.com
  • Hi,

    I just got a new Server to handle just 1 VBB forum.

    1. Dedicated Server
    2.

    cpu speed/type single or dual cpus): dual xeon 2.4ghz
    how much memory installed: 2 GB ECC Registered DDR Ram
    hard drive 1 type/configuration: 36GB SCSI non raid
    hard drive 2 type/configuration: 36GB SCSI for dedicated MYSQL
    linux : redhat linux 9
    apache/IIS version: apache 1.3.29
    PHP version: php 4.3.3
    MySQL version: mysql 4.0.15 Stable

    3. No innodb type databases/tables
    4.
    5. Top Stat:
    02:53:32 up 9 days, 13:47, 1 user, load average: 1.20, 0.83, 0.68
    228 processes: 226 sleeping, 2 running, 0 zombie, 0 stopped
    CPU0 states: 39.0% user 5.0% system 0.0% nice 0.0% iowait 54.1% idle
    CPU1 states: 16.0% user 9.0% system 0.0% nice 0.0% iowait 74.0% idle
    CPU2 states: 28.0% user 33.0% system 0.0% nice 0.0% iowait 38.0% idle
    CPU3 states: 15.0% user 0.1% system 0.0% nice 0.0% iowait 84.0% idle
    Mem: 2068896k av, 1620192k used, 448704k free, 0k shrd, 131564k buff
    1057892k active, 391556k inactive
    Swap: 2040212k av, 9508k used, 2030704k free 1027168k cached

    6. /etc/my.cnf
    [mysqld]
    safe-show-database
    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 = 128
    wait_timeout = 1800
    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

    7.
    +--------------------------+------------+
    Variable_name Value
    +--------------------------+------------+
    Aborted_clients 416
    Aborted_connects 3876
    Bytes_received 289569510
    Bytes_sent 3393822045
    Com_admin_commands 2511
    Com_alter_table 212
    Com_analyze 0
    Com_backup_table 0
    Com_begin 0
    Com_change_db 5959
    Com_change_master 0
    Com_check 0
    Com_commit 0
    Com_create_db 6
    Com_create_function 0
    Com_create_index 1
    Com_create_table 112
    Com_delete 692
    Com_delete_multi 0
    Com_drop_db 3
    Com_drop_function 0
    Com_drop_index 0
    Com_drop_table 107
    Com_flush 138
    Com_grant 45
    Com_ha_close 0
    Com_ha_open 0
    Com_ha_read 0
    Com_insert 1607
    Com_insert_select 35
    Com_kill 0
    Com_load 0
    Com_load_master_data 0
    Com_load_master_table 0
    Com_lock_tables 106
    Com_optimize 0
    Com_purge 0
    Com_rename_table 0
    Com_repair 0
    Com_replace 165
    Com_replace_select 0
    Com_reset 0
    Com_restore_table 0
    Com_revoke 0
    Com_rollback 0
    Com_savepoint 0
    Com_select 44592
    Com_set_option 17
    Com_show_binlog_events 0
    Com_show_binlogs 0
    Com_show_create 17
    Com_show_databases 100
    Com_show_fields 17
    Com_show_grants 2
    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 26
    Com_show_slave_hosts 0
    Com_show_slave_status 0
    Com_show_status 1
    Com_show_innodb_status 0
    Com_show_tables 5
    Com_show_variables 16
    Com_slave_start 0
    Com_slave_stop 0
    Com_truncate 0
    Com_unlock_tables 106
    Com_update 6148
    Connections 6636
    Created_tmp_disk_tables 117
    Created_tmp_tables 3668
    Created_tmp_files 1
    Delayed_insert_threads 0
    Delayed_writes 0
    Delayed_errors 0
    Flush_commands 1
    Handler_commit 0
    Handler_delete 532
    Handler_read_first 5631
    Handler_read_key 1288603
    Handler_read_next 878683
    Handler_read_prev 476390
    Handler_read_rnd 448583
    Handler_read_rnd_next 151936612
    Handler_rollback 3
    Handler_update 6773
    Handler_write 2754864
    Key_blocks_used 7793
    Key_read_requests 5662979
    Key_reads 12693
    Key_write_requests 933682
    Key_writes 13853
    Max_used_connections 93
    Not_flushed_key_blocks 0
    Not_flushed_delayed_rows 0
    Open_tables 63
    Open_files 114
    Open_streams 0
    Opened_tables 1671
    Questions 63115
    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 447
    Select_full_range_join 573
    Select_range 14485
    Select_range_check 0
    Select_scan 12595
    Slave_open_temp_tables 0
    Slave_running OFF
    Slow_launch_threads 0
    Slow_queries 0
    Sort_merge_passes 0
    Sort_range 3796
    Sort_rows 458023
    Sort_scan 4793
    Table_locks_immediate 82835
    Table_locks_waited 209
    Threads_cached 0
    Threads_created 6635
    Threads_connected 10
    Threads_running 1
    Uptime 7230
    +--------------------------+------------+

    8. It runs with scripts from others shared host, but it's biggest forum.
    When I suspend that Vbulletin site, the load is down to normal, 1-2/4 averagely

    9. ~150 members and 300 guests

    10. http://www.yeuamnhac.com/php.php

    11. httpd.conf

    KeepAlive On
    MaxKeepAliveRequests 100
    KeepAliveTimeout 15
    MinSpareServers 20
    MaxSpareServers 40
    StartServers 20
    MaxClients 256

    12. vB 3 beta 4

    and http://yeuamnhac.com/mysqlinfo.php = mysqlinfo.php url link

    http://yeuamnhac.com/mmcache.php

    http://yeuamnhac.com/php.php


  • in your error_log at /usr/local/apache/logs/error_log are there any errors pertaining to system related stuff ? i.e. maxclients limit exceeded etc ?

    + All of errors are like:

    [Wed Dec 17 17:34:28 2003] [error] [client 213.189.83.103] (13)Permission denied: access to /chromoimages/hea$
    [Wed Dec 17 17:34:28 2003] [error] [client 213.189.83.103] File does not exist: /home/yancom/public_html/musi$
    [Wed Dec 17 17:34:32 2003] [error] [client 203.162.3.145] Invalid method in request
    [Wed Dec 17 17:34:59 2003] [error] [client 203.162.3.145] File does not exist: /home/yancom/public_html/music$
    [Wed Dec 17 17:34:59 2003] [error] [client 203.162.3.145] File does not exist: /home/yancom/public_html/music$
    [Wed Dec 17 17:36:20 2003] [error] [client 203.162.3.145] Invalid method in request
    [Wed Dec 17 17:36:25 2003] [error] [client 203.210.151.254] (13)Permission denied: access to /music/chromoima$
    [Wed Dec 17 17:36:25 2003] [error] [client 203.210.151.254] File does not exist: /home/yancom/public_html/403$
    [Wed Dec 17 17:36:25 2003] [error] [client 203.210.151.254] (13)Permission denied: access to /music/chromoima$
    [Wed Dec 17 17:36:25 2003] [error] [client 203.210.151.254] File does not exist: /home/yancom/public_html/403$


    They are all types of Permission Denied and File does not exist.



    + Do you have any of the vb cron updates running ? do you have thread and attachment views updated real time or scheduled/deferred ?

    I have removed most of Vb cron.

    I have thread views updated in real time

    No for attatchment views


    + do you have large attachments table ? what's your max attachment file size limit ?

    Max file size = 1048576

    The total attatchment size is ~700 mb
    They are stored in flat files not MySQL

    + is vB gzip in admin panel enabled if so what level of compression ? you set no more than 1

    Level of compression is ONE

    do you have any other scripts which use mysql and php ?

    No

    + is your forum hacked ? if so i'd try and remove the hacks and upgrade to vB 3 Gamma and upgrade PHP to 4.3.4

    Just add the Idforum (show picture for each boxes, all images are hosted on another dedicated server)

    + during the 6 - 12+ cpu loads, can you ssh telnet into your server and type

    mysqladmin -u root -p processlist > process.txt

    I have pm you that file

    I really appreciate your advice

    Thanks a lot


  • okay had alook at your processlist file you sent me... due to your forum activity being so high you seem to be getting mysql table locks of threadview, session updates and the 'show user' browsing forum feature so you might find it better to

    1. turn off 'show users' browsing forum feature
    2. change threadviews to vbcron scheduled instead of real time

    how many attachment files are in the database that occupy that 700mb ? (av file size i'm trying to see)


  • woah your cpu loads are kind of high for dual xeons

    your mmcache, query_cache in mysqlinfo.php all suggest your system is consuming alot of memory ar times

    your mysqlinfo.php right now shows


    Wed Dec 17 10:59:42 ICT 2003


    10:59:44 up 9 days, 21:53, 0 users, load average: 6.41, 12.24, 10.45
    271 processes: 262 sleeping, 9 running, 0 zombie, 0 stopped
    CPU0 states: 46.1% user 19.1% system 0.0% nice 0.0% iowait 33.1% idle
    CPU1 states: 75.0% user 15.1% system 0.0% nice 0.0% iowait 9.0% idle
    CPU2 states: 44.1% user 9.0% system 0.0% nice 0.0% iowait 46.0% idle
    CPU3 states: 72.2% user 18.1% system 0.0% nice 0.0% iowait 8.0% idle
    Mem: 2068896k av, 1516852k used, 552044k free, 0k shrd, 131080k buff
    905700k active, 437256k inactive
    Swap: 2040212k av, 9476k used, 2030736k free 785108k cached

    Http processes currently running = 81
    Mysql processes currently running = 4

    Netstat information summary
    1 FIN_WAIT1
    1 SYN_RECV
    2 FIN_WAIT2
    7 CLOSE_WAIT
    19 TIME_WAIT
    25 LISTEN
    45 ESTABLISHED


    +---------------------------+-----------------+
    Variable_name Value
    +---------------------------+-----------------+
    Aborted_clients 356
    Aborted_connects 3128
    Bytes_received 488375354
    Bytes_sent 4275038150
    Com_admin_commands 0
    Com_alter_table 2
    Com_analyze 0
    Com_backup_table 0
    Com_begin 0
    Com_change_db 1276185
    Com_change_master 0
    Com_check 0
    Com_commit 0
    Com_create_db 1
    Com_create_function 0
    Com_create_index 0
    Com_create_table 83
    Com_delete 91287
    Com_delete_multi 0
    Com_drop_db 0
    Com_drop_function 0
    Com_drop_index 0
    Com_drop_table 0
    Com_flush 34
    Com_grant 15
    Com_ha_close 0
    Com_ha_open 0
    Com_ha_read 0
    Com_insert 251101
    Com_insert_select 4964
    Com_kill 0
    Com_load 0
    Com_load_master_data 0
    Com_load_master_table 0
    Com_lock_tables 5905
    Com_optimize 4
    Com_purge 0
    Com_rename_table 0
    Com_repair 0
    Com_replace 27527
    Com_replace_select 0
    Com_reset 0
    Com_restore_table 0
    Com_revoke 0
    Com_rollback 0
    Com_savepoint 0
    Com_select 11335983
    Com_set_option 0
    Com_show_binlog_events 0
    Com_show_binlogs 0
    Com_show_create 0
    Com_show_databases 33
    Com_show_fields 0
    Com_show_grants 7
    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 2816
    Com_show_slave_hosts 0
    Com_show_slave_status 0
    Com_show_status 5
    Com_show_innodb_status 0
    Com_show_tables 14
    Com_show_variables 19
    Com_slave_start 0
    Com_slave_stop 0
    Com_truncate 0
    Com_unlock_tables 5905
    Com_update 2271289
    Connections 1282301
    Created_tmp_disk_tables 2947
    Created_tmp_tables 673215
    Created_tmp_files 0
    Delayed_insert_threads 0
    Delayed_writes 0
    Delayed_errors 0
    Flush_commands 1
    Handler_commit 0
    Handler_delete 259577
    Handler_read_first 1572643
    Handler_read_key 547709550
    Handler_read_next 215254386
    Handler_read_prev 14078344
    Handler_read_rnd 224207763
    Handler_read_rnd_next 216532974
    Handler_rollback 0
    Handler_update 3018107
    Handler_write 210873530
    Key_blocks_used 15586
    Key_read_requests 1449694381
    Key_reads 1145742
    Key_write_requests 1605629
    Key_writes 1495135
    Max_used_connections 250
    Not_flushed_key_blocks 0
    Not_flushed_delayed_rows 0
    Open_tables 1024 100% of table_cache in use
    Open_files 1174
    Open_streams 0
    Opened_tables 1489
    Questions 17875054
    Qcache_queries_in_cache 2697
    Qcache_inserts 6328566
    Qcache_hits 1322864
    Qcache_lowmem_prunes 59116
    Qcache_not_cached 5007417
    Qcache_free_memory 22618808
    Qcache_free_blocks 2035
    Qcache_total_blocks 7684
    Rpl_status NULL
    Select_full_join 7191
    Select_full_range_join 131068
    Select_range 4148606
    Select_range_check 0
    Select_scan 2226751
    Slave_open_temp_tables 0
    Slave_running OFF
    Slow_launch_threads 0
    Slow_queries 8116 (execution time > 10 secs)
    Sort_merge_passes 0
    Sort_range 1243196
    Sort_rows 228620774
    Sort_scan 676736
    Table_locks_immediate 20539243
    Table_locks_waited 2780331
    Threads_cached 120
    Threads_created 1054
    Threads_connected 21
    Threads_running 10
    Uptime 843963 9 days 18 hrs 26 mins 3 secs
    +---------------------------+-----------------+


    Key Reads/Key Read Requests = 0.000790 (Cache hit = 99.99921%)
    Key Writes/Key Write Requests = 0.931183
    Connections/second = 1.519 (/hour = 5469.770)
    KB received/second = 0.565 (/hour = 2034.383)
    KB sent/second = 2.485 (/hour = 8945.586)
    Temporary Tables Created/second = 0.798 (/hour = 2871.659)
    Opened Tables/second = 0.002 (/hour = 6.351)
    Slow Queries/second = 0.010 (/hour = 34.620)
    % of slow queries = 0.045%
    Queries/second = 21.180 (/hour = 76247.649)




    in your error_log at /usr/local/apache/logs/error_log are there any errors pertaining to system related stuff ? i.e. maxclients limit exceeded etc ?

    Do you have any of the vb cron updates running ? do you have thread and attachment views updated real time or scheduled/deferred ?

    do you have large attachments table ? what's your max attachment file size limit ?

    is vB gzip in admin panel enabled if so what level of compression ? you set no more than 1

    do you have any other scripts which use mysql and php ?

    is your forum hacked ? if so i'd try and remove the hacks and upgrade to vB 3 Gamma and upgrade PHP to 4.3.4

    during the 6 - 12+ cpu loads, can you ssh telnet into your server and type

    mysqladmin -u root -p processlist > process.txt

    zip up process.txt then private message me a copy of the process.zip file just want to see if your experience mysql table locking etc


  • Hi,

    That's what I cannot understand too :-!
    I have turned off the 'show users' browsing forum feature long time ago but there are still many of MySQL processes of that.

    Somehow when I use the cron feature, it did not update at all.

    Would you please have a look over it?

    I have pm you my admin info

    Thanks a lot


  • Hi,

    I notice that whenever the process "cpanellogd - sleeping for logs" is running the Server load pop up to >20 .

    Is there anyway to get rid of it? please help


  • I have followed your advice and upgraded the forum to 3.0 Gamma.

    However, the load is now even much higher than before.
    It's now up to 20 :-! and kinda slower than before too.

    Would you please have a look over it?
    I have pm you the admin info before, do you still have it?


  • ***************************Off-topic***************************

    Hey Nam,

    Just want to say it's great to see successful Vietnamese board out there. Keep up the good work. By the way, where are you from? I'm in Houston, TX. :)

    ************************************************** **************


  • I have followed your advice and upgraded the forum to 3.0 Gamma.

    However, the load is now even much higher than before.
    It's now up to 20 :-! and kinda slower than before too.

    Would you please have a look over it?
    I have pm you the admin info before, do you still have it?
    Sorry for the delay but right now i am having from problems of my own (server hardware died) :( ** cries **

    if you have ssh telnet root access, can you private message me that info too.. i i'll take alook as soon as i can


  • i'd upgrade to vB 3 Gamma first could be a bug in betas


  • I host most of images of that Vbulletin forum in another dedicated Server (Vbb images, smiles, banners...).

    The server is running fine when there are around 150-250 users (50% members). Load average of that time is ~ 2.

    However, at peak time (mostly on Saturday and Sunday) the load pops to 8-10. (~300-350 users).

    I really appreciate your help.

    Thanks in advance.







  • #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 New Server - please help me optimize , Please add it free.