i would make it more like apc - ship with a php file example, but use
RESTful hooks or even raw API that is accessed via php functions
(however that would make it easy for anyone to use, so maybe not.
unless there was a secret "api key" defined somewhere...)
2010/9/17 Jérôme Loyet <ml@fatbsd.com>:
> 2010/9/17 Gints Murāns <gints.murans@gmail.com>:
>> Exelent would be if fpm status page would have some authorization and
>> behind it there should have an option to kill pools. As well status
>> page could show all pools, not just one it is running in.
>
> you're welcome to open a request on bugs.php.net ... and don't forget
> to provide a patch :D
>
> ++ jerome
>
>>
>> On Aug 30, 8:40 pm, Jérôme Loyet <m...@fatbsd.com> wrote:
>>> 2010/8/30 Davy <dcamp...@gmail.com>:
>>>
>>> > Jerome, I like the idea that you had for renaming the processes (this
>>> > makes it similar to nginx too). Do you think this will get merged in
>>> > for the next point release?
>>>
>>> don't know yet. It'll depend on the PHP release schedule which I don't know yet.
>>>
>>>
>>>
>>> > On Aug 20, 1:37 pm, Jérôme Loyet <m...@fatbsd.com> wrote:
>>> >> 2010/8/20 Thomas Fritz <fritz...@gmail.com>:
>>>
>>> >> > 2010/8/20 Jérôme Loyet <m...@fatbsd.com>
>>>
>>> >> >> 2010/8/20 Gints Murāns <gints.mur...@gmail.com>:
>>> >> >> > Yes, I agree that it would solve it. I have a startup script already
>>> >> >> > in mind for this :) I mean command line could look something like
>>> >> >> > this: "/etc/init.d/php-fpmrestart-pool www"
>>>
>>> >> >> I also have in mind changing the processes label. Because every
>>> >> >> process are labeled "php-fpm opt_args" in ps or top outpout. I'd like
>>> >> >> to have
>>>
>>> >> >> php-fpm: master process
>>> >> >> php-fpm: poolwww.foo.bar
>>> >> >> php-fpm: poolwww.foo.bar
>>> >> >> php-fpm: poolwww.foo.bar
>>> >> >> php-fpm: poolwww.domain.com
>>> >> >> php-fpm: poolwww.domain.com
>>> >> >> php-fpm: poolwww.domain.com
>>>
>>> >> > +1 Great!
>>>
>>> >> If some of you can try the following path, it would be great. It
>>> >> changes the process title according to their type:
>>>
>>> >>http://bugs.php.net/52660
>>>
>>> >> PS output sample:
>>> >> 21744 pts/3 S+ 0:00 php-fpm: master process
>>> >> (/usr/local/php-trunk/etc/php-fpm.conf)
>>> >> 21745 pts/3 S+ 0:00 php-fpm: pool www_chroot
>>> >> 21746 pts/3 S+ 0:00 php-fpm: pool www_direct
>>>
>>> >> ++ Jerome
>>>
>>> >> >> it'll help and will be more clear
>>>
>>> >> >> > On Aug 20, 11:15 am, Jérôme Loyet <m...@fatbsd.com> wrote:
>>> >> >> >> 2010/8/20 Thomas Fritz <fritz...@gmail.com>:
>>>
>>> >> >> >> > 2010/8/20 Jérôme Loyet <m...@fatbsd.com>
>>>
>>> >> >> >> >> Hi,
>>>
>>> >> >> >> >> I was thinking about all that.
>>>
>>> >> >> >> >> There is maybe a feature which can help in this case.
>>>
>>> >> >> >> >> what if there is a "pid" directive per pool. In this case FPM will
>>> >> >> >> >> write in this PID file each process PIDs dedicated to a pool. So
>>> >> >> >> >> that,
>>> >> >> >> >> if you want torestarta pool, you'll be able to do it using the
>>> >> >> >> >> kill
>>> >> >> >> >> command.
>>>
>>> >> >> >> >> [global]
>>> >> >> >> >> pid=/var/run/php-fpm.pid ; master process PID
>>> >> >> >> >> ...
>>> >> >> >> >> [www.foo.bar]
>>> >> >> >> >> pid=/home/www/www.foo.bar/logs/php-fpm.pid
>>> >> >> >> >> ...
>>> >> >> >> >> [www.domain.com]
>>> >> >> >> >> pid=/home/www/www.domain.com/logs/php-fpm.pid
>>> >> >> >> >> ...
>>>
>>> >> >> >> >> In /var/run/php-fpm.pid, you'll have only the master process PID.
>>> >> >> >> >> You'll be able to stop/reload everything as usual. Nothing change
>>> >> >> >> >> here.
>>>
>>> >> >> >> > As i understand you: There is a php-fpm reload which only reloads the
>>> >> >> >> > configuration files - does a gracefulrestart?
>>>
>>> >> >> >> yes. man php-fpm tells you about this:
>>>
>>> >> >> >> Once started, php-fpm then responds to several POSIX signals:
>>>
>>> >> >> >> SIGINT,SIGTERM immediate termination
>>> >> >> >> SIGQUIT graceful stop
>>> >> >> >> SIGUSR1 re-open log file
>>> >> >> >> SIGUSR2 graceful reload of all workers + reload of fpm
>>> >> >> >> conf/binary
>>>
>>> >> >> >> >> In /home/www/www.foo.bar/logs/php-fpm.pid, you'll have only the PIDs
>>> >> >> >> >> of the processes dedicated to the poolwww.foo.barusing:
>>>
>>> >> >> >> >> kill `cat /home/www/www.foo.bar/logs/php-fpm.pid`
>>>
>>> >> >> >> > Which will only kill all child processes of that specific pool but
>>> >> >> >> > not the
>>> >> >> >> > "master process" of that pool itself, right?
>>>
>>> >> >> >> yes
>>>
>>> >> >> >> >> The same forwww.domain.combyusing:
>>> >> >> >> >> kill `cat /home/www/www.domain.com/logs/php-fpm.pid`
>>>
>>> >> >> >> >> This will allow processes torestarta pool, to reload php.ini
>>> >> >> >> >> content
>>> >> >> >> >> but it WON'T reload any FPM related conf.
>>>
>>> >> >> >> > As i understand, it WILL reload pool specific php.ini, ENV and other
>>> >> >> >> > configuration values!?
>>>
>>> >> >> >> nope. It will reload the php.ini content (/usr/local/php/lib/php.ini
>>> >> >> >> for example) but it WON'T reload anything present on the php-fpm.conf
>>> >> >> >> (/usr/local/php/etc/php-fpm.conf). To reload the php-fpm.conf you'l
>>> >> >> >> have to reload the master process which willrestartall pool
>>> >> >> >> processes. There is nothing to do about this.
>>>
>>> >> >> >> > If that works that easy and the fpm process recreates its child
>>> >> >> >> > process
>>> >> >> >> > after killing without problems - GREAT!
>>>
>>> >> >> >> it already works that easy. kill by hand all the FPM child processes
>>> >> >> >> and you'll see that they'll be recreated by the master process.. I'm
>>> >> >> >> just proposing to note thoses PID in one file per pool to make
>>> >> >> >> operations easier. That's all.
>>>
>>> >> >> >> >> what do you think ?
>>>
>>> >> >> >> >> ++ jerome
>>>
>>> >> >> >> >> 2010/8/20 Thomas Fritz <fritz...@gmail.com>:
>>> >> >> >> >> > Hi!
>>> >> >> >> >> > If such a graceful reload/restartdoes not disrupt any pool, such
>>> >> >> >> >> > a
>>> >> >> >> >> > graceful
>>> >> >> >> >> > reload/restartof configuration changes in a pool (and i think
>>> >> >> >> >> > thats
>>> >> >> >> >> > most
>>> >> >> >> >> > common use case) is more than sufficient.
>>> >> >> >> >> > But in case a pool hangs ( i do not know if it possible, if it can
>>> >> >> >> >> > happen
>>> >> >> >> >> > and when how php-fpm handles this - i do not know anything from
>>> >> >> >> >> > the
>>> >> >> >> >> > technical design behind php-fpm) arestartof that specific pool
>>> >> >> >> >> > would
>>> >> >> >> >> > be
>>> >> >> >> >> > better. Or is it possible to check for such cases in the graceful
>>> >> >> >> >> >restart
>>> >> >> >> >> > option?
>>> >> >> >> >> > But anyway. php-fpm is great and i am really happy that they
>>> >> >> >> >> > included it
>>> >> >> >> >> > in
>>> >> >> >> >> > 5.3.3 than 5.4! Thank you very much for your hard work!
>>> >> >> >> >> > Kind regards
>>>
>>> >> >> >> >> > ---
>>> >> >> >> >> > Thomas FRITZ
>>> >> >> >> >> > web http://fritzthomas.com
>>> >> >> >> >> > twitter http://twitter.com/thomasf
>>>
>>> >> >> >> >> > 2010/8/19 Jérôme Loyet <m...@fatbsd.com>
>>>
>>> >> >> >> >> >> 2010/8/19 iain wright <iainw...@usc.edu>:
>>> >> >> >> >> >> > Agreed, we are close to deploying 8 CMS sites on a new server
>>> >> >> >> >> >> > each
>>> >> >> >> >> >> > running
>>> >> >> >> >> >> > in its own php-fpm pool, seems silly to have torestartall of
>>> >> >> >> >> >> > them
>>> >> >> >> >> >> > if
>>> >> >> >> >> >> > something happened to 1 site.
>>>
>>> >> >> >> >> >> it's definetely not possible by design. If you really want to
>>> >> >> >> >> >> separate
>>> >> >> >> >> >> each site, launch 8 instances of FPM with only one pool each. But
>>> >> >> >> >> >> it
>>> >> >> >> >> >> would not be that *beautiful*. With the include feature on the
>>> >> >> >> >> >> fpm
>>> >> >> >> >> >> conf file, you can share values between differents FPM conf
>>> >> >> >> >> >> files.
>>>
>>> >> >> >> >> >> > That being said, phpfpm has worked like a charm and I love it.
>>>
>>> >> >> >> >> >> Love to hear that :)
>>>
>>> >> >> >> >> >> > Iain Wright
>>> >> >> >> >> >> > LAN Administrator - CBIS
>>> >> >> >> >> >> > USC Clinical Translational Science Institute
>>>
>>> >> >> >> >> >> > On Thu, Aug 19, 2010 at 8:43 AM, Diemuzi <diem...@gmail.com>
>>> >> >> >> >> >> > wrote:
>>>
>>> >> >> >> >> >> >> Changing per pool values is a big part for me. I would rather
>>> >> >> >> >> >> >>restart
>>> >> >> >> >> >> >> only the pool I changed the values in so that I do not
>>> >> >> >> >> >> >> possibly
>>> >> >> >> >> >> >> disrupt the other pools running.
>>>
>>> >> >> >> >> >> >> On Jul 30, 5:38 pm, Gints Murāns <gints.mur....@gmail.com>
>>> >> >> >> >> >> >> wrote:
>>> >> >> >> >> >> >> > What happens with other pools when one of the pools have
>>> >> >> >> >> >> >> > gateway
>>> >> >> >> >> >> >> > timeout? I mean when there is some long script running, that
>>> >> >> >> >> >> >> > takes
>>> >> >> >> >> >> >> > up
>>> >> >> >> >> >> >> > all the pool resources. I guess that would have to affect
>>> >> >> >> >> >> >> > other
>>> >> >> >> >> >> >> > pools.
>>> >> >> >> >> >> >> > So I want torestartthis one, why should I those others?
>>> >> >> >> >> >> >> > Especially
>>> >> >> >> >> >> >> > when there is a lot of webpages and a lot of pools.
>>>
>>> >> >> >> >> >> >> > On Jul 26, 9:35 pm, Jérôme Loyet <m....@fatbsd.com> wrote:
>>>
>>> >> >> >> >> >> >> > > 2010/7/26 GM <g...@gm.lv>:
>>>
>>> >> >> >> >> >> >> > > > I would like to know that too.
>>>
>>> >> >> >> >> >> >> > > can you describe why you want that ? what is the need ?
>>> >> >> >> >> >> >> > > Before
>>> >> >> >> >> >> >> > > coding
>>> >> >> >> >> >> >> > > anything I'd like to be sure the solution is the right
>>> >> >> >> >> >> >> > > one.
>>>
>>> >> >> >> >> >> >> > > > On Jul 25, 12:44 pm, Thomas Fritz <fritz....@gmail.com>
>>> >> >> >> >> >> >> > > > wrote:
>>> >> >> >> >> >> >> > > >> I think i can remember that i have somewhere read about
>>> >> >> >> >> >> >> > > >> that
>>> >> >> >> >> >> >> > > >> feature or
>>> >> >> >> >> >> >> > > >> feature wish!
>>> >> >> >> >> >> >> > > >> Is it possible torestartonly a specific pool and not
>>> >> >> >> >> >> >> > > >> the
>>> >> >> >> >> >> >> > > >> whole
>>> >> >> >> >> >> >> > > >> FPM? Is it
>>> >> >> >> >> >> >> > > >> planned to support that?
>>>
>>> >> >> >> >> >> >> > > >> Thanks
>>>
>>> >> >> >> >> >> >> > > >> Kind regards
>>>
>>> >> >> >> >> >> >> > > >> ---
>>>
>>> >> >> >> >> >> >> > > >> *Thomas FRITZ*
>>> >> >> >> >> >> >> > > >> *web*http://fritzthomas.com
>>> >> >> >> >> >> >> > > >> *twitter*http://twitter.com/thomasf
>>>
>>> >> >> >> > --
>>>
>>> >> >> >> > ---
>>> >> >> >> > Thomas FRITZ
>>> >> >> >> > webhttp://fritzthomas.com
>>> >> >> >> > twitterhttp://twitter.com/thomasf
>>>
>>> >> > --
>>>
>>> >> > ---
>>> >> > Thomas FRITZ
>>> >> > webhttp://fritzthomas.com
>>> >> > twitterhttp://twitter.com/thomasf
>>>
>>>
>>
>