 |
 |
 |
 |
#253470 - 02/19/04 05:59 PM
Re: What Need to be Tuned?
[Re: -Fusion-]
|
Lurker
Registered: 02/18/04
Posts: 4
|
I have a P4 2.4 with 1GB RAM dedicated server 100Mbps net connection <br /> <br />It runs WHM 8.8.0 cPanel 8.8.0-R73 RedHat 9 - WHM X v2.1.2 apache (1.3.29 (Unix)) mysql (4.0.15-standard) <br /> <br />This machine is entirely use for just 1 domain with a vBulletin board. The site has about somewhere from 200+ to 800+ users online concurrent depends on time of the day. <br /> <br />When the number of users about 300- (less than 300) the server seem to react normally (Not Slow) <br /> <br />However, when the number of users increase at night (7mp - 5am PST) the server react extreamly slow (I mean really really slow) and it sometimes refuse to dislay page and not to load images as well. <br /> <br />1. Is this because of MySQL not tuned or Apache not Turned? How do I go about finding what need to fix? <br /> <br />2. I have include the 2 results (when site not busy & busy) of the script Jeremy provide, with the numbers shown, How I optimize MySQL to be the most efficient for my site? <br /> <br />3. With the hardware I have how many users I could have on the site just to browse the vBulletin board? <br /> <br />Thank you in advance for helping. <br /> <br />========================== <br />Result when site not busy: <br /> <br />Thu Feb 19 16:55:03 PST 2004 <br /> <br /> 16:55:04 up 9:35, 0 users, load average: 1.20, 1.42, 1.24 <br />113 processes: 108 sleeping, 1 running, 4 zombie, 0 stopped <br />Mem: 1032320k av, 1003632k used, 28688k free, 0k shrd, 37436k buff <br /> 154672k active, 810984k inactive <br />Swap: 2104504k av, 936k used, 2103568k free 823300k cached <br /> <br /> PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND <br />17311 nobody 13 0 1088 1088 748 R 1.9 0.1 0:00 0 top <br /> <br />Http processes currently running = 36 <br />Mysql processes currently running = 3 <br /> <br />Key Reads/Key Read Requests = 0.000096 (Cache hit = 99.999904%) <br />Key Writes/Key Write Requests = 0.960247 <br />Connections/second = 2.483 (/hour = 8939.866) <br />KB received/second = 8.783 (/hour = 31619.251) <br />KB sent/second = 7.370 (/hour = 26531.916) <br />Temporary Tables Created/second = 0.417 (/hour = 1502.356) <br />Opened Tables/second = 0.003 (/hour = 10.014) <br />Slow Queries/second = 0.000 (/hour = 0.104) <br />% of slow queries = 0.000% <br />Queries/second = 59.012 (/hour = 212441.723) <br />MySQL Query Cache hits = 0/1685434(0%) <br /> <br />========================= <br />Result when site busy (I'll update tonight when the site get busy)
Edited by Tony (02/19/04 06:57 PM)
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#253471 - 02/20/04 04:43 AM
Re: What Need to be Tuned?
[Re: BlindFreddy]
|
Lurker
Registered: 02/18/04
Posts: 4
|
Continue for above, here is the result when site farely busy (450 users online)<br /><br />Fri Feb 20 02:40:07 PST 2004<br /><br /> 02:40:08 up 19:21, 1 user, load average: 4.69, 4.60, 3.96<br />165 processes: 130 sleeping, 9 running, 26 zombie, 0 stopped<br />Mem: 1032320k av, 1014388k used, 17932k free, 0k shrd, 126924k buff<br /> 326156k active, 645548k inactive<br />Swap: 2104504k av, 436k used, 2104068k free 659844k cached<br /><br /> PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND<br />21166 nobody 13 0 1124 1124 848 R 2.9 0.1 0:00 0 top<br /><br />Http processes currently running = 80<br />Mysql processes currently running = 3<br /><br />Netstat information summary<br /> 2 CLOSING <br /> 3 FIN_WAIT2 <br /> 6 FIN_WAIT1 <br /> 19 CLOSE_WAIT <br /> 32 LISTEN <br /> 71 SYN_RECV <br /> 150 ESTABLISHED <br /> 407 TIME_WAIT <br /><br />+--------------------------+-----------+<br />| Variable_name | Value |<br />+--------------------------+-----------+<br />| Aborted_clients | 152 |<br />| Aborted_connects | 23 |<br />| Bytes_received | 23027568 |<br />| Bytes_sent | 326226515 |<br />| Com_admin_commands | 0 |<br />| Com_alter_table | 0 |<br />| Com_analyze | 0 |<br />| Com_backup_table | 0 |<br />| Com_begin | 0 |<br />| Com_change_db | 5882 |<br />| Com_change_master | 0 |<br />| Com_check | 0 |<br />| Com_commit | 0 |<br />| Com_create_db | 0 |<br />| Com_create_function | 0 |<br />| Com_create_index | 0 |<br />| Com_create_table | 0 |<br />| Com_delete | 885 |<br />| Com_delete_multi | 0 |<br />| Com_drop_db | 0 |<br />| Com_drop_function | 0 |<br />| Com_drop_index | 0 |<br />| Com_drop_table | 0 |<br />| Com_flush | 0 |<br />| Com_grant | 0 |<br />| Com_ha_close | 0 |<br />| Com_ha_open | 0 |<br />| Com_ha_read | 0 |<br />| Com_insert | 1187 |<br />| Com_insert_select | 0 |<br />| Com_kill | 0 |<br />| Com_load | 0 |<br />| Com_load_master_data | 0 |<br />| Com_load_master_table | 0 |<br />| Com_lock_tables | 159 |<br />| Com_optimize | 0 |<br />| Com_purge | 0 |<br />| Com_rename_table | 0 |<br />| Com_repair | 0 |<br />| Com_replace | 1 |<br />| Com_replace_select | 0 |<br />| Com_reset | 0 |<br />| Com_restore_table | 0 |<br />| Com_revoke | 0 |<br />| Com_rollback | 0 |<br />| Com_savepoint | 0 |<br />| Com_select | 127412 |<br />| Com_set_option | 0 |<br />| Com_show_binlog_events | 0 |<br />| Com_show_binlogs | 0 |<br />| Com_show_create | 0 |<br />| Com_show_databases | 0 |<br />| Com_show_fields | 0 |<br />| Com_show_grants | 0 |<br />| Com_show_keys | 0 |<br />| Com_show_logs | 0 |<br />| Com_show_master_status | 0 |<br />| Com_show_new_master | 0 |<br />| Com_show_open_tables | 0 |<br />| Com_show_processlist | 4 |<br />| Com_show_slave_hosts | 0 |<br />| Com_show_slave_status | 0 |<br />| Com_show_status | 1 |<br />| Com_show_innodb_status | 0 |<br />| Com_show_tables | 0 |<br />| Com_show_variables | 1 |<br />| Com_slave_start | 0 |<br />| Com_slave_stop | 0 |<br />| Com_truncate | 0 |<br />| Com_unlock_tables | 159 |<br />| Com_update | 9539 |<br />| Connections | 5943 |<br />| Created_tmp_disk_tables | 662 |<br />| Created_tmp_tables | 1544 |<br />| Created_tmp_files | 0 |<br />| Delayed_insert_threads | 0 |<br />| Delayed_writes | 0 |<br />| Delayed_errors | 0 |<br />| Flush_commands | 1 |<br />| Handler_commit | 0 |<br />| Handler_delete | 52 |<br />| Handler_read_first | 6073 |<br />| Handler_read_key | 772807 |<br />| Handler_read_next | 1301166 |<br />| Handler_read_prev | 3106 |<br />| Handler_read_rnd | 1333630 |<br />| Handler_read_rnd_next | 91569972 |<br />| Handler_rollback | 0 |<br />| Handler_update | 8601 |<br />| Handler_write | 370103 |<br />| Key_blocks_used | 1465 |<br />| Key_read_requests | 4431052 |<br />| Key_reads | 1446 |<br />| Key_write_requests | 756 |<br />| Key_writes | 755 |<br />| Max_used_connections | 25 |<br />| Not_flushed_key_blocks | 0 |<br />| Not_flushed_delayed_rows | 0 |<br />| Open_tables | 67 | 7% of table_cache in use<br />| Open_files | 99 |<br />| Open_streams | 0 |<br />| Opened_tables | 73 |<br />| Questions | 151063 |<br />| Qcache_queries_in_cache | 0 |<br />| Qcache_inserts | 0 |<br />| Qcache_hits | 0 |<br />| Qcache_lowmem_prunes | 0 |<br />| Qcache_not_cached | 0 |<br />| Qcache_free_memory | 0 |<br />| Qcache_free_blocks | 0 |<br />| Qcache_total_blocks | 0 |<br />| Rpl_status | NULL |<br />| Select_full_join | 2 |<br />| Select_full_range_join | 2 |<br />| Select_range | 67929 |<br />| Select_range_check | 0 |<br />| Select_scan | 23125 |<br />| Slave_open_temp_tables | 0 |<br />| Slave_running | OFF |<br />| Slow_launch_threads | 0 |<br />| Slow_queries | 1 | (execution time > 10 secs)<br />| Sort_merge_passes | 0 |<br />| Sort_range | 8539 |<br />| Sort_rows | 1364197 |<br />| Sort_scan | 15137 |<br />| Table_locks_immediate | 144766 |<br />| Table_locks_waited | 217 |<br />| Threads_cached | 16 |<br />| Threads_created | 26 |<br />| Threads_connected | 10 |<br />| Threads_running | 1 |<br />| Uptime | 1435 | 23 mins 55 secs<br />+--------------------------+-----------+<br /><br /><br />Key Reads/Key Read Requests = 0.000326 (Cache hit = 99.999674%)<br />Key Writes/Key Write Requests = 0.998677<br />Connections/second = 4.141 (/hour = 14909.268)<br />KB received/second = 15.670 (/hour = 56413.380)<br />KB sent/second = 222.007 (/hour = 799225.087)<br />Temporary Tables Created/second = 1.076 (/hour = 3873.449)<br />Opened Tables/second = 0.051 (/hour = 183.136)<br />Slow Queries/second = 0.001 (/hour = 2.509)<br />% of slow queries = 0.001%<br />Queries/second = 105.270 (/hour = 378973.380)<br /><br /><br /><b>Warning</b>: Division by zero in <b>/home/.../public_html/showvars.php</b> on line <b>259</b><br /><br />MySQL Query Cache hits = 0/0(0%)<br /><br />====<br />Please help me anything seem odd in the result. My site is really really slow now. <img src="http://www.ubbdev.com/forum/images/graemlins/frown.gif" alt="" />
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#253473 - 02/20/04 07:00 PM
Re: What Need to be Tuned?
[Re: BrokenToy]
|
Addict
Registered: 02/18/02
Posts: 1969
Loc: Lansing, Michigan
|
I haven't had time to read a lot of of that, but I caught the zombie processes bit, and I agree, that is a problem. On one of my dedicated threads servers, I can have about 300 processes, server loads under 1, and 0 zombie processes.<br /><br />So IMO, you have way too many zombie processes for one. I don't know if that is ultimately your problem, but a properly setup server and/or software should not lead to that many zombie (defunct) processes.<br /><br />I'll try to take a look at all the numbers and stats you posted earlier.. but in the meantime, can you say what OS you are using, kernel version, etc?
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#253478 - 12/23/04 07:41 AM
Re: Let's tune MySQL!
[Re: palmen]
|
Member
Registered: 03/25/02
Posts: 207
|
Well, this is my first attempt at tuning MySQL so i thought I'd take the smart approach of asking a few questions before attempting to modify anything on my server... <br /> <br />1. My key 'reads : read requests' & 'write : write requests' ratios are fine at 0.000697 and 0.613655 respectively, so that's taken care of I guess. <br /> <br />2. In the next bit I'm not sure what my table_cache is, but judging by the open_tables stat as well as an almost blank "my.cnf" file I assume that it's 64. <br /> <br />open_tables - 64 <br />opened_tables - 4454 <br />uptime - 1504472 <br /> <br />Using Jeremy's script I also see info like "100% of table_cache in use" and "(Cache hit = 99.999303%)". <br /> <br />2. How can up up my cache to 128, and how will this affect my system memory (I've got 1GB RAM)? What do I need to add to the "my.cnf" file, which is very bare at the moment (just 3 lines!): <br /> <br />[mysqld] <br />set-variable = max_connections=500 <br />safe-show-database <br /> <br />3. Also, is there a procedure to follow when restarting MySQL? Or do I just switch the forums off and restart MySQL in WHM? <br /> <br />4. Jeremy also mentions "key_buffer_size". Where can I find out what it's set to? If the "my.cnf" file is just the three lines listed above, then does that mean that I have no key_buffer_size? <br /> <br />5. Last but not least, how do I protect the script from getting into the wrong hands (after all, I don't want to make my db login+password public...)? Placing it above the web root probably makes no sense, so am I doing the right thing by creating a new folder for this file and then setting a password on the folder via CPanel? Is that secure enough?
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#253479 - 01/11/05 09:17 AM
Re: Let's tune MySQL!
[Re: CHOELIN]
|
Member
Registered: 03/25/02
Posts: 207
|
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#315832 - 09/25/07 01:35 PM
Re: Let's tune MySQL!
[Re: msula]
|
Lurker
Registered: 06/26/04
Posts: 6
|
Yikes! Anyone care to help figure this out? What's up with my LAST_ACK connections?
Web Server: Xserve G5/Dual 2.0Ghz/4GB RAM/3x80GB RAID 5/10.4.10 DB Server: Dell PowerEdge 2850/Dual 3.0Ghz/4GB RAM/3x74 RAID 5/CentOS 4.5
This is from the web server:
Processes: 205 total, 5 running, 200 sleeping... 377 threads 13:34:25 Load Avg: 3.45, 3.67, 3.27 CPU usage: 44.2% user, 48.4% sys, 7.4% idle SharedLibs: num = 164, resident = 33.1M code, 4.05M data, 19.3M LinkEdit MemRegions: num = 43255, resident = 497M + 21.6M private, 90.9M shared PhysMem: 309M wired, 514M active, 3.02G inactive, 3.83G used, 174M free VM: 14.8G + 106M 631810(0) pageins, 1276(0) pageouts
Http processes currently running = 102 Mysql processes currently running = 3
Netstat information summary 1 CLOSING 5 SYN_RCVD 7 CLOSED 15 FIN_WAIT_1 26 LISTEN 207 ESTABLISHED 253 CLOSE_WAIT 458 LAST_ACK
|
|
Top
|
|
|
|
 |
 |
 |
 |
|
|