# optimize mysql apache for best performance

**URL:** <https://forums.percona.com/t/optimize-mysql-apache-for-best-performance/3127>\
**Category:** Other MySQL® Questions\
**Created:** [November 29, 2013, 11:46pm UTC](https://forums.percona.com/t/optimize-mysql-apache-for-best-performance/3127 "2013-11-29T23:46:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![harivaag](https://avatars.discourse-cdn.com/v4/letter/h/b5a626/32.png) [@harivaag](https://forums.percona.com/u/harivaag)\
**Post date:** [November 29, 2013, 11:46pm UTC](https://forums.percona.com/t/optimize-mysql-apache-for-best-performance/3127/1 "2013-11-29T23:46:46Z")

</div>

Hi,  
I have a dedicated box in which i run the app and the db server with 16GB memory and below server config  
HP DL 120 G7, Single Proc Quad Core

- Intel Xeon E1220 (1 CPU x 4 Cores)
- 500 GB x 2 SATA Hard Disks on Raid 1
- 16 GB DDRII ECC Registered RAM

I still am not able to spike up my visitors where as just 6 months back the same server was able to show me 15000+ visitors each day and today i am not able to get more then 5000 visitors…

Mysql CPU load spikes at times to 200% and also the load average goes upto 80 at times

i forgot to mention i have myisam and INNODB tables major myisam

below is my.cnf entries  
[mysqld]

local-infile=0  
skip-name-resolve  
max\_connections=400  
low\_priority\_updates=1  
myisam-recover=backup,force  
thread\_concurrency=8  
concurrent\_insert=2  
thread\_cache\_size=48  
max\_allowed\_packet=8M

innodb\_buffer\_pool\_size=512M  
innodb\_additional\_mem\_pool\_size=10M  
innodb\_flush\_method=O\_DIRECT

symbolic-links=0  
socket=/var/lib/mysql/mysql.sock

interactive\_timeout = 100  
connect\_timeout = 60  
wait\_timeout = 60

table\_cache=2048  
table\_definition\_cache =1024  
tmp\_table\_size = 150M  
max\_heap\_table\_size = 150M  
join\_buffer\_size=2M  
read\_buffer\_size=128K  
sort\_buffer\_size=2M  
table\_open\_cache=1024  
read\_rnd\_buffer\_size=256K  
key\_buffer =1G  
max\_allowed\_packet=8M  
max\_connect\_errors=10  
myisam\_sort\_buffer\_size=512M  
query\_cache\_limit=200M  
query\_cache\_size=1G  
query\_cache\_type=1

slow\_query\_log=1  
slow\_query\_log\_file = mysql-slow.log  
long\_query\_time=10  
log-queries-not-using-indexes  
open\_files\_limit=4478  
[mysqldump]  
quick  
max\_allowed\_packet=16M

[mysql]  
no-auto-rehash

[isamchk]  
key\_buffer=128M  
sort\_buffer=128M  
read\_buffer=4M  
write\_buffer=2M

[myisamchk]  
key\_buffer\_size = 128M  
sort\_buffer\_size = 128M  
read\_buffer = 4M  
write\_buffer = 2M

[mysqlhotcopy]  
interactive-timeout

---

<div class="post-metadata">

**Author:** ![przemek](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/przemek/32/3_2.png) [@przemek](https://forums.percona.com/u/przemek)\
**Post date:** [December 3, 2013, 7:21am UTC](https://forums.percona.com/t/optimize-mysql-apache-for-best-performance/3127/2 "2013-12-03T07:21:18Z")

</div>

query\_cache\_size=1G - way too big  
innodb\_buffer\_pool\_size=512M - why so small?

Try to investigate what the MySQL is doing during it’s resource utilization is very high - watch processlist, show engine innodb status, etc.  
Which tables are most used ones, MyISAM or InnoDB? Any reason to have MyISAM at all?
