Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Apologies for the inexpertly phrased question. I'm not quite sure how to put it.

My Linux server:

  1. Serves web pages to users
  2. Does lots of data processing and gathering in the background

I'd love for (2) not to slow down (1) - for them to be separate somehow. The best way I have found so far is to have both nginx and apache on the server. I have nginx serving the web pages and apache doing the data crunching. I then use CPULIMIT to limit my apache processes to 20% cpu. This keeps them in check somewhat. However, mysql becomes a bottleneck and generally it's a bit messy.

What's standard practice here?


share|improve this question
Generally, data processing should be done on a different box...but that depends on what you're crunching. – Nathan C Jul 25 '13 at 12:04
But don't you get the same problem with the database server being the bottleneck? Both boxes are dealing with data from the same server. Or do you have 2 copies of the database and sync them periodically? – rastaboym Jul 25 '13 at 13:41

As Nathan said, normally you'd separate all of this. If the infrastructure is missing try to increase the priority of your nginx workers: worker_priority

-19 should be a good nice value for your workers. Limiting your Apache to 20% means, that it can never utilize more, even if your nginx is in idle. So using nice should be a much better approach. Basically you tell your OS that this thread always has priority over anything else, but if nginx is idle all the energy is given to your Apache.

Hope this helps.

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.