PDA

View Full Version : New Server Optimization Help


Kaelon
Sun 29th Jun '03, 3:53am
Hi, Eva - and fellow Server Config lurkers

I just recently purchased a beautiful server and while it's been handling my traffic (around 130 simultaneous connections) nicely, I'm basically using an unconfigured my.cnf (out of box). Can you help me optimize it? Thanks!

Information:

1. Dedicated Server

2. Server Specs

Dell Dual Xeon 2.0 Ghz
1 Gig of RAM
(2) 73 GB RAID HD
Redhat Linux 7.3
PHP Version 4.1.2
MySQL Version 3.23.54

3. MySQL 3.23.54 (no InnoDBs)

4. Standard Rackshack/Redhat Installation

5. Top Stats with around 40 users:

12:50am up 3 days, 4:25, 1 user, load average: 0.55, 0.33, 0.33
87 processes: 86 sleeping, 1 running, 0 zombie, 0 stopped
CPU0 states: 0.1% user, 0.1% system, 0.0% nice, 99.3% idle
CPU1 states: 0.1% user, 0.2% system, 0.0% nice, 99.2% idle
CPU2 states: 0.0% user, 0.1% system, 0.0% nice, 99.4% idle
CPU3 states: 0.0% user, 1.0% system, 0.0% nice, 98.4% idle
Mem: 1030560K av, 1019756K used, 10804K free, 0K shrd, 77732K buff
Swap: 2048276K av, 0K used, 2048276K free 775400K cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
10139 admin 15 0 1072 1072 848 R 0.3 0.1 0:00 top
9506 apache 15 0 9884 9884 7328 S 0.1 0.9 0:04 httpd
9635 apache 15 0 10844 10M 7300 S 0.1 1.0 0:03 httpd
1 root 15 0 488 488 420 S 0.0 0.0 0:06 init
2 root 0K 0 0 0 0 SW 0.0 0.0 0:00 migration_CPU0
3 root 0K 0 0 0 0 SW 0.0 0.0 0:00 migration_CPU1
4 root 0K 0 0 0 0 SW 0.0 0.0 0:00 migration_CPU2
5 root 0K 0 0 0 0 SW 0.0 0.0 0:00 migration_CPU3
6 root 15 0 0 0 0 SW 0.0 0.0 0:00 keventd
7 root 34 19 0 0 0 SWN 0.0 0.0 0:00 ksoftirqd_CPU0
8 root 34 19 0 0 0 SWN 0.0 0.0 0:00 ksoftirqd_CPU1
9 root 34 19 0 0 0 SWN 0.0 0.0 0:00 ksoftirqd_CPU2
10 root 34 19 0 0 0 SWN 0.0 0.0 0:00 ksoftirqd_CPU3
11 root 15 0 0 0 0 SW 0.0 0.0 0:04 kswapd

6. my.cnf

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

7. mysqladmin -u root -p variables

(For some reason, I can't figure out what my MySQLadmin root password is - Plesk doesn't seem to want to give it to me. Any thoughts?)

7. your mysql extended-status output either still telnet as root user type

Http processes currently running = 31
Mysql processes currently running = 10

Netstat information summary
1 SYN_RECV
5 ESTABLISHED
16 LISTEN
225 TIME_WAIT

8. vBulletin 2.3.0, custom derivative of vBPortal (based roughly around a Nuke 5.2 build), and Photopost 4.0 Pro.

9. Average concurent users - 60-70. Peak times around 120-140.

10. http://www.alleria.com/test.php = phpinfo

Kaelon
Sun 29th Jun '03, 2:18pm
An update -- apparently, Rackshack eliminates the MySQL root user account, and instead makes a new account "admin" administrative over MySQL, but I wasn't able to call up the extended information using the commands contained in the readme. Any thoughts? (I'm using Plesk 5.0 for remote server administration - might that be the cause of it?)

Thanks again in advance for any new my.cnf help you can give me!

All the best,
Kaelon

eva2000
Sun 29th Jun '03, 11:30pm
An update -- apparently, Rackshack eliminates the MySQL root user account, and instead makes a new account "admin" administrative over MySQL, but I wasn't able to call up the extended information using the commands contained in the readme. Any thoughts? (I'm using Plesk 5.0 for remote server administration - might that be the cause of it?)

Thanks again in advance for any new my.cnf help you can give me!

All the best,
Kaelon
rackshack does this or do you mean plesk control does this ?

Kaelon
Mon 30th Jun '03, 12:51am
Plesk Server Administrator apparently deletes MySQL root, and instead creates an admin acct.

Any thoughts on my.cnf that might work best for me, eva? Thanks so much :)

Kaelon

eva2000
Mon 30th Jun '03, 4:21am
try this on for size and restart mysql


[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
set-variable = max_connections=400
set-variable = key_buffer=16M
set-variable = myisam_sort_buffer_size=64M
set-variable = join_buffer=1M
set-variable = record_buffer=2M
set-variable = sort_buffer=2M
set-variable = table_cache=1024
set-variable = thread_cache_size=128
set-variable = wait_timeout=3600
set-variable = connect_timeout=10
set-variable = max_allowed_packet=16M
set-variable = max_connect_errors=10

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
open_files_limit=8192

[mysqldump]
quick
set-variable = max_allowed_packet=16M

[myisamchk]
set-variable = key_buffer=64M
set-variable = sort_buffer=64M
set-variable = read_buffer=16M
set-variable = write_buffer=16M

Kaelon
Sat 23rd Aug '03, 7:17pm
Just an update on this -- I've been using the above figures and performance seems to be going well. I have a question, though -- if I want to support more simultaneous connections, can I simply raise the value higher than 400, or should I also raise corresponding memory values?

Thanks,
Kaelon

eva2000
Sun 24th Aug '03, 3:03am
i wouldn't raise the max_connections value of 400 unless your mysqlinfo.php url reports you're at max_used_connections = 400 and only then would i raise it but no more than 800-1024

if you turn off pconnects in vB config.php you should be better off if you're over 400+ max_used_connections