Web Hosting Talk







View Full Version : Server optimization


idontknow
10-25-2004, 02:08 PM
How to optimize my apache and mysql? Server: Dual Xeon 2.8Ghz with 2GB RAM. Apache 2.0.46. Big thanks. Apache settings now:

HostnameLookups Off
KeepAlive On
MaxKeepAliveRequests 1000
KeepAliveTimeout 2

<IfModule prefork.c>
StartServers 50
MinSpareServers 30
MaxSpareServers 64
MaxClients 150
MaxRequestsPerChild 0
</IfModule>

<IfModule worker.c>
StartServers 2
MaxClients 400
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
ThreadGuardArea on
</IfModule>

mySQL (3x) settings now:

[client]
port = 3306
socket = /var/lib/mysql/mysql.sock

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
set-variable = connect_timeout=15
set-variable = interactive_timeout=100
set-variable = join_buffer_size=1M
set-variable = key_buffer=128M
set-variable = max_allowed_packet=16M
set-variable = max_connections=500
set-variable = max_connect_errors=10
set-variable = myisam_sort_buffer_size=64M
set-variable = table_cache=1024
set-variable = thread_cache_size=100
set-variable = thread_concurrency=4
set-variable = wait_timeout=300
skip-innodb

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

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 16M
sort_buffer_size = 8M
read_buffer_size = 4M
write_buffer_size = 4M

[myisamchk]
key_buffer = 16M
sort_buffer_size = 8M
read_buffer_size = 4M
write_buffer_size = 4M

[mysqlhotcopy]
interactive-timeout

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

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

p[]
10-25-2004, 04:07 PM
It depends on what your trying to accomplish with the server, your bandwidth limitations, etc.

idontknow
10-25-2004, 04:19 PM
Server load

TQ Mark
10-25-2004, 08:29 PM
What sort of work is the server doing? vbulletin? other php scripts? perl scripts?

idontknow
10-26-2004, 12:39 AM
Webhosting

datums
10-26-2004, 01:37 AM
What kernel do you have running on the machine? also do you have HT enabled ?

idontknow
10-26-2004, 07:56 AM
Originally posted by datums
What kernel do you have running on the machine? also do you have HT enabled ?

Kernel 2.4.21-20

datums
10-26-2004, 10:42 AM
also do you have HT enabled ?

idontknow
10-26-2004, 11:06 AM
Hm.. I have Dual Xeon 2.8Ghz server in ThePlanet ( http://www.theplanet.com ) with PLESK and default configuration

idontknow
10-28-2004, 06:55 AM
so.. no suggestions?

andreyka
10-28-2004, 09:28 AM
I reccomend setup system limits to mysql and apache to pervent overload server.

datums
10-28-2004, 09:34 AM
Hello idontknow

My apologies for the delay.
I would suggest upgrading your kernel to start.
The 2.6 kernel has better overall performance.


Here is a detailed comparison.
http://www.2cpu.com/articles/98_1.html

Also enabling HT with 2.6 will result with much better apache/mysql performance than with the 2.4

idontknow
10-30-2004, 04:28 AM
At the moment I can't do that, so how can I tweak these settings?

idontknow
11-05-2004, 11:29 AM
Nothing.. ?

Nullified
11-05-2004, 11:33 AM
Originally posted by idontknow
At the moment I can't do that, so how can I tweak these settings? I don't understand how you can't do that....?

idontknow
11-05-2004, 11:39 AM
It cause a huge downtime, I want to stay with 2.4x and I know it is possible to tweak these settings.