Sunday, March 20, 2011

Scaling myVidster Part 3: Apache + PHP-FPM

Recently I decided to upgrade my servers so that myVidster can keep up with its growing traffic. I also decided to implement PHP-FPM to fix an issue with my APC setup discussed in Scaling myVidster Part 2.

Before the upgrade my setup was Apache +  MOD_FASTCGI + APC.  I did not have any issues with server performance but the APC host would restart every 2 hours.  This concern me because the cache would have to warm back up (rebuild) and during high traffic this could cause a bottle neck.  With that in mind I decided to add PHP-FPM to my setup.

I follow the setup instructions posted here and got PHP-FPM setup with only a few headaches.  My biggest learning was recompiling MOD_FASTCGI.  His steps are for a DSO install and I decided to go with a static library instead because I have done it before and was succesful.  After I recompiled PHP with PHP-FPM, I tried to use my old static library copy of MOD_FASTCGI which caused my server to fail.  To solve this I had to recompile the static library.

Also the default settings in the php-fpm.conf could not handle the traffic.  For those who use PHP-FPM here are my settings.

pm.max_children = 225
pm.start_servers = 60
pm.min_spare_servers = 40
pm.max_spare_servers = 80
pm.max_requests = 500

I am still getting the '[pool www] seems busy' warnings once in a while, so I might increase these values.

My new setup is Apache +  MOD_FASTCGI + PHP-FPM + APC and have been running this setup for the past 2 days.  My first impression is that I love this setup!  PHP-FPM gives you more control on how your server executes php scripts and the APC host no longer restarts every 2 hours.  As for performance I did not execute any benchmarks but I did notice faster and more responsive page loading.  I will also like to note that the Apache + PHP-FPM setup is not too common and most people use Nginx instead.  Right now no one has published any benchmark data comparing the two setups.  So for now go for what works for you and your visitors!

4 comments:

Bruno Araujo said...

What can you say about this software https://cellspyapps.org/how-to-hack-an-iphone/? Did you try some of them?

ninja said...

https://kodi.software/
https://plex.software/
https://luckypatcher.pro/ Thanks for sharing.I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more posts like this one.

Aswin said...

Hello there. I found your web site by the use of Google at the same time as searching for a comparable subject, your site came up. It seems great. I have bookmarked it in my google bookmarks to come back then.

Acupressure Care ProductsPersonal Care ProductsPersonal Care Products Shops in ChennaiAcupressure Care ProductsPersonal Care ProductsPersonal Care Products Shops in ChennaiAcupressure Care Products in ChennaiAcupressure Care Products in IndiaBuy Acupressure Care Products OnlineAcupressure Care Products PricesAcupuncture Needle Shops in Chennai
Acupuncture Needle Prices in ChennaiBuy Acupuncture Needle Online in IndiaAcupuncture NeedlesAcupuncture Needle Products in Chennai
Acupuncture Ring in ChennaiBuy Acupuncture Ring Acupuncture Ring IndiaAcupuncture Ring ShopsAcupressure Foot Roller ShopsAcupressure Mat Shops in ChennaiAcupressure Mat Shops in IndiaSpine Massager in ChennaiBuy Spine Massager Online in India

creditcard login said...

creditcard login

credit card login: A mainstream physical retail goal, and also a go-to goal for on the web and application customers — works 1,100 retail chains in 49 states.