mike_r

Well-Known Member
Nov 26, 2002
45
0
156
Hey,

I need some help with optimization of Apache & mySQL as sometimes my server load gets upto 1.30+.

Average it remains 0.40+...

I have already optimized my.cnf file by replacing the default my.cnf with the my-huge.cnf file. I had to optimize mySQL because a site that has a mysql db of over 650 mb caused the average load to be 1.30+..

:: MY SERVER SPECS ::
Intel P4 2.4 Ghz
1 GB ECC DDRAM

----------- MY . CNF FILE --------------------

port = 3306
socket = /var/lib/mysql/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 384M
max_allowed_packet = 1M
table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8

# Replication Master Server (default)
# binary logging is required for replication
log-bin

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

-------------------- END MY . CNF FILE -----------

And From HTTPD.CONF :::

TimeOut 300
KeepAlive On
MaxKeepAliveRequests 500
KeepAliveTimeout 10

MinSpareServers 32
MaxSpareServers 64

StartServers 5
MaxClients 256
MaxRequestsPerChild 0

Sugesstions? Please do let me know..

BTW, I have also installed PHPAccelerator and Mod_Gzip and the site loads fast now, but the server load is still the same.
 
Last edited:

mike_r

Well-Known Member
Nov 26, 2002
45
0
156
That query cache is already enabled and so it didn't helped much. And also my query cache was already optimized for best results.

Thanks for sharing though. Any more ideas?
 

mike_r

Well-Known Member
Nov 26, 2002
45
0
156
I also see leechprotect running sometimes. and exim also takes much resources.

But httpd and mysql takes the most. Need help with them
 

mike_r

Well-Known Member
Nov 26, 2002
45
0
156
Its now started to get upto 2.50 sincei installed phpaccelerator and mod_gzip..

I know its not due to them but increasing hits. HELP ME ...:(
 

mike_r

Well-Known Member
Nov 26, 2002
45
0
156
there is a forum hosted on the server that used about 50 gb transfer with all plain content and very less images.

So you can imagine how many hits that forum gets?? 50 gb transfer in 23 days..

Now the load sometiems spikes to 9 and server reboots are often now..

Help please :( ..
 

mosaicsites

Member
Jun 30, 2004
5
0
151
*bump*

You need a faster server.

mod_gzip will not reduce cpu load, only increase it, because of the extra work the server has to do to compress the data before it is sent.

mod_gzip will reduce your bandwidth use some, though.