PDA

View Full Version : Server Optimized help please


Mickie D
Fri 12th Mar '04, 9:53pm
Hellos first of i have just moved to a dedicated server and had to learn for myself howto install everything :) but i think i may need your help to look if i have set it up ok.

1)

Dedicated Server


2)

SPECS:

CPU = celeron 2.4Ghz
RAM = 1gb
HD = 80GB 7200 IDE
REDHAT ENTERPRISE 3
APACHE 1.3.29
MYSQL 4.0.18
PHP 4.3.4

3)

i dont know what an innodb type databases/tables means ?

sorry

4)

i installed mysql from a RPM

5)

top stats


01:38:02 up 1:17, 1 user, load average: 0.00, 0.03, 0.04
115 processes: 112 sleeping, 2 running, 1 zombie, 0 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 0.3% 0.0% 0.0% 0.0% 0.0% 0.0% 99.6%
Mem: 1022476k av, 305336k used, 717140k free, 0k shrd, 19308k buff
136440k active, 123212k inactive
Swap: 1052248k av, 0k used, 1052248k free 197872k cached

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
7045 root 15 0 1188 1188 900 R 0.1 0.1 0:02 0 top
7341 nobody 15 0 0 0 0 Z 0.1 0.0 0:00 0 httpd <defunct>
1 root 15 0 500 500 440 S 0.0 0.0 0:03 0 init
2 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 keventd
3 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kapmd
4 root 34 19 0 0 0 SWN 0.0 0.0 0:00 0 ksoftirqd/0
7 root 25 0 0 0 0 SW 0.0 0.0 0:00 0 bdflush
5 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kswapd
6 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kscand
8 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kupdated
9 root 25 0 0 0 0 SW 0.0 0.0 0:00 0 mdrecoveryd
13 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kjournald
76 root 25 0 0 0 0 SW 0.0 0.0 0:00 0 khubd
555 root 23 0 0 0 0 SW 0.0 0.0 0:00 0 kjournald
3012 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 eth0



6)

MYSQL my.cnf


[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 = 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


please also note i copied your config from another optimization you done because my.cnf b4 this had just 2 lines in

7)

MYSQL Extended Status



+--------------------------+----------+
| Variable_name | Value |
+--------------------------+----------+
| Aborted_clients | 0 |
| Aborted_connects | 2 |
| Bytes_received | 767446 |
| Bytes_sent | 71837721 |
| Com_admin_commands | 0 |
| Com_alter_table | 0 |
| Com_analyze | 0 |
| Com_backup_table | 0 |
| Com_begin | 0 |
| Com_change_db | 234 |
| Com_change_master | 0 |
| Com_check | 0 |
| Com_commit | 0 |
| Com_create_db | 0 |
| Com_create_function | 0 |
| Com_create_index | 0 |
| Com_create_table | 0 |
| Com_delete | 12 |
| Com_delete_multi | 0 |
| Com_drop_db | 0 |
| Com_drop_function | 0 |
| Com_drop_index | 0 |
| Com_drop_table | 0 |
| Com_flush | 1 |
| Com_grant | 0 |
| Com_ha_close | 0 |
| Com_ha_open | 0 |
| Com_ha_read | 0 |
| Com_insert | 85 |
| Com_insert_select | 0 |
| Com_kill | 0 |
| Com_load | 0 |
| Com_load_master_data | 0 |
| Com_load_master_table | 0 |
| Com_lock_tables | 0 |
| Com_optimize | 0 |
| Com_purge | 0 |
| Com_rename_table | 0 |
| Com_repair | 0 |
| Com_replace | 13 |
| Com_replace_select | 0 |
| Com_reset | 0 |
| Com_restore_table | 0 |
| Com_revoke | 0 |
| Com_rollback | 0 |
| Com_savepoint | 0 |
| Com_select | 1023 |
| Com_set_option | 0 |
| Com_show_binlog_events | 0 |
| Com_show_binlogs | 0 |
| Com_show_create | 0 |
| Com_show_databases | 1 |
| Com_show_fields | 5 |
| 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 | 0 |
| Com_show_slave_hosts | 0 |
| Com_show_slave_status | 0 |
| Com_show_status | 2 |
| Com_show_innodb_status | 0 |
| Com_show_tables | 0 |
| Com_show_variables | 0 |
| Com_slave_start | 0 |
| Com_slave_stop | 0 |
| Com_truncate | 0 |
| Com_unlock_tables | 0 |
| Com_update | 313 |
| Connections | 179 |
| Created_tmp_disk_tables | 11 |
| Created_tmp_tables | 117 |
| Created_tmp_files | 0 |
| Delayed_insert_threads | 0 |
| Delayed_writes | 0 |
| Delayed_errors | 0 |
| Flush_commands | 1 |
| Handler_commit | 0 |
| Handler_delete | 49 |
| Handler_read_first | 170 |
| Handler_read_key | 56219 |
| Handler_read_next | 86401 |
| Handler_read_prev | 320 |
| Handler_read_rnd | 44665 |
| Handler_read_rnd_next | 525215 |
| Handler_rollback | 0 |
| Handler_update | 13082 |
| Handler_write | 17142 |
| Key_blocks_used | 1364 |
| Key_read_requests | 114162 |
| Key_reads | 1313 |
| Key_write_requests | 3598 |
| Key_writes | 134 |
| Max_used_connections | 1 |
| Not_flushed_key_blocks | 0 |
| Not_flushed_delayed_rows | 0 |
| Open_tables | 69 |
| Open_files | 135 |
| Open_streams | 0 |
| Opened_tables | 80 |
| Questions | 2813 |
| Qcache_queries_in_cache | 184 |
| Qcache_inserts | 1020 |
| Qcache_hits | 950 |
| Qcache_lowmem_prunes | 0 |
| Qcache_not_cached | 3 |
| Qcache_free_memory | 30846840 |
| Qcache_free_blocks | 55 |
| Qcache_total_blocks | 508 |
| Rpl_status | NULL |
| Select_full_join | 10 |
| Select_full_range_join | 6 |
| Select_range | 227 |
| Select_range_check | 0 |
| Select_scan | 242 |
| Slave_open_temp_tables | 0 |
| Slave_running | OFF |
| Slow_launch_threads | 0 |
| Slow_queries | 0 |
| Sort_merge_passes | 0 |
| Sort_range | 133 |
| Sort_rows | 110603 |
| Sort_scan | 149 |
| Table_locks_immediate | 2904 |
| Table_locks_waited | 1 |
| Threads_cached | 1 |
| Threads_created | 2 |
| Threads_connected | 1 |
| Threads_running | 1 |
| Uptime | 1391 |
+--------------------------+----------+




8)

yes vbulletin is the only thing on my server
well except qmail vpopmail

9)

users min is 12 max is 100 at different times of the day

10)

http://www.world-of-digital.com/info.php

11)

KeepAlive On
MaxKeepAliveRequests 115
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150

12)

VB VERSION = VB3 RC4


thank you very much for taking the time to look at my server and tell me what can be done and hopefully help me out :(, the basic reason for conacting you is i had a problem and members could not get on my server for 2 hours because of server laod... i dont even know waht logs to check to see the server load so best i thought i ask you experts

Regards
Mickie

eva2000
Tue 16th Mar '04, 4:38am
yup looks fine to me the my.cnf and httpd.conf settings are fine and your top stats show alot of room to grow

Mickie D
Tue 16th Mar '04, 7:48am
thanks very much i am pretty pleased considering my first ever go at building a redhat box :)

but one small thing i use servermatix they say they are budget (and the pricess are fantastic) but i dont think they are budget at all and really its never gone over 1 server load apart from the time when i was re-doing the search from vbulletin admincp.

but i find after the server has been on for maybe 10 days plus sometimes it gets a little slugish ? is that normal .... but once i do a apache re-start its back to super fast behaviour ?

thanks for your time and help i appreciate it

Regards
Mickie D

eva2000
Tue 16th Mar '04, 10:11am
at the 10 day mark or whenever it's sluggish repost the top stats, and mysqlinfo.php output here

Mickie D
Wed 17th Mar '04, 10:39am
at the 10 day mark or whenever it's sluggish repost the top stats, and mysqlinfo.php output here

ok thanks eva2000 you are a star ;)

Mickie D
Thu 18th Mar '04, 10:12am
at the 10 day mark or whenever it's sluggish repost the top stats, and mysqlinfo.php output here

as per your request:

TOP STATS:



14:13:27 up 5 days, 13:50, 1 user, load average: 2.17, 1.67, 1.55
150 processes: 146 sleeping, 4 running, 0 zombie, 0 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 2.7% 0.0% 5.9% 0.3% 0.1% 6.3% 84.2%
Mem: 1022476k av, 1013836k used, 8640k free, 0k shrd, 100808k buff
706920k actv, 540k in_d, 22164k in_c
Swap: 1052248k av, 34872k used, 1017376k free 640392k cached

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
4849 qmails 15 0 4908 4764 196 S 2.3 0.4 36:52 0 qmail-send
19978 nobody 15 0 14848 13M 9252 S 1.9 1.3 1:37 0 httpd
17853 mysql 16 0 53276 51M 1324 S 0.7 5.1 7:17 0 mysqld
13 root 15 0 0 0 0 SW 0.5 0.0 10:01 0 kjournald
5029 root 15 0 1348 1348 900 R 0.3 0.1 0:22 0 top
8578 vpopmail 15 0 640 640 536 R 0.1 0.0 0:00 0 qmail-smtpd
8777 qmailq 15 0 284 284 236 S 0.1 0.0 0:00 0 qmail-queue
8787 qmailq 20 0 280 280 236 S 0.1 0.0 0:00 0 qmail-queue
1 root 15 0 500 464 440 S 0.0 0.0 0:04 0 init
2 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 keventd
3 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kapmd
4 root 34 19 0 0 0 SWN 0.0 0.0 0:00 0 ksoftirqd/0
7 root 25 0 0 0 0 SW 0.0 0.0 0:00 0 bdflush
5 root 15 0 0 0 0 SW 0.0 0.0 0:16 0 kswapd
6 root 15 0 0 0 0 SW 0.0 0.0 0:10 0 kscand







AND BELOW IS THE MYSQL BIT YOU WANTED:



+--------------------------+------------+
| Variable_name | Value |
+--------------------------+------------+
| Aborted_clients | 4 |
| Aborted_connects | 69 |
| Bytes_received | 490042709 |
| Bytes_sent | 3075897446 |
| Com_admin_commands | 0 |
| Com_alter_table | 1 |
| Com_analyze | 0 |
| Com_backup_table | 0 |
| Com_begin | 0 |
| Com_change_db | 104102 |
| Com_change_master | 0 |
| Com_check | 511 |
| Com_commit | 0 |
| Com_create_db | 0 |
| Com_create_function | 0 |
| Com_create_index | 0 |
| Com_create_table | 7 |
| Com_delete | 10882 |
| Com_delete_multi | 0 |
| Com_drop_db | 0 |
| Com_drop_function | 0 |
| Com_drop_index | 0 |
| Com_drop_table | 2 |
| Com_flush | 1 |
| Com_grant | 0 |
| Com_ha_close | 0 |
| Com_ha_open | 0 |
| Com_ha_read | 0 |
| Com_insert | 37243 |
| Com_insert_select | 731 |
| Com_kill | 0 |
| Com_load | 0 |
| Com_load_master_data | 0 |
| Com_load_master_table | 0 |
| Com_lock_tables | 0 |
| Com_optimize | 349 |
| Com_purge | 0 |
| Com_rename_table | 0 |
| Com_repair | 1 |
| Com_replace | 11922 |
| Com_replace_select | 0 |
| Com_reset | 0 |
| Com_restore_table | 0 |
| Com_revoke | 0 |
| Com_rollback | 0 |
| Com_savepoint | 0 |
| Com_select | 725428 |
| Com_set_option | 979 |
| Com_show_binlog_events | 0 |
| Com_show_binlogs | 0 |
| Com_show_create | 979 |
| Com_show_databases | 6 |
| Com_show_fields | 984 |
| 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 | 0 |
| Com_show_slave_hosts | 0 |
| Com_show_slave_status | 0 |
| Com_show_status | 8 |
| Com_show_innodb_status | 0 |
| Com_show_tables | 1051 |
| Com_show_variables | 24 |
| Com_slave_start | 0 |
| Com_slave_stop | 0 |
| Com_truncate | 0 |
| Com_unlock_tables | 0 |
| Com_update | 261112 |
| Connections | 80228 |
| Created_tmp_disk_tables | 4589 |
| Created_tmp_tables | 64693 |
| Created_tmp_files | 1 |
| Delayed_insert_threads | 0 |
| Delayed_writes | 0 |
| Delayed_errors | 0 |
| Flush_commands | 1 |
| Handler_commit | 0 |
| Handler_delete | 21600 |
| Handler_read_first | 73993 |
| Handler_read_key | 26857349 |
| Handler_read_next | 68729487 |
| Handler_read_prev | 187162 |
| Handler_read_rnd | 24904771 |
| Handler_read_rnd_next | 215917148 |
| Handler_rollback | 0 |
| Handler_update | 5331033 |
| Handler_write | 7166236 |
| Key_blocks_used | 15586 |
| Key_read_requests | 63792158 |
| Key_reads | 225729 |
| Key_write_requests | 1384526 |
| Key_writes | 147700 |
| Max_used_connections | 7 |
| Not_flushed_key_blocks | 0 |
| Not_flushed_delayed_rows | 0 |
| Open_tables | 181 |
| Open_files | 340 |
| Open_streams | 0 |
| Opened_tables | 616 |
| Questions | 1803418 |
| Qcache_queries_in_cache | 2470 |
| Qcache_inserts | 724380 |
| Qcache_hits | 566940 |
| Qcache_lowmem_prunes | 41725 |
| Qcache_not_cached | 1046 |
| Qcache_free_memory | 25001616 |
| Qcache_free_blocks | 480 |
| Qcache_total_blocks | 5725 |
| Rpl_status | NULL |
| Select_full_join | 2529 |
| Select_full_range_join | 52 |
| Select_range | 156927 |
| Select_range_check | 0 |
| Select_scan | 91908 |
| Slave_open_temp_tables | 0 |
| Slave_running | OFF |
| Slow_launch_threads | 0 |
| Slow_queries | 5 |
| Sort_merge_passes | 0 |
| Sort_range | 221853 |
| Sort_rows | 51418590 |
| Sort_scan | 76657 |
| Table_locks_immediate | 2102105 |
| Table_locks_waited | 285 |
| Threads_cached | 7 |
| Threads_created | 8 |
| Threads_connected | 1 |
| Threads_running | 1 |
| Uptime | 392064 |
+--------------------------+------------+

eva2000
Thu 18th Mar '04, 11:28am
problem seems to be qmail hogging your resources for over 30+ mins as mysql is only lightly loaded

you send out alot of email ?

I don't have any experience with qmail, so maybe talk with your hosts and if using vB3 check to see your vBcron mail jobs might need disabling a few etc

celeron cpu is probably underpowered if you handle alot of email too

Mickie D
Tue 23rd Mar '04, 5:44am
problem seems to be qmail hogging your resources for over 30+ mins as mysql is only lightly loaded

you send out alot of email ?



thanks eva2000 your comments helped me get to the bottom of this :(

and it was my server runs qmail and i never setup a rcpthosts file, and it was an open relay i checked the logs and the mail queue using

qmailctl stat

found i had nearly 2 million mails in the queue :(

the lucky thing was i was not blocked for spam :), but i have sorted it now using queue-repair (python) and re compiling with the auth-mod :)

quite happy now but still watching it every day !!!

i see about 5 mails in the queue max now and my loads are back down to

0.00 - 0.40 max with 100+ people on :)

it only ever goes quite high when i am dojng an intensive process like the search index or updateing counters - is this ok ?

thanks again i wrote out a detailed explanation so if someone else has the same problem they might get an idea from this

Regards
Mickie

RichM
Tue 23rd Mar '04, 7:36am
it only ever goes quite high when i am dojng an intensive process like the search index or updateing counters - is this ok ?
Yes, that will happen on most servers depending on how big your board is, unless you are using one of Suns top end servers, then you wouldn't notice a difference. ;)