Optimal server settings

Optimal server settings

Postby ayalon on Sat Jan 07, 2006 3:41 pm

Ok you guys who have performance problems here is the config for my server, which has a lot of users and hits a day:

my.cnf on mysql 4

safe-show-database
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-locking
skip-innodb
set-variable = max_connections=300
set-variable = key_buffer=32M
set-variable = myisam_sort_buffer_size=32M
set-variable = join_buffer=1M
set-variable = record_buffer=1M
set-variable = sort_buffer=2M
set-variable = table_cache=1800
set-variable = thread_cache=8
set-variable = thread_cache_size=256
set-variable = wait_timeout=360
set-variable = connect_timeout=10
set-variable = max_allowed_packet=16M
set-variable = max_connect_errors=10
query_cache_type=1 -->remove for sql 3xxx
query_cache_size=32m -->remove for sql 3xxx
query_cache_limit = 1M -->remove for sql 3xxx

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

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

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

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

httpd.conf:

Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 2

<IfModule prefork.c>
StartServers 6
MinSpareServers 15
MaxSpareServers 40
MaxClients 40
MaxRequestsPerChild 1000
</IfModule>


<IfModule worker.c>
StartServers 4
MaxClients 40
MinSpareThreads 4
MaxSpareThreads 10
ThreadsPerChild 25
MaxRequestsPerChild 0

php.ini:


max_execution_time = 30 ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
memory_limit = 32M

Other good start points:

Mysql:
http://dev.mysql.com/doc/refman/5.0/en/ ... erver.html

Apache:
http://httpd.apache.org/docs/2.0/

Php:
http://www.php.net/manual/en/features.php

A lot of settings depend on your hardware enviroment. The standard settings shown here are for good for most hardware!
Last edited by ayalon on Sat Mar 18, 2006 3:25 pm, edited 1 time in total.
ayalon
 
Posts: 153
Joined: Thu May 12, 2005 6:39 am

Postby phunkphorce on Wed Jan 11, 2006 12:49 pm

What sort of hardware configuration do you have? Are the web server and the mysql server in the same machine? What sort of network card do you have? What sort of network connection? Amoun of memory? Processor?

These things matter too when it comes to performance :)
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa

Postby jondaley on Wed Jan 11, 2006 12:51 pm

What mode do you run apache in: perchild, worker, or prefork?
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Postby ayalon on Mon Jan 23, 2006 10:26 am

phunkphorce wrote:What sort of hardware configuration do you have? Are the web server and the mysql server in the same machine? What sort of network card do you have? What sort of network connection? Amoun of memory? Processor?

These things matter too when it comes to performance :)


All machines are apache with mysql 4 installed on the machine itself.

The boxes are: P4 3Ghz with 1gb internal mem.

100mbit networkcard directly connected to backbone internet. Pushing more then 2gig of datatraffic a day.
ayalon
 
Posts: 153
Joined: Thu May 12, 2005 6:39 am

Postby phunkphorce on Mon Jan 23, 2006 4:53 pm

If you look at the output of 'top', what's the average load values of the server(s)?
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa

Postby ayalon on Mon Jan 23, 2006 6:01 pm

phunkphorce wrote:If you look at the output of 'top', what's the average load values of the server(s)?


The average load is between 0,5 and in peak times 2,2...
ayalon
 
Posts: 153
Joined: Thu May 12, 2005 6:39 am

Postby p00lie on Tue Jan 24, 2006 3:26 am

What means "a lot of users and hits". that could be anything :)
1.000 blogs, 10.000 blogs?
p00lie
 

Postby ayalon on Tue Jan 24, 2006 4:07 am

p00lie wrote:What means "a lot of users and hits". that could be anything :)
1.000 blogs, 10.000 blogs?


Here i'm not talking about users in the number of weblogs, but in the number of visitors connecting to the server. This is important for the performance.
ayalon
 
Posts: 153
Joined: Thu May 12, 2005 6:39 am

Postby phunkphorce on Tue Jan 24, 2006 4:45 am

2.2? That's quite a lot! It means that the machine is processing more than twice the load it can handle... 1.0 is maximum you should allow. If the load goes over that, there's something wrong.

Are you sure you haven't noticed any performance issues?
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa

Postby ayalon on Tue Jan 24, 2006 6:07 am

phunkphorce wrote:2.2? That's quite a lot! It means that the machine is processing more than twice the load it can handle... 1.0 is maximum you should allow. If the load goes over that, there's something wrong.

Are you sure you haven't noticed any performance issues?


It depends on the time the server is handling more and if you have performance issues, and because this is not the fact for me, this is perfect!

Or you have suggestions? Maybe other people can also post there details..
ayalon
 
Posts: 153
Joined: Thu May 12, 2005 6:39 am

Postby jondaley on Tue Jan 24, 2006 9:20 am

When you say "average load", do you mean the 1 minute averages, or the 15 minute averages?
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Postby ayalon on Wed Jan 25, 2006 11:35 am

Load goes up and down, load is around 1 at 15 minutes average. But when rss.php is requested it can go up a load!!

This is definetly something you guys have to look at!
ayalon
 
Posts: 153
Joined: Thu May 12, 2005 6:39 am

Postby Astaran on Wed Jan 25, 2006 5:41 pm

Can you provide some details about the server's hardware?
CPU, RAM, discs?
Dedicated or shared server?
Astaran
 
Posts: 23
Joined: Wed Dec 14, 2005 1:07 pm

Postby Rad on Fri Mar 17, 2006 3:14 pm

In httpd.conf, make sure that these modules are commented out:

mod_auth_anon.so
mod_auth_dbm.so
mod_auth_digest.so
mod_mime_magic.so
mod_cern_meta.so
mod_usertrack.so
mod_dav.so
mod_info.so
mod_dav_fs.so
mod_vhost_alias.so
mod_imap.so
mod_userdir.so
mod_proxy.so
mod_proxy_ftp.so
mod_proxy_http.so
mod_proxy_connect.so
Rad
 
Posts: 10
Joined: Mon Feb 20, 2006 5:06 pm

Postby JimW on Fri Mar 17, 2006 5:34 pm

Rad wrote:In httpd.conf, make sure that these modules are commented out...

That's a very interesting list! I went through the Apache documentation on each of them, and you're right - in most cases they're not needed, at least in the servers I'm involved with.

Do you have any data on what's saved by eliminating those from the server configuration?

Jim
JimW
 
Posts: 56
Joined: Thu Jan 05, 2006 1:02 am

Next

Return to Configuration and Installation

cron