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

I have a web site, with more than : 500 MySQL queries per second - 2M+ queries per hour. Online users simultany 150+.

The server is always high loaded.

web site built in PHP/MySQL

I already optimized apache, mysql configurations.

My dedicated server config :

Processors 8 : Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz Ram : 12 GB SCSI Harddisk

I want to ask if Memcached is the best solution for this problem, or I have to separate MySQL server from the web server.

Best Regards,

share|improve this question
up vote 3 down vote accepted

I'm not sure if you've necessarily stated a "problem" -- saying "the server is high load" is very much implied when you say there's 500 MySQL queries per second. But that's only a problem if the load is slowing the system down or causing some other problem.

We'd really need more specific information on what your performance is looking like to provide specific recommendations (for instance; how much memory usage for MySQL vs Apache? How about CPU?); it's hard to identify areas to improve if you don't know what resource you're running out of.

However, I do have a guess based on the info you've provided; 500 queries per second for just 150 simultaneous users sounds extremely high; 3.3 queries per user per second? If that's the case, memcached may be a very good choice, to get that load off of the database process (if there's enough repetition in the queries), as well as just trying to get the code to generate a bit less database traffic.

share|improve this answer

Your first step should be to separate the LAMP stack components by moving the apache/php server off off the hardware housing the MySQL instance. You will then have less contention for memory and disk as the RAM space and IO for the application will be hitting different resources than the database.

If you are still not able to manage the load you would next add additional Linux/PHP servers in a horizontal configuration.

I'd recommend installing the Ganglia monitoring program to get a look at where your server is being bottlenecked. As you add more servers, this will help you greatly with capacity planning and scaling your application.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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