Welcome! Log In Create A New Profile

Advanced

php-fpm + apache2 + mod_fascgi (or mod_fgi)

Posted by Nikolas Hagelstein 
Nikolas Hagelstein
php-fpm + apache2 + mod_fascgi (or mod_fgi)
October 26, 2009 08:42PM
Hi,

Has anybody php-fpm + mod_fastcgi running and is willing to share the
configuration?
I recently tried to make it work with ispcp but without any success.

Cheers,
Nikolas
Re: php-fpm + apache2 + mod_fascgi (or mod_fgi)
October 26, 2009 08:50PM
it shouldn't make any difference, you should just pass on things via
the ip:port tcp or unix socket.


On Mon, Oct 26, 2009 at 5:36 PM, Nikolas Hagelstein
<nikolas.hagelstein@googlemail.com> wrote:
>
> Hi,
>
> Has anybody php-fpm + mod_fastcgi running and is willing to share the
> configuration?
> I recently tried to make it work with ispcp but without any success.
>
> Cheers,
> Nikolas
>
Nikolas Hagelstein
Re: php-fpm + apache2 + mod_fascgi (or mod_fgi)
November 09, 2009 04:48PM
Ok, i finally got it running.
But i am still not sure what exactly should be the main advantage of
using php-fpm over fastcgi+wrapper script in regard to memory
consumption and pm.

If i got it right php-fpm works as follows:
It pulls up a set of php pools each consisting of n worker childs
(max_children).
So if i got 5 pools each having max_children set to 8 php-fpm will
come up with 40 threads statically.
These threads will exist the whole time no matter if they are needed
(load depending) or not.

I could archive a way better resource handling using plain mod_fastcgi
and a wrapper script since i could have fastcgi starting master
workers on demand and having them killed if they arent needed anymore.

Don'T get me wrong i am not flaming i just don't see the major benefit
(in regard to memory consumption and processmanagment).

Could anyone please enlight me?

Regards,
NIkolas
Re: php-fpm + apache2 + mod_fascgi (or mod_fgi)
November 09, 2009 05:14PM
If you create that, I am all for checking it out. That would be neat.

I would encourage you to share it with the world :)


On Mon, Nov 9, 2009 at 1:46 PM, Nikolas Hagelstein
<nikolas.hagelstein@googlemail.com> wrote:
>
> Ok, i finally got it running.
> But i am still not sure what exactly should be the main advantage of
> using php-fpm over fastcgi+wrapper script in regard to memory
> consumption and pm.
>
> If i got it right php-fpm works as follows:
> It pulls up a set of php pools each consisting of  n worker childs
> (max_children).
> So if i got 5 pools each having max_children set to 8 php-fpm will
> come up with 40 threads statically.
> These threads will exist the whole time no matter if they are needed
> (load depending) or not.
>
> I could archive a way better resource handling using plain mod_fastcgi
> and a wrapper script since i could have fastcgi starting master
> workers on demand and having them killed if they arent needed anymore.
>
> Don'T get me wrong i am not flaming i just don't see the major benefit
> (in regard to memory consumption and processmanagment).
>
> Could anyone please enlight me?
>
> Regards,
> NIkolas
Gordon Pettey
Re: php-fpm + apache2 + mod_fascgi (or mod_fgi)
November 09, 2009 05:20PM
It is a valid point... is there a timeline for the "apache-style"
management mentioned in the config file? Until then, what benefit does
php-fpm provide over the "old" wrappers like spawn-fcgi?
Nikolas Hagelstein
Re: php-fpm + apache2 + mod_fascgi (or mod_fgi)
November 09, 2009 05:20PM
Hi.
> If you create that, I am all for checking it out. That would be neat.
> I would encourage you to share it with the world :)
What exactly are you refering to? Using mod_fastcgi with php-fpm or
the way i usually configure mod_fastcgi in order to have at least a
little of load depending process managment?
bye,
Nikolas
Nikolas Hagelstein
Re: php-fpm + apache2 + mod_fascgi (or mod_fgi)
November 09, 2009 05:28PM
Hi,
> It is a valid point... is there a timeline for the "apache-style"
> management mentioned in the config file? Until then, what benefit does
> php-fpm provide over the "old" wrappers like spawn-fcgi?
I am not an expert on lighty or nginx. But i would assume that
"spawn-fcgi" works very similar to apaches mod_fastcgi wrapper
scripts. From that point of view the only benefit i see is the fact
that you are able to restart a single pool.
Another point might be (not sure about that) the way php-fpm handles
shared memory. Using any kind of wrapper script shared memory is only
share between the master php process and its PHP_FCGI_CHILDREN. Since
moste opcode caches (xcache, apc eaccelerator etc.) use shared memory
this fact may result in ineffective opcode usage. Perhaps php enalbes
all "children" to access one shared memory area. Though you would pay
for this having a bunch of statically running php processes eating
your memory ;).

Regards,
Nikolas
Re: php-fpm + apache2 + mod_fascgi (or mod_fgi)
November 09, 2009 05:32PM
one single config file and a stateful daemon with per-pool overrides,
etc... vs. having to make your own init script that spawns spawn-fcgi
for each pool you want.

and a couple other enhancements to do with fastcgi functionality

On Mon, Nov 9, 2009 at 2:18 PM, Gordon Pettey <petteyg359@gmail.com> wrote:
>
> It is a valid point... is there a timeline for the "apache-style"
> management mentioned in the config file? Until then, what benefit does
> php-fpm provide over the "old" wrappers like spawn-fcgi?
>
Re: php-fpm + apache2 + mod_fascgi (or mod_fgi)
December 02, 2010 07:20AM
One must think about the application at hand and not make blanket
statements about this or that. Obviously, as noted above, anything
that needs write access to the server disk will need to be owned by
the user who is running apache. WebDAV would clearly be one of those
cases, while hosting a web site would not.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 194
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready