|
Server Very Slow
|
Posts: 25
Group: Registered
Joined: Jun 2006
Status:
Offline
Reputation: 0
|
Server Very Slow
Hi,
Recently i updated one of my server mysql 4.0.25 to 4.1.19. now this server is very slow it is taking long time to load pages. Please help me to tune this server well
Server: Intel® Celeron® CPU 2.40GHz
Control panel: Cpanel
Mysql: 4.1.19-standard
Apache: Apache/1.3.37
PHP: 4.4.3
Apache Setting
Timeout 30
KeepAlive On
MaxKeepAliveRequests 200
KeepAliveTimeout 2
MinSpareServers 20
MaxSpareServers 40
StartServers 15
MaxClients 200
--------------
My.cnf
-------
[mysqld]
socket=/var/lib/mysql/mysql.sock
skip-innodb
max_connections = 650
key_buffer = 24M
myisam_sort_buffer_size = 32M
join_buffer_size = 512K
read_buffer_size = 512K
sort_buffer_size = 256K
table_cache = 1248
thread_cache_size = 64
wait_timeout = 10800
connect_timeout = 10
tmp_table_size = 16M
max_allowed_packet = 16M
max_connect_errors = 10
query_cache_limit = 1M
query_cache_size = 64M
query_cache_type = 1
thread_concurrency=8
old-passwords = 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
--------------------
Top Status
-----------
17:58:02 up 5:33, 1 user, load average: 0.23, 0.47, 0.28
330 processes: 202 sleeping, 1 running, 127 zombie, 0 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 21.1% 0.0% 4.8% 0.0% 0.0% 1.9% 72.1%
Mem: 1026976k av, 782396k used, 244580k free, 0k shrd, 41736k buff
637532k actv, 64484k in_d, 3756k in_c
Swap: 2040244k av, 569740k used, 1470504k free 179736k cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
31639 nobody 16 0 13604 12M 1560 S 14.3 1.2 0:31 0 httpd
30121 root 20 0 1340 1340 884 R 2.8 0.1 0:00 0 top
31045 nobody 15 0 13652 12M 1948 S 0.9 1.2 0:34 0 httpd
32074 nobody 15 0 13268 10M 1552 S 0.9 1.0 0:19 0 httpd
9054 nobody 15 0 13556 12M 2272 S 0.9 1.2 0:05 0 httpd
29153 mysql 15 0 22772 22M 2744 S 0.9 2.2 0:00 0 mysqld
1 root 15 0 376 340 316 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:14 0 kswapd
6 root 15 0 0 0 0 SW 0.0 0.0 4:04 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
------------
Free -m
--------
total used free shared buffers cached
Mem: 1002 763 239 0 40 175
-/+ buffers/cache: 547 455
Swap: 1992 556 1436
------
root@bo1 [/misc]# ps aux | grep -c http
119
root@bo1 [/misc]#
root@bo1 [/misc]# ps aux | grep -c mysql
3
root@bo1 [/misc]#netstat -an | grep :80 | wc -l
34
root@bo1 [/misc]#
08-09-2006 09:48 AM
This post was last modified: 08-09-2006 02:11 PM by alias.
|
|
|
 |
Posts: 221
Group: Administrators
Joined: May 2006
Status:
Offline
Reputation: 0
|
RE: Server Very Slow
First of all optimize all of your databases..
mysqlcheck --all-databases --optimize
Second, make the following changes in your my.cnf file.
[mysqld]
socket=/var/lib/mysql/mysql.sock
skip-innodb
max_connections = 650
key_buffer = 92M
myisam_sort_buffer_size = 32M
join_buffer_size = 1M
read_buffer_size = 512K
sort_buffer_size = 1M
table_cache = 1024
thread_cache_size = 8
wait_timeout = 60
connect_timeout = 10
tmp_table_size = 16M
max_allowed_packet = 16M
max_connect_errors = 10
query_cache_limit = 1M
query_cache_size = 32M
query_cache_type = 1
thread_concurrency=2
old-passwords = 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
You should also try installing APC cache to speed up your php pages.
08-09-2006 02:47 PM
|
|
|
 |
Posts: 25
Group: Registered
Joined: Jun 2006
Status:
Offline
Reputation: 0
|
RE: Server Very Slow
what about apache is it enough. ?
today i got error
[Thu Aug 10 18:30:54 2006] [error] server reached MaxClients setting, consider raising the MaxClients setting
08-10-2006 02:56 PM
|
|
|
 |
Posts: 1
Group: Registered
Joined: Aug 2006
Status:
Offline
Reputation: 0
|
RE: Server Very Slow
what about apache is it enough. ?
today i got error
[Thu Aug 10 18:30:54 2006] [error] server reached MaxClients setting, consider raising the MaxClients setting
I had same problem and my Apache after reporting this error to the log (in about 1-3 hours) just died. I have Apache 2.0
After increasing MaxClients directive the problem dissapeared and webpages seems to load faster.
You should increase the value but be careful - you can have problems with lack of RAM if you increase the value too much. Try increasing it for about 50 and you will see the result in a day or two.
Good luck!
08-14-2006 01:33 PM
|
|
|
 |
Posts: 25
Group: Registered
Joined: Jun 2006
Status:
Offline
Reputation: 0
|
RE: Server Very Slow
Hi,
Now every day night this server mysql become down and getting erros like
mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: #08004Too many connections
/home/alaimes/public_html/vb/includes/class_core.php on line 273
Please help me i am big problem now. Every day when more users online then we getting "database error"
08-15-2006 05:33 PM
This post was last modified: 08-15-2006 05:39 PM by alias.
|
|
|
 |
Posts: 25
Group: Registered
Joined: Jun 2006
Status:
Offline
Reputation: 0
|
RE: Server Very Slow
Please help me all days morning mysql down and getting error
"Too many connections"
08-19-2006 06:20 AM
|
|
|
 |
Posts: 221
Group: Administrators
Joined: May 2006
Status:
Offline
Reputation: 0
|
RE: Server Very Slow
Please open a new topic and provide all the details like "top" n "free -m" output, httpd and mysql configs. And we cannot help you much if you provide top output when your server isn't even overloaded. Try posting the output at some peak times.
08-19-2006 10:02 AM
|
|
|
 |