views:

33

answers:

2

I have a dedicated server that hosts about 70 domains... some are just plain php static websites, others are wordpress websites and a few others are on ruby on rails.

In the past few days I have experienced very slow queries on mysql server...

Queries like:
SELECT * FROM users WHERE id = 5
takes 1.8 secs...

I enabled the slow queries log and found that all the wordpress sites dont have their databases indexed... i dont know if this is the cause of my problem.....

So the question is should i install different mysql servers for wordpress websites and ruby based websites? Or just a little tunning to the my.cnf file will do?

+1  A: 

Well considering that you are not augmenting the hardware. I belive installing instance servers or even installing Virtual servers would not help you. You should really try tuning the databases and adding valuable indicies where necessary.

John Hartsock
If he has IO bottleneck then probably adding another hdd and moving some of databases there would help.
zerkms
@zerkms - Excelent point
John Hartsock
How can i move the databases to another hdd ?
Will
If it is MyISAM (i bet it is) - then you can just move database datafiles to another partition and create symlinks back to the original location. but before this i think more deep research should be done. At least you have to make sure that the trouble is in IO (with help of `iostat` for example).
zerkms
A: 

Use a second server for your DB. That way your 70 sites' ruby & php scripts aren't fighting mysql for disk io and mysql can take better advantage of caching.

Entendu