|
server optimize request
|
Posts: 25
Group: Registered
Joined: Jun 2006
Status:
Offline
Reputation: 0
|
server optimize request
Hi,
We are facing very high server load in my server. it is dedicated server for Vbulletin. it was working fine before and also it is loading page very slowly.
Server Information.
Processsor: Intel® Xeon CPU 2.40GHz
RAM: 2 GB
apache: apache_1.3.36
php: 4.4.2
mysql: 4.0.27
This forum has 50000 users and around 500 users allways online.
http.conf
Timeout 150
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
MinSpareServers 10
MaxSpareServers 15
StartServers 10
MaxClients 200
MaxRequestsPerChild 500
------------------------
TOP status
-----------
10:36:37 up 7 days, 8:49, 1 user, load average: 10.47, 4.95, 3.64
151 processes: 136 sleeping, 15 running, 0 zombie, 0 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 89.6% 0.0% 10.2% 0.0% 0.0% 0.0% 0.0%
cpu00 93.8% 0.0% 5.9% 0.0% 0.1% 0.0% 0.0%
cpu01 90.0% 0.0% 9.9% 0.0% 0.0% 0.0% 0.0%
cpu02 86.0% 0.0% 13.7% 0.0% 0.1% 0.0% 0.0%
cpu03 88.6% 0.0% 11.3% 0.0% 0.0% 0.0% 0.0%
Mem: 3082416k av, 2543368k used, 539048k free, 0k shrd, 55932k buff
1271356k actv, 893800k in_d, 50300k in_c
Swap: 2040244k av, 60156k used, 1980088k free 1738916k cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
11444 mysql 17 0 221M 199M 1656 R 9.8 6.6 8:08 3 mysqld
15291 mysql 17 0 216M 194M 1656 R 7.6 6.4 4:33 1 mysqld
11483 mysql 17 0 221M 199M 1656 R 7.4 6.6 10:43 0 mysqld
15884 mysql 17 0 216M 193M 1656 R 5.8 6.4 4:55 3 mysqld
10606 mysql 17 0 221M 199M 1656 R 5.6 6.6 10:32 2 mysqld
21579 mysql 17 0 216M 193M 1656 R 5.6 6.4 1:47 3 mysqld
25228 nobody 19 0 15160 14M 3764 R 4.1 0.4 0:06 3 httpd
24784 nobody 20 0 15692 15M 3844 R 3.9 0.5 0:31 0 httpd
24673 nobody 20 0 15324 14M 3812 R 3.8 0.4 0:42 0 httpd
25233 nobody 20 0 14332 13M 3764 S 3.7 0.4 0:08 0 httpd
25274 nobody 16 0 14988 14M 3788 R 3.3 0.4 0:01 1 httpd
----------------
my.cnf
---------
[mysqld]
skip-locking
skip-innodb
max_connections = 650
key_buffer = 128M
myisam_sort_buffer_size = 16M
join_buffer_size = 768K
read_buffer_size = 768K
sort_buffer_size = 1M
table_cache = 1500
thread_cache_size = 32
interactive_timeout = 60
wait_timeout = 60
connect_timeout = 10
tmp_table_size = 32M
max_allowed_packet = 16M
max_connect_errors = 10
thread_concurrency= 2
query_cache_limit = 1M
query_cache_size = 64M
query_cache_type = 1
#query_prealloc_size = 16384
#query_alloc_block_size = 16384
[mysqld_safe]
err-log=/var/log/mysqld.log
open_files_limit = 8192
[mysqldump]
quick
max_allowed_packet = 16M
[myisamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M
----------------------
Please help me
06-20-2006 03:51 PM
|
|
|
 |
Posts: 221
Group: Administrators
Joined: May 2006
Status:
Offline
Reputation: 0
|
RE: server optimize request
Please post the output of:
free -m
ps aux | grep -c httpd
ps aux | grep -c mysqld
06-20-2006 03:56 PM
|
|
|
 |
Posts: 25
Group: Registered
Joined: Jun 2006
Status:
Offline
Reputation: 0
|
RE: server optimize request
root@001 [/home/cpapachebuild/buildapache]# free -m
total used free shared buffers cached
Mem: 3010 2414 595 0 55 1705
-/+ buffers/cache: 653 2356
Swap: 1992 58 1933
root@001 [/home/cpapachebuild/buildapache]#
root@001 [/tmp]# ps aux | grep -c httpd
32
root@001 [/tmp]#
root@001[/tmp]# ps aux | grep -c mysql
37
I really appretiate your quick responce. i like This forum
06-20-2006 04:03 PM
This post was last modified: 06-20-2006 04:07 PM by alias.
|
|
|
 |
Posts: 221
Group: Administrators
Joined: May 2006
Status:
Offline
Reputation: 0
|
RE: server optimize request
Replace your current my.cnf with this one:
[mysqld]
skip-locking
skip-innodb
max_connections = 300
key_buffer = 256M
myisam_sort_buffer_size = 16M
join_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 4M
sort_buffer_size = 2M
table_cache = 2000
thread_cache_size = 32
interactive_timeout = 60
wait_timeout = 60
connect_timeout = 10
tmp_table_size = 32M
max_allowed_packet = 16M
max_connect_errors = 10
thread_concurrency= 2
query_cache_limit = 1M
query_cache_size = 64M
query_cache_type = 1
[mysqld_safe]
err-log=/var/log/mysqld.log
open_files_limit = 8192
[mysqldump]
quick
max_allowed_packet = 16M
[myisamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M
Make the following changes in your httpd.conf:
Timeout 30
KeepAlive On
MaxKeepAliveRequests 130
KeepAliveTimeout 3
MinSpareServers 20
MaxSpareServers 40
StartServers 15
MaxClients 250
MaxRequestsPerChild 500
06-20-2006 04:27 PM
|
|
|
 |
Posts: 25
Group: Registered
Joined: Jun 2006
Status:
Offline
Reputation: 0
|
RE: server optimize request
Thanks for your update. i did this and now i feel it is better. now i am watching its load.
06-20-2006 05:52 PM
|
|
|
 |
Posts: 25
Group: Registered
Joined: Jun 2006
Status:
Offline
Reputation: 0
|
RE: server optimize request
Thankyou very much admin now my website is fast but some time its load is increasing.
Please let me know any other idea to fix this.
???
?
11:40:15 up 8 days, 9:53, 1 user, load average: 7.73, 6.75, 5.41
150 processes: 140 sleeping, 10 running, 0 zombie, 0 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 82.1% 0.0% 17.1% 0.0% 0.3% 0.0% 0.1%
cpu00 79.2% 0.0% 19.5% 0.1% 0.3% 0.0% 0.5%
cpu01 83.6% 0.0% 15.3% 0.0% 0.9% 0.0% 0.0%
cpu02 84.8% 0.0% 14.9% 0.0% 0.0% 0.0% 0.1%
cpu03 80.8% 0.0% 18.9% 0.0% 0.1% 0.0% 0.0%
Mem: 3082416k av, 2915056k used, 167360k free, 0k shrd, 136356k buff
1472588k actv, 933556k in_d, 46996k in_c
Swap: 2040244k av, 26080k used, 2014164k free 1868400k cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
2006 mysql 18 0 165M 165M 1764 R 14.7 5.4 34:21 1 mysqld
7928 mysql 22 0 165M 165M 1764 R 14.6 5.4 30:37 1 mysqld
32635 mysql 22 0 165M 165M 1764 R 14.5 5.4 3:15 0 mysqld
10308 mysql 22 0 165M 165M 1764 R 12.2 5.4 23:31 2 mysqld
10998 mysql 22 0 165M 165M 1764 R 11.3 5.4 24:04 3 mysqld
1346 nobody 15 0 15872 15M 3852 S 4.6 0.5 1:22 2 httpd
1407 nobody 15 0 15852 15M 3820 S 1.4 0.5 1:24 3 httpd
2100 nobody 15 0 15988 15M 3828 S 1.3 0.5 1:07 2 httpd
3381 nobody 15 0 11000 10M 3744 S 1.3 0.3 0:05 1 httpd
2098 nobody 15 0 15924 15M 3844 S 1.2 0.5 1:03 1 httpd
825 nobody 16 0 15704 15M 3888 S 0.8 0.5 1:33 2 httpd
06-21-2006 04:52 PM
This post was last modified: 06-21-2006 04:54 PM by alias.
|
|
|
 |
Posts: 221
Group: Administrators
Joined: May 2006
Status:
Offline
Reputation: 0
|
RE: server optimize request
Try moving your MySQL to a second disk (not partition, another disk drive). Anyways, a load of 5 average isn't too much to worry about when it's just a spike because you're having a dual xeon. A load around 3-4 is fine for your server.
Use this article to move MySQL to a second disk:
http://spicefuse.com/Optimization-How-To...-t-10.html
06-23-2006 01:37 PM
|
|
|
 |
Posts: 25
Group: Registered
Joined: Jun 2006
Status:
Offline
Reputation: 0
|
RE: server optimize request
i affraid is this server load due to any table curruption mysql ??
How can find if it is like this, How can i optmize mysql db ?
I will really appretiate you if you can advice me more..
06-27-2006 09:02 AM
|
|
|
 |
Posts: 25
Group: Registered
Joined: Jun 2006
Status:
Offline
Reputation: 0
|
RE: server optimize request
04:09:47 up 14 days, 2:23, 1 user, load average: 12.24, 9.94, 9.35
183 processes: 170 sleeping, 11 running, 1 zombie, 1 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 76.9% 1.2% 21.3% 0.0% 0.4% 0.0% 0.0%
cpu00 74.2% 2.2% 22.2% 0.0% 1.3% 0.0% 0.0%
cpu01 76.7% 2.6% 20.5% 0.0% 0.0% 0.0% 0.0%
cpu02 77.7% 0.0% 21.7% 0.0% 0.4% 0.0% 0.0%
cpu03 79.1% 0.0% 20.8% 0.0% 0.0% 0.0% 0.0%
Mem: 3082416k av, 3056328k used, 26088k free, 0k shrd, 12536k buff
2367748k actv, 457840k in_d, 52384k in_c
Swap: 2040244k av, 48652k used, 1991592k free 1938240k cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
21488 mysql 21 0 210M 210M 1520 R 17.1 6.9 2:56 0 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysq
21498 mysql 24 0 210M 210M 1520 R 14.7 6.9 1:55 0 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysq
21157 mysql 20 0 210M 210M 1520 R 12.6 6.9 2:30 2 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysq
21177 mysql 21 0 210M 210M 1520 R 7.1 6.9 2:03 3 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysq
21948 mysql 22 0 210M 210M 1520 R 6.8 6.9 0:59 2 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysq
30143 mysql 25 0 210M 210M 1520 R 6.7 6.9 14:21 3 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysq
21496 mysql 23 0 210M 210M 1520 R 6.6 6.9 1:32 3 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysq
21853 nobody 15 0 12668 12M 2840 S 4.5 0.4 1:10 1 /usr/local/apache/bin/httpd -DSSL
21160 mysql 24 0 210M 210M 1520 S 2.6 6.9 2:47 3 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysq
21068 nobody 16 0 15100 14M 2900 S 1.7 0.4 2:07 3 /usr/local/apache/bin/httpd -DSSL
21780 nobody 16 0 24344 23M 2892 S 1.6 0.7 1:28 0 /usr/local/apache/bin/httpd -DSSL
21783 nobody 15 0 14872 14M 2872 S 1.6 0.4 1:18 2 /usr/local/apache/bin/httpd -DSSL
21784 nobody 16 0 14704 14M 2872 S 1.6 0.4 1:27 0 /usr/local/apache/bin/httpd -DSSL
21134 nobody 15 0 12656 12M 2840 S 1.5 0.4 1:45 3 /usr/local/apache/bin/httpd -DSSL
21865 nobody 16 0 12820 12M 2840 S 1.5 0.4 1:34 3 /usr/local/apache/bin/httpd -DSSL
21922 nobody 15 0 12664 12M 2840 S 1.5 0.4 1:20 3 /usr/local/apache/bin/httpd -DSSL
21934 nobody 15 0 15084 14M 2848 S 1.5 0.4 1:04 2 /usr/local/apache/bin/httpd -DSSL
19987 root 39 19 608 608 256 R N 1.4 0.0 6:56 1 gzip
21781 nobody 15 0 15140 14M 2848 S 1.4 0.4 1:19 0 /usr/local/apache/bin/httpd -DSSL
20782 nobody 15 0 14836 14M 2840 S 1.2 0.4 2:26 1 /usr/local/apache/bin/httpd -DSSL
23312 nobody 15 0 15124 14M 2848 S 0.6 0.4 0:15 3 /usr/local/apache/bin/httpd -DSSL
06-27-2006 09:20 AM
|
|
|
 |
Posts: 221
Group: Administrators
Joined: May 2006
Status:
Offline
Reputation: 0
|
RE: server optimize request
First of all, I noticed that gzip is running. What were you compressing? Try posting stats of a different time because gzip should have used much I/O so this isn't so efficient.
Second, Have you moved your MySQL to the second disk as I suggested in my previous post?
You can optimize and repair your MySQL using this command:
mysqlcheck -uroot -p -or --all-databases
Few more tips:
1. Disable logs (access and error logs) if necessary.
2. Don't run any kind of backups on peak times.
3. Upgrade kernel (this isn't an easy task so get it done by paid professionals)
Kernel 2.6.16 should be a nice choice. The new kernels offer significant improvements over the 2.4.x kernels.
4. Install APC or eAccelerator if you havn't already.
5. Disable un-necessary stats software(s) on your server.
That's all I can suggest for now.
06-27-2006 03:23 PM
|
|
|
 |
|
|