View Full Version : Server Config/Tweaking... High CPU Load
HossMon
Sun 17th Nov '02, 8:34pm
Baord is running well, but seems to me the CPU Load has been high while the RAM being used is quite low.
We're avg'ing 100 users and Max so far of 250
CPU Reached near 14 today while RAM was in low 30% of use
vB 2.2.8
Duron 1Ghz w/ 1Ghz DDR RAM w/ WHM & Cpanel
Redhat v7.3
Apache 1.3.2.7
PHP 4.2.3
MySQL 3.23.53a Compiled/installed by Host: Nocster
_______________
my.cnf
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
set-variable = max_connections=350
set-variable = key_buffer=16M
set-variable = myisam_sort_buffer_size=64M
set-variable = join_buffer=3M
set-variable = record_buffer=3M
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
[mysqldump]
quick
set-variable = max_allowed_packet=128M
______________________________
httpd.conf
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
MaxRequestsPerChild 0
___________________________________
Top Stats via WHM (from a heavy load day)
CPU/Memory Usage/MySQL Processes
Main forums %CPU 40.56 %MEM 27.59 MySql Processes 0.0
Top Process %CPU 22.2 httpd [/forums/showthread.php?s&threadid213]
Top Process %CPU 20.0 httpd [/forums/forumdisplay.php?s&forumid4&daysprune2&sortorder]
Top Process %CPU 16.1 httpd [/forums/showthread.php?s&postid13408#post13408]
mailman %CPU 2.86 %MEM 0.20 MySql 0.0
Top Process %CPU 19.0 /usr/bin/python -S /usr/local/cpanel/3rdparty/mailman/cron/qrunner
Top Process %CPU 18.0 /usr/bin/python -S /usr/local/cpanel/3rdparty/mailman/cron/qrunner
mysql %CPU 2.85 %MEM 58.97 MySQL Processes 0.0
Top Process %CPU 0.2 /usr/sbin/mysqld --basedir/ --datadir/var/lib/mysql --usermysql --pid-file/var/lib/mysql/ben.bst-secure.com.pid --skip-locking
root %CPU 0.14 %MEM 1.94 MySQL 5.9
Top Process %CPU 1.0 /bin/sh -c /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1
Top Process %CPU 0.5 CROND
nobody 0.01 0.22 0.0
Top Process %CPU 22.2 /usr/local/apache/bin/httpd -DSSL
Top Process %CPU 20.0 /usr/local/apache/bin/httpd -DSSL
Top Process %CPU 16.1 /usr/local/apache/bin/httpd -DSSL
My Telnet app is giving me problems (expired trial) so if you need the MySQL extended-status figures I'll have to give them to you later
Thanks in Advance Eva :D
- Hoss
HossMon
Sun 17th Nov '02, 8:39pm
Oh one more thing I do have Gzip installed and working. Would it be worth my time to install PHP Accelerator as well? Opinions on this please..
eva2000
Sun 17th Nov '02, 8:53pm
you can use freeware ssh client called putty http://www.chiark.greenend.org.uk/~sgtatham/putty/ :)
php accelerator is definitely worth installing it can cut you load by up to 50+ % :)
for mysql extended status output best to upload to /admin/mysqlinfo.php your mysqlinfo.php page from your vB extra's folder
HossMon
Sun 17th Nov '02, 9:09pm
That was fast :)
Ok I'll look into that, thanks Eva
How's my.cnf look to you for this setup so far?
eva2000
Mon 18th Nov '02, 11:39am
Originally posted by HossMon
That was fast :)
Ok I'll look into that, thanks Eva
How's my.cnf look to you for this setup so far? initial thoughts are the buffers are too high, but it's hard to conclude that without the mysqlinfo.php page url... generally you would have enough memory though with 1GB DDR ram :)
HossMon
Mon 18th Nov '02, 3:54pm
Here ya go, soz for the delay got a little busy last nite and plum forgot about it
http://www.bst-secure.com/forums/admin/mysqlinfo.php
Just took this one with 244 users currently logged in
2:56pm up 10 days, 2:29, 0 users, load average: 6.20, 5.60, 4.73
73 processes: 71 sleeping, 2 running, 0 zombie, 0 stopped
Mem: 900764K av, 806128K used, 94636K free, 0K shrd, 144048K buff
Swap: 1048784K av, 5276K used, 1043508K free 367288K cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
24521 nobody 12 0 6540 6216 4000 R 27.8 0.6 0:01 httpd
24059 nobody 12 0 1024 1024 816 R 2.8 0.1 0:00 top
Http processes currently running = 72
Mysql processes currently running = 2
Netstat information summary
+---------------------------+-----------------+
| Variable_name | Value |
+---------------------------+-----------------+
| Aborted_clients | 0 |
| Aborted_connects | 1 |
| Bytes_received | 1846428772 |
| Bytes_sent | 1750325733 |
| Com_admin_commands | 0 |
| Com_alter_table | 2 |
| Com_analyze | 0 |
| Com_backup_table | 0 |
| Com_begin | 0 |
| Com_change_db | 460812 |
| Com_change_master | 0 |
| Com_check | 39 |
| Com_commit | 0 |
| Com_create_db | 0 |
| Com_create_function | 0 |
| Com_create_index | 0 |
| Com_create_table | 2 |
| Com_delete | 63561 |
| Com_drop_db | 0 |
| Com_drop_function | 0 |
| Com_drop_index | 0 |
| Com_drop_table | 2 |
| Com_flush | 8 |
| Com_grant | 0 |
| Com_insert | 98296 |
| Com_insert_select | 5832 |
| Com_kill | 0 |
| Com_load | 0 |
| Com_load_master_table | 0 |
| Com_lock_tables | 0 |
| Com_optimize | 38 |
| Com_purge | 0 |
| Com_rename_table | 0 |
| Com_repair | 0 |
| Com_replace | 15516 |
| Com_replace_select | 1073 |
| Com_reset | 0 |
| Com_restore_table | 0 |
| Com_revoke | 0 |
| Com_rollback | 0 |
| Com_select | 8555667 |
| Com_set_option | 0 |
| Com_show_binlogs | 0 |
| Com_show_create | 0 |
| Com_show_databases | 34 |
| Com_show_fields | 513 |
| Com_show_grants | 2 |
| Com_show_keys | 512 |
| Com_show_logs | 0 |
| Com_show_master_status | 0 |
| Com_show_open_tables | 0 |
| Com_show_processlist | 2913 |
| Com_show_slave_status | 0 |
| Com_show_status | 2 |
| Com_show_innodb_status | 0 |
| Com_show_tables | 58 |
| Com_show_variables | 39 |
| Com_slave_start | 0 |
| Com_slave_stop | 0 |
| Com_truncate | 0 |
| Com_unlock_tables | 0 |
| Com_update | 1130827 |
| Connections | 463770 |
| Created_tmp_disk_tables | 33 |
| Created_tmp_tables | 404223 |
| Created_tmp_files | 0 |
| Delayed_insert_threads | 0 |
| Delayed_writes | 0 |
| Delayed_errors | 0 |
| Flush_commands | 1 |
| Handler_delete | 225108 |
| Handler_read_first | 354907 |
| Handler_read_key | 82189254 |
| Handler_read_next | 201192219 |
| Handler_read_prev | 0 |
| Handler_read_rnd | 79990548 |
| Handler_read_rnd_next | 146104737 |
| Handler_update | 1278330 |
| Handler_write | 10933212 |
| Key_blocks_used | 13641 |
| Key_read_requests | 355816670 |
| Key_reads | 8052 |
| Key_write_requests | 1159381 |
| Key_writes | 926168 |
| Max_used_connections | 38 |
| Not_flushed_key_blocks | 0 |
| Not_flushed_delayed_rows | 0 |
| Open_tables | 118 | 12% of table_cache in use
| Open_files | 194 |
| Open_streams | 0 |
| Opened_tables | 234 |
| Questions | 10799517 |
| Select_full_join | 0 |
| Select_full_range_join | 4 |
| Select_range | 2178002 |
| Select_range_check | 0 |
| Select_scan | 1413646 |
| Slave_running | OFF |
| Slave_open_temp_tables | 0 |
| Slow_launch_threads | 1 |
| Slow_queries | 0 | (execution time > 10 secs)
| Sort_merge_passes | 0 |
| Sort_range | 1778028 |
| Sort_rows | 84371176 |
| Sort_scan | 1074301 |
| Table_locks_immediate | 11979056 |
| Table_locks_waited | 495 |
| Threads_cached | 37 |
| Threads_created | 39 |
| Threads_connected | 2 |
| Threads_running | 1 |
| Uptime | 872910 | 10 days 2 hrs 28 mins 30 secs
+---------------------------+-----------------+
Key Reads/Key Read Requests = 0.000023 (Cache hit = 99.999977%)
Key Writes/Key Write Requests = 0.798847
Connections/second = 0.531 (/hour = 1912.651)
KB received/second = 2.066 (/hour = 7436.449)
KB sent/second = 1.958 (/hour = 7049.395)
Temporary Tables Created/second = 0.463 (/hour = 1667.071)
Opened Tables/second = 0.000 (/hour = 0.965)
Slow Queries/second = 0.000 (/hour = 0.000)
% of slow queries = 0.000%
Queries/second = 12.372 (/hour = 44538.682)
HossMon
Mon 18th Nov '02, 6:44pm
... update m8, just got this as server laods
22.54, 15.08, 11.23 291 users online (278 members & 13 guests)
And using 48.6% of total Server RAM at same time
27.6% for the boards domain
Agin the board/server is handling it but need to get those down if I can.
eva2000
Mon 18th Nov '02, 11:08pm
my gut feeling is duron is not able to handle the load that well since durons aren't really meant for web serving at all..
your mysqlinfo looks fine and your mysql usage and memory consumption looks normal too... only thing i'd check is
that you only have 1 of the following enabled
1. vB admin gzip
or
2. mod_gzip
and finally with whm/cpanel latest builds you can disable java chat, interchange and analog stats services as well... i only use webalizer stats myself
looks like your cpu is getting overloaded during peak times...
HossMon
Tue 19th Nov '02, 1:37am
Ok thanks for your time Eva, I do have mod_gzip running and we're looking at reducing the quieries for some of our pages... showthread.php and forumdisplay.php
I'm hoping to move the db off to another server in the future and guess I should have spent a little more dough and gone with the Athlon.. oh well
THe board is actually running okay but that's a littler higher then I'd like to see the load
I may speak with here in the future about installing PHP Accelerator if I need to as it's over my head and my webmaster isn't sure he wants to tackle it either.
- Hoss
jphilipson
Tue 19th Nov '02, 3:38am
Yes, I have worked on a few peoples servers that were using Durons.... very poor choice for a webserver, especcially if it is under heavy php/perl/mysql usage.
eva2000
Tue 19th Nov '02, 6:47am
Originally posted by HossMon
Ok thanks for your time Eva, I do have mod_gzip running and we're looking at reducing the quieries for some of our pages... showthread.php and forumdisplay.php
I'm hoping to move the db off to another server in the future and guess I should have spent a little more dough and gone with the Athlon.. oh well
THe board is actually running okay but that's a littler higher then I'd like to see the load
I may speak with here in the future about installing PHP Accelerator if I need to as it's over my head and my webmaster isn't sure he wants to tackle it either.
- Hoss if you have mod_Gzip installed disabled vB admin's gzip as you won't need it
HossMon
Tue 19th Nov '02, 3:37pm
Allright one more question...
A friend who is a webby as suggested adding this to my.cnf under
[myisamchk]
skip-name-resolve
I'm not sure what this does however and haven't been able to ask him yet. Does this disable resolve for IP's??? If not what? And is it a good idea?
I also on his advice increased these two settings
set-variable = key_buffer=16M ...to 32M
set-variable = thread_cache_size=256 ...to 512
And it has seemed to help so far along with the skip-name-resolve these are the only changes I've made currently
oh btw when I copied the my.cnf above for some reason I did not copy the [myisamchk] section so here it is below
[myisamchk]
set-variable = key_buffer=128M
set-variable = sort_buffer=128M
set-variable = read_buffer=16M
set-variable = write_buffer=16M
skip-name-resolve
eva2000
Wed 20th Nov '02, 7:25am
Originally posted by HossMon
Allright one more question...
A friend who is a webby as suggested adding this to my.cnf under
[myisamchk]
skip-name-resolve
I'm not sure what this does however and haven't been able to ask him yet. Does this disable resolve for IP's??? If not what? And is it a good idea?
I also on his advice increased these two settings
set-variable = key_buffer=16M ...to 32M
set-variable = thread_cache_size=256 ...to 512
And it has seemed to help so far along with the skip-name-resolve these are the only changes I've made currently
oh btw when I copied the my.cnf above for some reason I did not copy the [myisamchk] section so here it is below
[myisamchk]
set-variable = key_buffer=128M
set-variable = sort_buffer=128M
set-variable = read_buffer=16M
set-variable = write_buffer=16M
skip-name-resolve forget about adding skip-name-resolve explained at http://www.mysql.com/doc/en/DNS.html
you could increase the key_buffer to 32M... if you want.. but it won't help with the fact that duron cpu is not able to handle the load.. nothing to do with mysql i'm afraid :(
HossMon
Mon 16th Dec '02, 5:54pm
Hi Eva me again :)
I've taken advantage of a very nice X-mas sale to upgrade my server to the following...
P4 2 GHz w/1 GB RAM and 36 GB SCSI Drive all other things remain the same.
I may or may not keep the Duron for a MySQL server that will depend. But question is should I change any My.cnf settings for this new server?
I think I might remove the -skip-name-resolve if that seems advisable?
Hoss
vBulletin® v3.8.0 Release Candidate 1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.