Welcome! Log In Create A New Profile

Advanced

Re: Nginx good with many simultaneous PHP users?

Reinis Rozitis
May 08, 2012 05:38PM
> Is Nginx+PHP good with potentially many (hundreds or thousands) or
> simultaneous users accessing a lightweight PHP script (does a couple of
> MySQL reads and maybe a write or two)? (users all using the site
> simultaneously but not necessarily that many actually accessing the PHP
> script simultaneously). I'm seeing conflicting answers to this question
> from online research.

In short yes, but to be specific - it depends.

Based on your current setup and the nature of website (distribution between
dynamic and static content) the improvements may be (very) noticeable
especially if you're still using the old prefers in Apache rather any of the
threading MPMs.

The major benefits in my opinion/experience is having more control over the
resources - first of all you spend way less for the static content (Apache
more or less loads the php module/engine for everything).
The fpm manager can also identify/trace (log) slow running script and/or
even forcibly kill them if they exceed the given thresholds (it is pretty
useful if all your code isn't written by yourself) .
Your are also not stuck with figuring out what MaxClients / MinSpareThreads
etc set to satisfy all clients/requests (incoming bursts etc) the fpm has
adaptive spawning and also ability to notify if the configuration settings
are too low.

While it may only still be true with the prefork case (I haven't tested the
latest releases/threading models since went away from Apache 5 years ago)
the permanent fastcgi php processes give you the advantage of using
persistent connections to your backends (mysql, memcache etc) that way
speeding up the web application.



> Also, re: PHP specifically, looks like php-fpm has been absorbed into
> latest PHP 5.4.x so I don't need to explicitly install php-fpm - is that
> correct?

FPM has been merged into php since 5.3.3 (so quite a while ago).


Anyways if you allready have nginx in your infrastucture then plugging in
php for it shouldn't take too much effort. Test it for yourself.


rr

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx good with many simultaneous PHP users?

alexkerr May 08, 2012 01:30PM

Re: Nginx good with many simultaneous PHP users?

Reinis Rozitis May 08, 2012 05:38PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 151
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready