PDA

View Full Version : Optimisation Request


Marco van Herwaarden
Mon 27th Feb '06, 1:45pm
1. Is this on dedicated or shared virual server. If shared, how many sites share this server (ask web host if needed)
Dedicated host
2. your server specs. For example:

cpu speed/type single or dual cpus): P4-HT 3.2GHz
how much memory installed: 1Gb ram
hard drive type/configuration: 80GB IDE non raid
linux distributor or windows version: redhat 2.4.21-37.0.1.ELsmp
apache/IIS version: Apache v1.3.34
PHP version: php 4.4.2
MySQL version: mysql 4.1.18-standard


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. Direct from rpm
5. your top stats
17:28:18 up 3 days, 3:48, 1 user, load average: 2.58, 3.19, 3.03
177 processes: 170 sleeping, 7 running, 0 zombie, 0 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 62.9% 0.0% 4.6% 0.0% 1.0% 0.0% 31.3%
cpu00 60.7% 0.0% 4.9% 0.0% 2.1% 0.0% 32.0%
cpu01 65.0% 0.0% 4.3% 0.0% 0.0% 0.0% 30.5%
Mem: 2054952k av, 1910752k used, 144200k free, 0k shrd, 113396k buff
1294444k actv, 271660k in_d, 31240k in_c
Swap: 2096440k av, 0k used, 2096440k free 1054224k cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
12266 nobody 15 0 23216 22M 15608 S 8.0 1.1 5:42 1 httpd
29519 nobody 15 0 28928 28M 20864 S 5.1 1.4 41:03 0 httpd
13002 nobody 15 0 22852 22M 14664 S 4.8 1.1 5:49 1 httpd
15596 nobody 16 0 12560 12M 5280 R 4.7 0.6 0:08 1 httpd
29521 nobody 15 0 27844 27M 19788 S 4.4 1.3 40:18 0 httpd
29531 nobody 15 0 28840 28M 20812 S 4.4 1.4 39:12 0 httpd
15759 nobody 20 0 11096 10M 3768 S 4.3 0.5 0:00 1 httpd
29520 nobody 15 0 28932 28M 20904 S 4.1 1.4 38:45 1 httpd
14786 nobody 15 0 14992 14M 7264 S 4.0 0.7 0:09 0 httpd
14940 nobody 16 0 13580 13M 5664 S 3.4 0.6 0:08 0 httpd
19416 mysql 16 0 80100 78M 1756 S 2.5 3.8 7:29 1 mysqld
17722 mysql 16 0 80100 78M 1756 S 2.3 3.8 28:42 1 mysqld
13825 nobody 15 0 12812 12M 4996 S 2.3 0.6 0:02 0 httpd

6. your mysql configuration variables located at /etc/my.cnf or c:\my.cnf or my.ini so post the contents inside of my.cnf (minus any passwords of course).
[mysqld]
safe-show-database
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 = 1800
thread_cache_size = 384
wait_timeout = 180
connect_timeout = 10
tmp_table_size = 128M
max_heap_table_size = 80M
max_allowed_packet = 64M
max_connect_errors = 10
read_rnd_buffer_size = 524288
bulk_insert_buffer_size = 8M
thread_concurrency = 2
query_cache_limit = 4M
query_cache_size = 80M
query_cache_type = 1
query_prealloc_size = 65536
query_alloc_block_size = 32768
[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
[mysqlhotcopy]
interactive-timeout

7. MySQL stats from ssh telnet as root user type:

MySQL 4.1.18-standard uptime 2 19:26:37 Mon Feb 27 17:32:57 2006
__ Key __________________________________________________ _______________
Buffer usage 14.16M of 16.00M %Used: 88.48
Write ratio 0.51
Read ratio 0.00
__ Questions __________________________________________________ _________
Total 5.71M 23.53/s
QC Hits 2.53M 10.41/s %Total: 44.23
DMS 2.36M 9.70/s 41.24
Com_ 418.60k 1.72/s 7.33
COM_QUIT 411.38k 1.69/s 7.20
+Unknown 74 0.00/s 0.00
Slow 0 0.00/s 0.00 %DMS: 0.00
DMS 2.36M 9.70/s 41.24
SELECT 1.67M 6.88/s 29.25 70.91
UPDATE 490.62k 2.02/s 8.59 20.82
INSERT 105.69k 0.44/s 1.85 4.49
REPLACE 55.36k 0.23/s 0.97 2.35
DELETE 33.65k 0.14/s 0.59 1.43
Com_ 418.60k 1.72/s 7.33
change_db 409.81k 1.69/s 7.17
set_option 2.24k 0.01/s 0.04
show_tables 1.56k 0.01/s 0.03
__ SELECT and Sort __________________________________________________ ___
Scan 585.25k 2.41/s %SELECT: 35.03
Range 335.06k 1.38/s 20.05
Full join 1.30k 0.01/s 0.08
Range check 0 0.00/s 0.00
Full rng join 0 0.00/s 0.00
Sort scan 251.91k 1.04/s
Sort range 277.96k 1.14/s
Sort mrg pass 67 0.00/s
__ Query Cache __________________________________________________ _______
Memory usage 23.03M of 80.00M %Used: 28.79
Block Fragmnt 18.68%
Hits 2.53M 10.41/s
Inserts 1.58M 6.50/s
Prunes 1 0.00/s
Insrt:Prune 1.58M:1 6.50/s
Hit:Insert 1.60:1

__ Table Locks __________________________________________________ _______
Waited 55.69k 0.23/s %Total: 1.26
Immediate 4.36M 17.98/s
__ Tables __________________________________________________ ____________
Open 608 of 1800 %Cache: 33.78
Opened 999 0.00/s
__ Connections __________________________________________________ _______
Max used 32 of 500 %Max: 6.40
Total 411.39k 1.69/s
__ Created Temp __________________________________________________ ______
Disk table 1.45k 0.01/s
Table 33.32k 0.14/s
File 134 0.00/s
__ Threads __________________________________________________ ___________
Running 1 of 1
Cache 31 %Hit: 99.99
Created 32 0.00/s
Slow 0 0.00/s
__ Aborted __________________________________________________ ___________
Clients 12 0.00/s
Connects 76 0.00/s
__ Bytes __________________________________________________ _____________
Sent 4.11G 16.93k/s
Received 1.69G 6.96k/s


8. is your vB the only thing on the server? or other scripts & sites which utilise php and mysql? Almost only thing that is running.

9. how many average and max concurrent users on your vB forum ? and what your cookie timeout is ?
Currently Active Users: 536 (371 members and 165 guests)
Most users ever online was 1,098, 30th October 2005 at 12:08 PM.
Cookie Timeout: 4500 :eek:

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

http://www.alsat.co.uk/forum/index.php?do=phpinfo

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 2
MinSpareServers 10
MaxSpareServers 20
StartServers 5
MaxClients 250
MaxRequestsPerChild 0

12. what version of vB are you running ? 3.5.4

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
Only 2 backup files

14. Post output from these 3 commands

uname -a
Linux texas1.alsat.co.uk 2.4.21-37.0.1.ELsmp #1 SMP Wed Jan 11 18:44:17 EST 2006 i686 i686 i386 GNU/Linux


ulimit -aH
core file size (blocks, -c) 1000000
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) 4
max memory size (kbytes, -m) unlimited
open files (-n) 4096
pipe size (512 bytes, -p) 8
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 14335
virtual memory (kbytes, -v) unlimited

cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Pentium(R) 4 CPU 3.20GHz
stepping : 9
cpu MHz : 3192.073
cache size : 512 KB
physical id : 0
siblings : 2
runqueue : 0
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips : 6370.09

processor : 1
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Pentium(R) 4 CPU 3.20GHz
stepping : 9
cpu MHz : 3192.073
cache size : 512 KB
physical id : 0
siblings : 2
runqueue : 0
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips : 6383.20

eva2000
Tue 28th Feb '06, 3:02am
hey there :)

mysql settings and stats look fine i'd increase key_buffer from 16M to 64M in my.cnf and restart mysql though

change httpd.conf from

KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 2
MinSpareServers 10
MaxSpareServers 20
StartServers 5
MaxClients 250
MaxRequestsPerChild 0

to

KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 6
MinSpareServers 10
MaxSpareServers 15
StartServers 10
MaxClients 150
MaxRequestsPerChild 10000

restart apache

Marco van Herwaarden
Tue 28th Feb '06, 6:37am
Thanks eva, changed according to your advise. :)

One thing i noticed though, is MySQL not stopping clean? I change the my.cnf, and did a service mysql restart. After that my Post table was marked as crashed with a missing key in index. First time i had a crashed table on this server.

Repair table took care of it, but a bit coincidence that the table crashed on a restart.

eva2000
Tue 28th Feb '06, 9:11am
i always use mysql stop and wait a few seconds before issuing a mysql start... much better than restart option

if you don't want mysql error messages, just stop apache, stop mysql, start mysql, start apache :)