Req #54098 [Asn]: Overly high defaults in config
| From: | marco at mimecom dot net | Date: | Fri, 25 Feb 2011 07:25:13 +0000 |
| Subject: | Req #54098 [Asn]: Overly high defaults in config | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-159035@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=54098&edit=1
ID: 54098
User updated by: marco at mimecom dot net
Reported by: marco at mimecom dot net
Summary: Overly high defaults in config
Status: Assigned
Type: Feature/Change Request
Package: FPM related
Operating System: Linux
PHP Version: trunk-SVN-2011-02-25 (SVN)
Assigned To: fat
Block user comment: N
Private report: N
New Comment:
Well, since the configuration is active - not commented out - I'd say it
is
pretty much a default. A default make install would run with this
configuration
without modifications. You are right that my statement of there being a
lot of
1Gb servers out there is taken out of the air - but I run a few (and two
with
512Mb - still snappy), I know they are cheap (and it gets pretty
expensive when
you try to run larger servers) so it's just my *suspicion* that they are
common.
In any case, since the settings effectively are a default per above, I'd
much
rather see the software underperform than bring servers down. One way to
fix it
would be to comment out that setting and not let php-fpm start unless
you go
configuring yourself. But do mention in that comment to crosscheck with
php's
memory setting. It took a giant jump from a default 16M to 128M, which
is why I
think these settings kill servers. Before, at 16M, 50 was actually
great.
P.S. I don't really know what prompted that jump above, but it's not my
concern... I guess there were reasons for it.
Previous Comments:
------------------------------------------------------------------------
[2011-02-25 08:05:19] fat@php.net
It's not a bug it a feature ;)
The subject will be discussed with other dev soon. I'll keep you
updated.
For me, default value, especialy those one should not be called "default
value",
but "exemple values". Saying that FPM is widely used in VPS with 512Mb
of RAM is
just a wrong assumption. As saying that FPM is widely used with physical
servers
with 12Gb of RAM. It depends on the server on which FPM runs but on the
code
itself. At the end, the sysadm is the only one who can set the right
values.
So if 50 is too high for some, they will lower it to 6. For others 50
will be
too low and they will higher it to 200 or whatever.
From my point of vue, 50 is maybe quite too high, but the proposed value
are too
low. If you really want to lower the max and still use the dynamic PM,
we can
set:
pm.max_children = 10
;pm.start_servers = 2
;pm.min_spare_servers = 1
;pm.max_spare_servers = 4
------------------------------------------------------------------------
[2011-02-25 05:56:06] marco at mimecom dot net
Description:
------------
The default setting in the pool sets pm.max_children to 50, which with
php's
upped default memory_limit of 128Mb makes many moderately equipped
machines to
crash from out-of-memory. The settings combined makes it possible to
consume
6GB of memory in a bad scenario. Since I suspect many a server nowadays
are 1Gb
(or even 512Mb) VPS's running on the different clouds out there, the
settings
are grossly excessive. I reported a bug against Ubuntu at first, but I
think
this is really the right place for it.
https://bugs.launchpad.net/ubuntu/+source/php5/+bug/723480
pm.max_children should be more like 6 initially, with an explanation to
increase
the number if memory permits. Ether that or the default memory_limit
should be
lowered.
I have read posts about running VPS where operators have to reboot every
so
often, and I think it *might* have to do with this problem, since I'm
sure
nginx+php+php-fpm is getting very popular as a stack.
Expected result:
----------------
Snappy happy server.
Actual result:
--------------
Server get sad, wrinkles, get dementia, finally get a stroke and dies.
Takes as
long time as it took my mother but in computer-years.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=54098&edit=1