Do the upstream PHP servers have to run the same server software?

If I have the following Nginx configuration

 upstream myapp1 {
        server srv1.example.com;
        server srv2.example.com;

Assuming we have shared back-end database and identical web sites, could I use Apache on srv1 and PHP-FPM on srv2 to compare the two under identical real-world load?


No they don't have to run the same software. You can use whatever you want on the backend as long as you are prepared for the differences that may arise.

Your PHP application and how it behaves on different systems plays a big part in whether it will be successful or not. I can imagine some horrible scenario where one exhibits a bug that corrupts records for the other on the shared database and it all ends up a mess, but you will have tested the dual setup all thoroughly in a staging environment first, right?

It might be useful to make the clients 'sticky' while you are doing this so issues any issues are fairly easily attributable to one side or the other.

  • The targeted applications are Joomla and Wordpress. I have checked and many people do successfully run these through PHP-FPM and of course the default Apache, and yes it is being tested. – Johan Jul 23 '14 at 8:54
  • The included sample nginx.conf includes different settigns for apache than it does for FastCGI ... I don't know nginx well enough but these looks to me like I could just use the FastCGI settings for both? – Johan Jul 23 '14 at 8:56
  • Maybe, can you post or link to the sample config? – Matt Jul 23 '14 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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