I am trying to install php with fpm on macports. I read somewhere that fpm means FastCGI process manager. Does that mean fastcgi and fpm are same? If they are same, then why do we have two different macports variants for php namely "php5 +fastcgi" and "php5 +fpm"
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
What Anthony says is absolutely correct, but I'd like to add that your experience will likely show a lot better performance and efficiency (due not to
fpm
-vs-fcgi
but more to the implementation of yourhttpd
).For example, I had a quad-core machine running
lighttpd
+fcgi
humming along nicely. I upgraded to a 16-core machine to cope with growth, and two things exploded: RAM usage, and segfaults. I found myself restartinglighttpd
every 30 minutes to keep the website up.I switched to php-fpm and nginx, and RAM usage dropped from >20GB to 2GB. Segfaults disappeared as well. After doing some research, I learned that lighttpd and fcgi don't get along well on multi-core machines under load, and also have memory leak issues in certain instances.
Is this due to
php-fpm
being better thanfcgi
? Not entirely, but how you hook intophp-fpm
seems to be a whole heckuva lot more efficient than how you serve viafcgi
.FPM is a process manager to manage the FastCGI SAPI (Server API) in PHP.
Basically, it replaces the need for something like SpawnFCGI. It spawns the FastCGI children adaptively (meaning launching more if the current load requires it).
Otherwise, there's not much operating difference between it and FastCGI (The request pipeline from start of request to end is the same). It's just there to make implementing it easier.