PDA

View Full Version : Optimization


FiX
Sat 5th Mar '05, 9:14am
ok hi - I already had an optimziastionrequest a while ago, but I've still got some problems.

Problem is as follwing: Loading of the VBulletin pages takes 1-5 seconds in average, loading of other pages on the server takes much less than 1 second. Of course VBulletin pages are more complex, but I don't think that it's SUCH a huge difference.

For testing:

http://www.united-forum.de is the vbulletin forum (security patches are installed - also tested with a 3.0.7 + database, slow to).
http://abi05.united-forum.de (phpkitpage - index page is very huge, still much faster)
http://thriller.npx.de (html only, but shows that the server isn't really overloaded)

1. dedicated
2. your server specs. For example:

cpu speed/type single or dual cpus): celeron 2400
how much memory installed: 512mb ram
hard drive type/configuration: 80GB IDE
linux distributor or windows version: suse linux 9.0
apache/IIS version: apache2handler (2.0.48)
PHP version: 5.0.3 (CVS version without unserialize bug, also testet with 4.3.10 and 5.0.3 not from CVS)
MySQL version: 4.0.15


3. if you use mysql 4.x instead of mysql 3.23.x, do you have any innodb type databases/tables on your server ?
no
4. if possible how mysql was compiled/installed
don't know, think standard
5. your top stats

top - 13:57:15 up 3 days, 2:14, 1 user, load average: 0.66, 0.99, 0.87
Tasks: 98 total, 3 running, 93 sleeping, 0 stopped, 2 zombie

Cpu(s): 39.1% user, 1.3% system, 0.0% nice, 59.5% idle
Mem: 512552k total, 479144k used, 33408k free, 7064k buffers
Swap: 514072k total, 6112k used, 507960k free, 201980k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5435 wwwrun 9 0 15324 14m 8876 S 21.7 3.0 0:03.78 httpd2-prefork
5259 wwwrun 17 0 16132 15m 8572 R 16.4 3.1 0:03.11 httpd2-prefork
5438 root 13 0 972 972 748 R 1.3 0.2 0:00.34 top
25909 mysql 9 0 44164 43m 2824 S 0.7 8.6 0:13.06 mysqld
1 root 8 0 256 256 220 S 0.0 0.0 0:08.42 init
2 root 9 0 0 0 0 S 0.0 0.0 0:00.00 keventd
3 root 18 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd_CPU0
4 root 9 0 0 0 0 S 0.0 0.0 0:07.06 kswapd
5 root 9 0 0 0 0 S 0.0 0.0 0:00.00 bdflush
6 root 9 0 0 0 0 S 0.0 0.0 0:04.52 kupdated
9 root 9 0 0 0 0 S 0.0 0.0 0:00.00 khubd
10 root 9 0 0 0 0 S 0.0 0.0 0:18.87 kjournald
55 root 9 0 0 0 0 S 0.0 0.0 0:00.25 kjournald
424 root 9 0 472 472 420 S 0.0 0.1 0:00.01 dhcpcd
491 root 9 0 624 624 532 S 0.0 0.1 0:02.40 syslogd
494 root 9 0 1504 1504 472 S 0.0 0.3 0:00.06 klogd
513 bin 9 0 516 516 444 S 0.0 0.1 0:00.00 portmap
523 root 9 0 1396 1396 1176 S 0.0 0.3 0:00.01 saslauthd
550 root 9 0 1400 1400 1176 S 0.0 0.3 0:00.01 saslauthd
551 root 9 0 1400 1400 1176 S 0.0 0.3 0:00.01 saslauthd
552 root 9 0 1396 1396 1176 S 0.0 0.3 0:00.01 saslauthd
553 root 9 0 1396 1396 1176 S 0.0 0.3 0:00.01 saslauthd
558 root 8 0 880 880 752 S 0.0 0.2 0:00.29 xinetd
589 root 9 0 1612 1612 1468 S 0.0 0.3 0:01.42 sshd
607 root 9 0 280 280 232 S 0.0 0.1 0:00.00 startpar
615 named 9 0 2548 2548 1984 S 0.0 0.5 0:00.00 named
616 named 9 0 2548 2548 1984 S 0.0 0.5 0:01.43 named
617 named 9 0 2548 2548 1984 S 0.0 0.5 0:00.34 named
618 named 9 0 2548 2548 1984 S 0.0 0.5 0:00.50 named
619 named 9 0 2548 2548 1984 S 0.0 0.5 0:00.00 named
789 root 9 0 1344 1344 1088 S 0.0 0.3 0:03.66 master
861 root 9 0 804 804 660 S 0.0 0.2 0:03.52 nscd
866 root 9 0 804 804 660 S 0.0 0.2 0:01.93 nscd
867 root 9 0 804 804 660 S 0.0 0.2 0:04.69 nscd
869 root 9 0 804 804 660 S 0.0 0.2 0:00.20 nscd
870 root 9 0 804 804 660 S 0.0 0.2 0:00.12 nscd
871 root 9 0 804 804 660 S 0.0 0.2 0:00.14 nscd
876 root 9 0 804 804 660 S 0.0 0.2 0:00.15 nscd
883 root 8 0 5404 3688 3056 S 0.0 0.7 0:07.71 miniserv.pl
888 root 9 0 512 512 452 S 0.0 0.1 0:00.06 mingetty
889 root 9 0 512 512 452 S 0.0 0.1 0:00.05 mingetty
890 root 9 0 512 512 452 S 0.0 0.1 0:00.04 mingetty
891 root 9 0 512 512 452 S 0.0 0.1 0:00.06 mingetty
892 root 9 0 512 512 452 S 0.0 0.1 0:00.04 mingetty
893 root 9 0 512 512 452 S 0.0 0.1 0:00.05 mingetty
894 root 9 0 488 488 436 S 0.0 0.1 0:00.00 agetty
20675 root 9 0 588 588 512 S 0.0 0.1 0:00.74 cron
6823 root 9 0 5920 4244 3760 S 0.0 0.8 0:00.00 miniserv.pl
16739 root 9 0 1300 1300 1092 S 0.0 0.3 0:00.00 pipelog.pl
21274 postfix 9 0 1472 1472 1108 S 0.0 0.3 0:00.32 qmgr
25611 root 9 0 1208 1204 992 S 0.0 0.2 0:00.01 mysqld_safe
25646 mysql 9 0 44164 43m 2824 S 0.0 8.6 0:01.67 mysqld
25647 mysql 9 0 44164 43m 2824 S 0.0 8.6 0:00.60 mysqld


6. your mysql configuration variables located at /etc/my.cnf or c:\my.cnf so post the contents inside of my.cnf (minus any passwords of course). If on Windows server if you don't have that file you need to log into telnet and as root user type

# The MySQL server
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
max_connections = 100
key_buffer = 32M
max_allowed_packet = 2M
table_cache = 128
thread_cache_size = 64
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 4M
net_buffer_length = 8K
myisam_sort_buffer_size = 32M
query_cache_type = 1
query_cache_size = 16M
query_cache_limit = 1M

Also tested with 64M key buffer, myisam_sort_buffer 64M - also didnt hel


7. your mysql extended-status output which shows entire server's mysql activity status (preferably with a day or 2 worth of mysql uptime for better indication of real activity) either:


Sat Mar 5 14:03:10 CET 2005


top - 14:03:10 up 3 days, 2:20, 1 user, load average: 0.48, 0.55, 0.70
Tasks: 102 total, 1 running, 99 sleeping, 0 stopped, 2 zombie
Cpu(s): 33.1% user, 1.4% system, 0.0% nice, 65.6% idle
Mem: 512552k total, 463928k used, 48624k free, 7680k buffers
Swap: 514072k total, 6052k used, 508020k free, 207032k cached



Http processes currently running = 13
Mysql processes currently running = 29

Netstat information summary
2 FIN_WAIT2
9 ESTABLISHED
9 LISTEN
13 TIME_WAIT

+--------------------------+------------+
| Variable_name | Value |
+--------------------------+------------+
| Aborted_clients | 4 |
| Aborted_connects | 1 |
| Bytes_received | 82696671 |
| Bytes_sent | 1326037954 |
| Com_admin_commands | 0 |
| Com_alter_table | 0 |
| Com_analyze | 0 |
| Com_backup_table | 0 |
| Com_begin | 0 |
| Com_change_db | 21182 |
| 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 | 2357 |
| Com_delete_multi | 0 |
| Com_drop_db | 0 |
| Com_drop_function | 0 |
| Com_drop_index | 0 |
| Com_drop_table | 0 |
| Com_flush | 0 |
| Com_grant | 0 |
| Com_ha_close | 0 |
| Com_ha_open | 0 |
| Com_ha_read | 0 |
| Com_insert | 10864 |
| Com_insert_select | 88 |
| 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 | 1138 |
| Com_replace_select | 0 |
| Com_reset | 0 |
| Com_restore_table | 0 |
| Com_revoke | 0 |
| Com_rollback | 0 |
| Com_savepoint | 0 |
| Com_select | 97790 |
| Com_set_option | 0 |
| Com_show_binlog_events | 0 |
| Com_show_binlogs | 0 |
| Com_show_create | 0 |
| Com_show_databases | 4 |
| Com_show_fields | 2 |
| Com_show_grants | 1 |
| Com_show_keys | 1 |
| 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 | 1 |
| Com_show_innodb_status | 0 |
| Com_show_tables | 18 |
| Com_show_variables | 4 |
| Com_slave_start | 0 |
| Com_slave_stop | 0 |
| Com_truncate | 0 |
| Com_unlock_tables | 0 |
| Com_update | 35592 |
| Connections | 21987 |
| Created_tmp_disk_tables | 90 |
| Created_tmp_tables | 3317 |
| Created_tmp_files | 0 |
| Delayed_insert_threads | 0 |
| Delayed_writes | 0 |
| Delayed_errors | 0 |
| Flush_commands | 1 |
| Handler_commit | 0 |
| Handler_delete | 7586 |
| Handler_read_first | 5790 |
| Handler_read_key | 4911870 |
| Handler_read_next | 3891945 |
| Handler_read_prev | 68539 |
| Handler_read_rnd | 881097 |
| Handler_read_rnd_next | 16930213 |
| Handler_rollback | 0 |
| Handler_update | 135446 |
| Handler_write | 195328 |
| Key_blocks_used | 20589 |
| Key_read_requests | 10965574 |
| Key_reads | 20404 |
| Key_write_requests | 25370 |
| Key_writes | 20474 |
| Max_used_connections | 22 |
| Not_flushed_key_blocks | 0 |
| Not_flushed_delayed_rows | 0 |
| Open_tables | 128 | 100% of table_cache in use
| Open_files | 239 |
| Open_streams | 0 |
| Opened_tables | 731 |
| Questions | 305579 |
| Qcache_queries_in_cache | 924 |
| Qcache_inserts | 97632 |
| Qcache_hits | 114528 |
| Qcache_lowmem_prunes | 1952 |
| Qcache_not_cached | 241 |
| Qcache_free_memory | 5793312 |
| Qcache_free_blocks | 833 |
| Qcache_total_blocks | 3425 |
| Rpl_status | NULL |
| Select_full_join | 99 |
| Select_full_range_join | 60 |
| Select_range | 17150 |
| Select_range_check | 0 |
| Select_scan | 21292 |
| Slave_open_temp_tables | 0 |
| Slave_running | OFF |
| Slow_launch_threads | 0 |
| Slow_queries | 1 | (execution time > 10 secs)
| Sort_merge_passes | 0 |
| Sort_range | 20503 |
| Sort_rows | 1074864 |
| Sort_scan | 6871 |
| Table_locks_immediate | 280949 |
| Table_locks_waited | 80 |
| Threads_cached | 22 |
| Threads_created | 23 |
| Threads_connected | 1 |
| Threads_running | 1 |
| Uptime | 82262 | 22 hrs 51 mins 2 secs
+--------------------------+------------+


Key Reads/Key Read Requests = 0.001861 (Cache hit = 99.998139%)
Key Writes/Key Write Requests = 0.807016
Connections/second = 0.267 (/hour = 962.209)
KB received/second = 0.982 (/hour = 3534.181)
KB sent/second = 15.742 (/hour = 56670.745)
Temporary Tables Created/second = 0.040 (/hour = 145.161)
Opened Tables/second = 0.009 (/hour = 31.990)
Slow Queries/second = 0.000 (/hour = 0.044)
% of slow queries = 0.000%
Queries/second = 3.715 (/hour = 13372.935)


8. is your vB the only thing on the server? or other scripts & sites which utilise php and mysql?
as listed above - one also using mysql, one only using html

9. how many average and max concurrent users on your vB forum ? and what your cookie timeout is ?
daily average of about 50-100 Users online (cookie timeout 900) but even in the middle of the night with only 5 users only the page loading time never is fast than abou 1.5 seconds while the other pages and a clean vb3testforum loads at about 0.1-0.2 seconds.

10. create a file named phpinfo.php and place this code in it and post the url/link to it from your web site

https://h55406.serverkompetenz.net/phpinfo.php (eeacelerator installed since yesterday, still slow)

11. if you run Apache and you have your own dedicated server or access to your httpd.conf (apache configuration file) can you post the values you have set for the following :

KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 8
StartServers 5
MaxClients 40

Servers are kept low due to recent DoS attacks - server stays only like this - but the limits of max clients are never reached during normal time

12. what version of vB are you running ?

3.0.3 (with all security patches)

13. check to see if any files i.e. apache log files are hitting 2GB or 4GB max file size limits i.e. see if you have max file size exceeded messages in apache error log

No, can't find anything like that. Apachelogs are rotated regulary and usualy don't exceed about 100MB.

---

I really don't know what's the problem. I know a celeron isn't the best, but it should be able to deal with this amount of users..additionaly its not really that busy.

Thanks for any help...

Sometimes the vbulletin page loads pretty fast - just click around a bit and travel through the forum - you'll notice the lags.

eva2000
Sun 6th Mar '05, 2:00am
all 3 sites took around same time to load for me, actually 2nd link took longer to load for me than your forums and I'm on 1500k ADSL.

Celeron cpus aren't good web servers at all.. but probably low server min/start/max values in httpd.conf causing a bit of lag in loading

try

1. downgrade to PHP 4.3.10
2. change my.cnf to below


[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
skip-innodb
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 = 3600
connect_timeout = 10
tmp_table_size = 32M
max_allowed_packet = 16M
max_connect_errors = 10
query_cache_limit = 2M
query_cache_size = 32M
query_cache_type = 1

[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

restart mysql server

3. uninstall and reinstall eaccelerator

4. change httpd.conf values to below and restart apache

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