Req #49616 [Com]: Impossible to increase SOMAXCONN
| From: | jack dot chuong at itlvn dot com | Date: | Wed, 27 Aug 2014 09:16:31 +0000 |
| Subject: | Req #49616 [Com]: Impossible to increase SOMAXCONN | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-187290@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=49616&edit=1
ID: 49616
Comment by: jack dot chuong at itlvn dot com
Reported by: ben at realitychecknetwork dot com
Summary: Impossible to increase SOMAXCONN
Status: Closed
Type: Feature/Change Request
Package: Feature/Change Request
Operating System: Linux 2.6.18
PHP Version: 5.2.11
Block user comment: N
Private report: N
New Comment:
I'm trying to compile php 5.5.16 on Centos 6.4 64 bit to increase SOMAXCONN
After add to file:
/usr/include/linux/socket.h
#define SOMAXCONN 256
cat /proc/sys/net/core/somaxconn
256
cat test.php
<?php
echo SOMAXCONN;
?>
php test.php
128
Previous Comments:
------------------------------------------------------------------------
[2009-09-23 03:12:48] ben at realitychecknetwork dot com
In CentOS5.3 its actually : /usr/include/linux/socket.h
Thanks, that did the trick.
Replace:
/* Maximum queue length specifiable by listen. */
#define SOMAXCONN 128
With:
/* Maximum queue length specifiable by listen. */
#define SOMAXCONN 2048
Then recompile PHP
------------------------------------------------------------------------
[2009-09-22 09:38:30] sjoerd@php.net
PHP uses the SOMAXCONN from sys/socket.h at compile time.
------------------------------------------------------------------------
[2009-09-21 20:22:24] ben at realitychecknetwork dot com
Description:
------------
Impossible to increase SOMAXCONN value by updating system OS variable. PHP must be compiled with
--enable-sockets for this bug to be produced.
OS setting updated with:
# sysctl -w net.core.somaxconn=2048
net.core.somaxconn = 2048
PHP will always return 128 for SOMAXCONN and will not respect the OS setting. Additionally, it will
ignore a define statement in PHP code and return 128 as well.
Reproduce code:
---------------
define("SOMAXCONN", 2048);
echo SOMAXCONN;
Expected result:
----------------
Should return 2048
Actual result:
--------------
Returns 128
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=49616&edit=1