Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

As my client's php ecommerce portal is on a dedicated hosting but there are certain overload issues. Like the CPU uses goes upto 84% on a 60 req/sec , so i am thinking to propose a plan.

To implement appache at the main server, use varnish & memcached for caching of previous fetched requests from the webserver, NGINX on front of the appache for serving static contents.

Now here as NGINX is redirecting all PHP requests to appache so i am considering to put another tiny but powerfull webserver to server only PHP pages.

The situation comes like when i see appache is on high load so that i can redirect certain requests to other PHP webserver OR I should make appache run only to handle 100 requests/sec and bypass other PHP requests to another PHP webserver.

Also advise me use which server as a robust PHP webserver ?

Kindly correct me if i am wrong. Thank you!

share|improve this question
    
I'm sorry but your question is really unclear. You might want to take some time to reformulate what you intend to do. PHP execution speed is not related to the web server at all, changing to another web server will not make it run faster. –  Martin Fjordvald Jul 23 '10 at 7:27
    
Hi martin, i mean to say is to reduce the load from appache for processing dynamic webpages by redirecting traffic to another tiny server, as NGINX is not a good option for that. –  Zahir Jul 23 '10 at 7:43

1 Answer 1

Before you go messing things up, you need to work out exactly what is hitting the CPU so hard.

  • Is it the database struggling with the load?
  • Is it the PHP processing making Apache chew up the CPU?

If it is the database, it might be worth while in doing some profiling.

  • Are there certain queries that are causing the most load? Can they be done more efficiently?
  • Are some tables causing issue? Are they in need of maintenance?

If it is Apache/PHP, once again profiling may be worth your time

  • Are there certain pages/scripts causing the majority of load?
  • Can they be done more efficiently, such as caching, etc.

Also worth considering is:

  • Just upgrading the hardware to better specs.
  • Move the database to it's own server.
  • Host static content on another server.
share|improve this answer

Your Answer

 
discard

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.