Post Reply  Post Thread 
Optimize server (mysql-4.1)
alias
Junior Member
**

Posts: 25
Group: Registered
Joined: Jun 2006
Status: Offline
Reputation: 0
Post: #1
Optimize server (mysql-4.1)

In this server there is no more over load but When user trying to post messages this become very slow, and also it taking little bit time to load
it is dedicated server for one website and it has around 15000 Registered Users. and also ps -aux allways showing only 3 mysql process


Intel® Pentium® 4 CPU 3.40GHz
Memmory: 2GM
OS: RHEL-3
Control panel Cpanel
MYSQL=4.1.19-standard


http.conf
----------

Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 200
MaxRequestsPerChild 1000

my.cnf
---------
root@srv15 [/tmp]# cat /etc/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


free -m
-------
total used free shared buffers cached
Mem: 1998 1646 351 0 184 807
-/+ buffers/cache: 654 1343
Swap: 1992 15 1976

root@Huge [/tmp]# ps -aux | grep -c http
17
root@Huge [/tmp]# ps -aux | grep -c mysql
3



Top status
----------
19:28:09 up 33 days, 9:16, 1 user, load average: 0.04, 0.04, 0.09
101 processes: 100 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 0.0% 0.0% 0.4% 0.0% 0.0% 0.0% 99.5%
cpu00 0.0% 0.0% 0.9% 0.0% 0.0% 0.0% 99.0%
cpu01 0.0% 0.0% 0.0% 0.0% 0.0% 0.0% 100.0%
Mem: 2045960k av, 1677808k used, 368152k free, 0k shrd, 188812k buff
890324k actv, 218184k in_d, 30448k in_c
Swap: 2040244k av, 15992k used, 2024252k free 826440k cached

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
2210 root 20 0 1132 1132 892 R 0.4 0.0 0:00 0 top
1 root 15 0 328 300 268 S 0.0 0.0 2:33 0 init
2 root RT 0 0 0 0 SW 0.0 0.0 0:00 0 migration/0
3 root RT 0 0 0 0 SW 0.0 0.0 0:00 1 migration/1
4 root 15 0 0 0 0 SW 0.0 0.0 0:00 1 keventd
5 root 34 19 0 0 0 SWN 0.0 0.0 0:00 0 ksoftirqd/0
6 root 34 19 0 0 0 SWN 0.0 0.0 0:00 1 ksoftirqd/1
9 root 16 0 0 0 0 SW 0.0 0.0 0:20 0 bdflush
7 root 15 0 0 0 0 SW 0.0 0.0 6:20 1 kswapd
8 root 15 0 0 0 0 SW 0.0 0.0 0:53 0 kscand
10 root 15 0 0 0 0 SW 0.0 0.0 2:26 0 kupdated
11 root 25 0 0 0 0 SW 0.0 0.0 0:00 0 mdrecoveryd
18 root 21 0 0 0 0 SW 0.0 0.0 0:00 0 scsi_eh_0

07-20-2006 03:50 PM
Find all posts by this user Quote this message in a reply
Pacifier
Administrator
*******

Posts: 221
Group: Administrators
Joined: May 2006
Status: Offline
Reputation: 0
Post: #2
RE: Optimize server (mysql-4.1)

From that, it doesn't seems like it should be slow at all. Do you have any modifications installed on the forum relating to posting? Some modifications could be making it slow.

Make the following changes in my.cnf:

Code:
[mysqld]
skip-locking
skip-innodb
max_connections = 650
key_buffer = 128M
myisam_sort_buffer_size = 32M
join_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 2M
sort_buffer_size = 2M
table_cache = 1500
thread_cache_size = 16
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 = 32M
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


Also, you should optimize your httpd.conf for preventing load issues:

Code:
Timeout 60
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 200
MaxRequestsPerChild 1000

07-20-2006 04:13 PM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: