Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
How do you do Load Testing and Capacity Planning for Web Sites

Let me refine my questions:
1. How can I improve MySQL performance?
2. Will adding more RAMs help?
3. Will server 1 (details below) get bogged down even with more RAMs?

My setup:
Server 1 - Dual-core Xeon, 1GB RAM (max 8GB), LAMP (as image cdn server, not really using the M part)
Server 2 - Quad-core Xeon, 8GB (max 24GB), LAMP (as main server, AMP running exclusively on this server)

Current situation:
Server 1 (top command) - rather free, not much happening, CPU utilization is idle most of the time
Server 2 (top command) - heavily loaded with MySQL (where mysqld can take 100-175% CPU utilization easily)

My plan is to do primitive MySQL load balancing between the two servers (edit PHP and channel say 40% of mysql queries to Server 1).

share|improve this question

marked as duplicate by Ward, Wesley, Khaled, Iain May 14 '12 at 7:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

100-175% CPU on a 4 core machine isn't necessarily an issue. Performance improvement has to follow this process,

  1. Baseline - know what your performance stats are with a given workload, in fact, with several well defined workloads (i.e. 0 connections, 100 connections, 10 queries, 5 users, whatever makes sense).
  2. Change - make a change, there are many tuning options for mysql which you need to read up on, mostly around cache sizes.
  3. Re-baseline - after making the changes, rerun your tests to see how it behaves now.

There's no magic bullet with performance tuning, especially when you don't tell us anything about your application.

share|improve this answer
My application is my own custom cms and a wordpress blog. Actually your #1 makes sense. I will do a study on my server's baseline performance to see if that is expected (as you mentioned 100-175% on quad-core is not to be alarmed). – mohdyusuf May 14 '12 at 14:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.