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

I Asked this question on stackoverflow and was told you guys may have more advise, so at work we have been assigned an additional server because the load for our current server is to much.

What I want to do now is have all my PHP Scripts on one Server ( Server 1) ran from another (server 2) to allow less stress on (server 1).A load Balancer has been suggested and I have had a look at DNS Clusters, my main aim is for when a user logs onto the domain at server 1 he could be on server 2 IP address if that is possible?

What's the right direction as to what I should be doing?

share|improve this question
1  
First, figure out where the performance problem is. – Michael Hampton Oct 2 '12 at 13:12
From the Server statistics it would suggest that the CPU is maxing out,also there is a mysql database being used which tends to clog up when alot of queries are made from different users and different processes running on the server – James Oct 2 '12 at 13:23
1  
If it's just that MySQL is taking up lots of CPU, you could just throw it on the second machine. You probably need to do that anyway. But I would do a bit more detailed analysis and figure out exactly what's going on. – Michael Hampton Oct 2 '12 at 13:24
I have noticed alot of CPU being taken up by scripts that have been running for a while and so stopping simple tasks as emails from server going out, which i am concerned about and im wondering if i split these tasks between servers it may ease the stress on server 1 ? – James Oct 2 '12 at 13:38
2  
Sorry, but I have to agree with Michael. Throwing resources at an unknown "Performance Problem" is asking for more problems. You really need to profile the code and figure out where the bottlenecks are, if there's inefficient code, miscellaneous bugs or other problems. I have a strong inclination that just throwing the same thing on two servers will result in two "overloaded" servers instead of one. – Chris S Oct 2 '12 at 13:49
show 3 more comments

closed as not a real question by Michael Hampton, Iain Oct 2 '12 at 13:53

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

1 Answer

One possible idea would be to run PHP as an FCGI-sevice. You can run multiple PHP (or just a single for all PHP scripts) instances on Server A and then create vHosts on server B with all the assets and an FCGI connection. The Server A would do all the calulationg for output and Server B would only do the serving.

Another possibility is to run a full webserver (like Apache) on Server A and put a lightweight server as areverse proxy (like nginx) on server A to take care of all assets and caching.

share|improve this answer

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