Welcome! Log In Create A New Profile

Advanced

(11: Resource temporarily unavailable) while connecting to upstream

Posted by tachu 
I'm trying to migrate my platform from lighttpd and spawn-fcgi to
nginx and php-fpm. I've setup a very basic config on nginx and php-fpm
my server handles about 120r/s all php calls I've been trying to use a
unix socket because i heard that they are faster than using the
loopback device. I keep getting (11: Resource temporarily unavailable)
while connecting to upstream as soon as i turn on the traffic to it.
the load on the server is about 1 and its an 8 core machine that under
lighttpd responds fine at a load of 9. memory is not an issue as i
only use about 3gb of the 8 it has available.
on lighttpd and spawn i also use unix sockets and spawn cgi

fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/tmp/php-fastcgi" +
PID + ".socket",
"bin-path" => "/usr/bin/php-cgi",
"max-procs" => 50,
"min-procs" => 5,
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "2",
"PHP_FCGI_MAX_REQUESTS" =>
"15000")
)
)
)


Here are my configs
nginx.conf
user nginx;
worker_processes 8;
worker_rlimit_nofile 8192;
error_log /var/log/nginx/error.log debug;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;

pid /var/run/nginx.pid;
events {
worker_connections 8192;
use epoll;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local]
$request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

# Load config files from the /etc/nginx/conf.d directory

#
# The default server
#
server {
listen 80;
server_name _;

#charset koi8-r;
root /var/www/html;

#access_log logs/host.access.log main;

location / {
index robots.txt;
}

error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

location ~ / {
deny all;
}
location = /robots.txt {
allow all;
}
}
include /etc/nginx/conf.d/*.conf;
}


server {
listen 80;
server_name blah.example.com;
root /var/www/aq/html;
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/dev/shm/php-fpm.socket.0;
}
location / {
index index.php;
}
}



<?xml version="1.0" ?>
<configuration>
<section name="global_options">
<value name="pid_file">/var/run/php-fpm.pid</value>
<value name="error_log">/var/log/php-fpm.log</value>
<value name="log_level">debug</value>
<value name="emergency_restart_threshold">10</value>
<value name="emergency_restart_interval">1m</value>
<value name="process_control_timeout">5s</value>
<value name="daemonize">yes</value>
</section>
<workers>
<section name="pool">
<value name="name">aq</value>
<value name="listen_address">/dev/shm/php-fpm.socket.0</value>
<value name="listen_options">
<value name="backlog">-1</value>
<value name="owner">nginx</value>
<value name="group">nginx</value>
<value name="mode">0666</value>
</value>
<value name="php_defines">
<value name="display_errors">0</value>
</value>
<value name="user">nginx</value>
<value name="group">nginx</value>
<value name="pm">
<value name="style">static</value>
<value name="max_children">200</value>
<value name="apache_like">
<value name="StartServers">20</value>
<value name="MinSpareServers">5</value>
<value name="MaxSpareServers">35</value>
</value>
</value>
<value name="request_terminate_timeout">30s</value>
<value name="request_slowlog_timeout">5s</value>
<value name="slowlog">/var/log/slow.log</value>
<value name="rlimit_files">16384</value>
<value name="rlimit_core">0</value>
<value name="chroot"></value>
<value name="chdir"></value>
<value name="catch_workers_output">yes</value>
<value name="max_requests">1500</value>
<value name="allowed_clients">127.0.0.1</value>
<value name="environment">
<value name="HOSTNAME">$HOSTNAME</value>
<value name="PATH">/usr/local/bin:/usr/bin:/bin</value>
<value name="TMP">/tmp</value>
<value name="TMPDIR">/tmp</value>
<value name="TEMP">/tmp</value>
<value name="OSTYPE">$OSTYPE</value>
<value name="MACHTYPE">$MACHTYPE</value>
<value name="MALLOC_CHECK_">2</value>
</value>
</section>
</workers>
</configuration>
Re: (11: Resource temporarily unavailable) while connecting to upstream
December 17, 2009 09:10PM
I am fighting a cold and can't seem to get a handle on it and can't
concentrate but a couple things I notice...

<value name="max_children">200</value> = PHP_FCGI_CHILDREN
i'd set that to 50, not 200

<value name="max_requests">1500</value> = PHP_FCGI_MAX_REQUESTS
you used to have 15000. i'd set it to 500



On Thu, Dec 17, 2009 at 5:07 PM, tachu <tachu1@gmail.com> wrote:
> I'm trying to migrate my platform from lighttpd and spawn-fcgi to
> nginx and php-fpm. I've setup a very basic config on nginx and php-fpm
> my server handles about 120r/s all php calls I've been trying to use a
> unix socket because i heard that they are faster than using the
> loopback device. I keep getting (11: Resource temporarily unavailable)
> while connecting to upstream as soon as i turn on the traffic to it.
> the load on the server is about 1 and its an 8 core machine that under
> lighttpd responds fine at a load of 9. memory is not an issue as i
> only use about 3gb of the 8 it has available.
>  on lighttpd and spawn i also use unix sockets and spawn cgi
>
> fastcgi.server             = ( ".php" =>
>                               ( "localhost" =>
>                                 (
>                                   "socket" => "/tmp/php-fastcgi" +
> PID + ".socket",
>                                   "bin-path" => "/usr/bin/php-cgi",
>                                   "max-procs" => 50,
>                                   "min-procs" => 5,
>                                   "bin-environment" => (
>                                        "PHP_FCGI_CHILDREN" => "2",
>                                        "PHP_FCGI_MAX_REQUESTS" =>
> "15000")
>                                 )
>                               )
>                            )
>
>
> Here are my configs
> nginx.conf
> user              nginx;
> worker_processes  8;
> worker_rlimit_nofile 8192;
> error_log         /var/log/nginx/error.log debug;
> #error_log        /var/log/nginx/error.log  notice;
> #error_log        /var/log/nginx/error.log  info;
>
> pid               /var/run/nginx.pid;
> events {
>    worker_connections  8192;
>    use epoll;
> }
>
> http {
>    include       /etc/nginx/mime.types;
>    default_type  application/octet-stream;
>    log_format  main  '$remote_addr - $remote_user [$time_local]
> $request '
>                      '"$status" $body_bytes_sent "$http_referer" '
>                      '"$http_user_agent" "$http_x_forwarded_for"';
>    access_log  /var/log/nginx/access.log  main;
>
>    sendfile        on;
>    #tcp_nopush     on;
>
>    #keepalive_timeout  0;
>    keepalive_timeout  65;
>
>    #gzip  on;
>
>    # Load config files from the /etc/nginx/conf.d directory
>
>    #
>    # The default server
>    #
>    server {
>        listen       80;
>        server_name  _;
>
>        #charset koi8-r;
>        root   /var/www/html;
>
>        #access_log  logs/host.access.log  main;
>
>        location / {
>            index  robots.txt;
>        }
>
>        error_page  404              /404.html;
>        location = /404.html {
>            root   /usr/share/nginx/html;
>        }
>
>        # redirect server error pages to the static page /50x.html
>        #
>        error_page   500 502 503 504  /50x.html;
>        location = /50x.html {
>            root   /usr/share/nginx/html;
>        }
>
>        location ~ / {
>            deny  all;
>        }
>        location = /robots.txt {
>            allow all;
>        }
>    }
>    include /etc/nginx/conf.d/*.conf;
> }
>
>
> server {
>    listen       80;
>    server_name  blah.example.com;
>    root   /var/www/aq/html;
>    location ~ \.php$ {
>        include /etc/nginx/fastcgi_params;
>        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
>        fastcgi_pass  unix:/dev/shm/php-fpm.socket.0;
>    }
>    location / {
>        index  index.php;
>    }
> }
>
>
>
> <?xml version="1.0" ?>
> <configuration>
>        <section name="global_options">
>                <value name="pid_file">/var/run/php-fpm.pid</value>
>                <value name="error_log">/var/log/php-fpm.log</value>
>                <value name="log_level">debug</value>
>                <value name="emergency_restart_threshold">10</value>
>                <value name="emergency_restart_interval">1m</value>
>                <value name="process_control_timeout">5s</value>
>                <value name="daemonize">yes</value>
>        </section>
>        <workers>
>                <section name="pool">
>                        <value name="name">aq</value>
>                        <value name="listen_address">/dev/shm/php-fpm.socket.0</value>
>                        <value name="listen_options">
>                                <value name="backlog">-1</value>
>                                <value name="owner">nginx</value>
>                                <value name="group">nginx</value>
>                                <value name="mode">0666</value>
>                        </value>
>                        <value name="php_defines">
>                        <value name="display_errors">0</value>
>                        </value>
>                        <value name="user">nginx</value>
>                        <value name="group">nginx</value>
>                        <value name="pm">
>                                <value name="style">static</value>
>                                <value name="max_children">200</value>
>                                <value name="apache_like">
>                                        <value name="StartServers">20</value>
>                                        <value name="MinSpareServers">5</value>
>                                        <value name="MaxSpareServers">35</value>
>                                </value>
>                        </value>
>                        <value name="request_terminate_timeout">30s</value>
>                        <value name="request_slowlog_timeout">5s</value>
>                        <value name="slowlog">/var/log/slow.log</value>
>                        <value name="rlimit_files">16384</value>
>                        <value name="rlimit_core">0</value>
>                        <value name="chroot"></value>
>                        <value name="chdir"></value>
>                        <value name="catch_workers_output">yes</value>
>                        <value name="max_requests">1500</value>
>                        <value name="allowed_clients">127.0.0.1</value>
>                        <value name="environment">
>                                <value name="HOSTNAME">$HOSTNAME</value>
>                                <value name="PATH">/usr/local/bin:/usr/bin:/bin</value>
>                                <value name="TMP">/tmp</value>
>                                <value name="TMPDIR">/tmp</value>
>                                <value name="TEMP">/tmp</value>
>                                <value name="OSTYPE">$OSTYPE</value>
>                                <value name="MACHTYPE">$MACHTYPE</value>
>                                <value name="MALLOC_CHECK_">2</value>
>                        </value>
>                </section>
>        </workers>
> </configuration>
>
>
I figured out that the -1 value of the backlog that supposedly should
take the somaxconn value from the sysctl doesnt work. If i increase
the backlog on the fpm config to 4096 the errors disappear. my sysctl
value for somaxconn was 8192

On Dec 17 2009, 5:07 pm, tachu <tac...@gmail.com> wrote:
> I'm trying to migrate my platform from lighttpd and spawn-fcgi to
> nginx and php-fpm. I've setup a very basic config on nginx and php-fpm
> my server handles about 120r/s all php calls I've been trying to use a
> unix socket because i heard that they are faster than using the
> loopback device. I keep getting (11: Resource temporarily unavailable)
> while connecting to upstream as soon as i turn on the traffic to it.
> the load on the server is about 1 and its an 8 core machine that under
> lighttpd responds fine at a load of 9. memory is not an issue as i
> only use about 3gb of the 8 it has available.
>  on lighttpd and spawn i also use unix sockets and spawn cgi
>
> fastcgi.server             = ( ".php" =>
>                                ( "localhost" =>
>                                  (
>                                    "socket" => "/tmp/php-fastcgi" +
> PID + ".socket",
>                                    "bin-path" => "/usr/bin/php-cgi",
>                                    "max-procs" => 50,
>                                    "min-procs" => 5,
>                                    "bin-environment" => (
>                                         "PHP_FCGI_CHILDREN" => "2",
>                                         "PHP_FCGI_MAX_REQUESTS" =>
> "15000")
>                                  )
>                                )
>                             )
>
> Here are my configs
> nginx.conf
> user              nginx;
> worker_processes  8;
> worker_rlimit_nofile 8192;
> error_log         /var/log/nginx/error.log debug;
> #error_log        /var/log/nginx/error.log  notice;
> #error_log        /var/log/nginx/error.log  info;
>
> pid               /var/run/nginx.pid;
> events {
>     worker_connections  8192;
>     use epoll;
>
> }
>
> http {
>     include       /etc/nginx/mime.types;
>     default_type  application/octet-stream;
>     log_format  main  '$remote_addr - $remote_user [$time_local]
> $request '
>                       '"$status" $body_bytes_sent "$http_referer" '
>                       '"$http_user_agent" "$http_x_forwarded_for"';
>     access_log  /var/log/nginx/access.log  main;
>
>     sendfile        on;
>     #tcp_nopush     on;
>
>     #keepalive_timeout  0;
>     keepalive_timeout  65;
>
>     #gzip  on;
>
>     # Load config files from the /etc/nginx/conf.d directory
>
>     #
>     # The default server
>     #
>     server {
>         listen       80;
>         server_name  _;
>
>         #charset koi8-r;
>         root   /var/www/html;
>
>         #access_log  logs/host.access.log  main;
>
>         location / {
>             index  robots.txt;
>         }
>
>         error_page  404              /404.html;
>         location = /404.html {
>             root   /usr/share/nginx/html;
>         }
>
>         # redirect server error pages to the static page /50x.html
>         #
>         error_page   500 502 503 504  /50x.html;
>         location = /50x.html {
>             root   /usr/share/nginx/html;
>         }
>
>         location ~ / {
>             deny  all;
>         }
>         location = /robots.txt {
>             allow all;
>         }
>     }
>     include /etc/nginx/conf.d/*.conf;
>
> }
>
> server {
>     listen       80;
>     server_name  blah.example.com;
>     root   /var/www/aq/html;
>     location ~ \.php$ {
>         include /etc/nginx/fastcgi_params;
>         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
>         fastcgi_pass  unix:/dev/shm/php-fpm.socket.0;
>     }
>     location / {
>         index  index.php;
>     }
>
> }
>
> <?xml version="1.0" ?>
> <configuration>
>         <section name="global_options">
>                 <value name="pid_file">/var/run/php-fpm..pid</value>
>                 <value name="error_log">/var/log/php-fpm.log</value>
>                 <value name="log_level">debug</value>
>                 <value name="emergency_restart_threshold">10</value>
>                 <value name="emergency_restart_interval">1m</value>
>                 <value name="process_control_timeout">5s</value>
>                 <value name="daemonize">yes</value>
>         </section>
>         <workers>
>                 <section name="pool">
>                         <value name="name">aq</value>
>                         <value name="listen_address">/dev/shm/php-fpm.socket.0</value>
>                         <value name="listen_options">
>                                 <value name="backlog">-1</value>
>                                 <value name="owner">nginx</value>
>                                 <value name="group">nginx</value>
>                                 <value name="mode">0666</value>
>                         </value>
>                         <value name="php_defines">
>                         <value name="display_errors">0</value>
>                         </value>
>                         <value name="user">nginx</value>
>                         <value name="group">nginx</value>
>                         <value name="pm">
>                                 <value name="style">static</value>
>                                 <value name="max_children">200</value>
>                                 <value name="apache_like">
>                                         <value name="StartServers">20</value>
>                                         <value name="MinSpareServers">5</value>
>                                         <value name="MaxSpareServers">35</value>
>                                 </value>
>                         </value>
>                         <value name="request_terminate_timeout">30s</value>
>                         <value name="request_slowlog_timeout">5s</value>
>                         <value name="slowlog">/var/log/slow.log</value>
>                         <value name="rlimit_files">16384</value>
>                         <value name="rlimit_core">0</value>
>                         <value name="chroot"></value>
>                         <value name="chdir"></value>
>                         <value name="catch_workers_output">yes</value>
>                         <value name="max_requests">1500</value>
>                         <value name="allowed_clients">127.0.0.1</value>
>                         <value name="environment">
>                                 <value name="HOSTNAME">$HOSTNAME</value>
>                                 <value name="PATH">/usr/local/bin:/usr/bin:/bin</value>
>                                 <value name="TMP">/tmp</value>
>                                 <value name="TMPDIR">/tmp</value>
>                                 <value name="TEMP">/tmp</value>
>                                 <value name="OSTYPE">$OSTYPE</value>
>                                 <value name="MACHTYPE">$MACHTYPE</value>
>                                 <value name="MALLOC_CHECK_">2</value>
>                         </value>
>                 </section>
>         </workers>
> </configuration>
Re: (11: Resource temporarily unavailable) while connecting to upstream
January 05, 2010 05:42PM
So that sounds like a bug then?

"backlog with -1 is supposed to take the sysctl value but does not" ?

On Tue, Jan 5, 2010 at 10:44 AM, tachu <tachu1@gmail.com> wrote:
> I figured out that the -1 value of the backlog that supposedly should
> take the somaxconn value from the sysctl doesnt work. If i increase
> the backlog on the fpm config to 4096 the errors disappear. my sysctl
> value for somaxconn was 8192
Many thanks
I have fixed my config with your suggest. May be this is a bug php-fpm

On Jan 6, 1:44 am, tachu <tac...@gmail.com> wrote:
> I figured out that the -1 value of the backlog that supposedly should
> take the somaxconn value from the sysctl doesnt work. If i increase
> the backlog on the fpm config to 4096 the errors disappear. my sysctl
> value for somaxconn was 8192
>
> On Dec 17 2009, 5:07 pm, tachu <tac...@gmail.com> wrote:
>
> > I'm trying to migrate my platform from lighttpd and spawn-fcgi to
> > nginx and php-fpm. I've setup a very basic config on nginx and php-fpm
> > my server handles about 120r/s all php calls I've been trying to use a
> > unix socket because i heard that they are faster than using the
> > loopback device. I keep getting (11: Resource temporarily unavailable)
> > while connecting to upstream as soon as i turn on the traffic to it.
> > the load on the server is about 1 and its an 8 core machine that under
> > lighttpd responds fine at a load of 9. memory is not an issue as i
> > only use about 3gb of the 8 it has available.
> >  on lighttpd and spawn i also use unix sockets and spawn cgi
>
> > fastcgi.server             = ( ".php" =>
> >                                ( "localhost" =>
> >                                  (
> >                                    "socket" => "/tmp/php-fastcgi" +
> > PID + ".socket",
> >                                    "bin-path" => "/usr/bin/php-cgi",
> >                                    "max-procs" => 50,
> >                                    "min-procs" => 5,
> >                                    "bin-environment" => (
> >                                         "PHP_FCGI_CHILDREN" => "2",
> >                                         "PHP_FCGI_MAX_REQUESTS" =>
> > "15000")
> >                                  )
> >                                )
> >                             )
>
> > Here are my configs
> > nginx.conf
> > user              nginx;
> > worker_processes  8;
> > worker_rlimit_nofile 8192;
> > error_log         /var/log/nginx/error.log debug;
> > #error_log        /var/log/nginx/error.log  notice;
> > #error_log        /var/log/nginx/error.log  info;
>
> > pid               /var/run/nginx.pid;
> > events {
> >     worker_connections  8192;
> >     use epoll;
>
> > }
>
> > http {
> >     include       /etc/nginx/mime.types;
> >     default_type  application/octet-stream;
> >     log_format  main  '$remote_addr - $remote_user [$time_local]
> > $request '
> >                       '"$status" $body_bytes_sent "$http_referer" '
> >                       '"$http_user_agent" "$http_x_forwarded_for"';
> >     access_log  /var/log/nginx/access.log  main;
>
> >     sendfile        on;
> >     #tcp_nopush     on;
>
> >     #keepalive_timeout  0;
> >     keepalive_timeout  65;
>
> >     #gzip  on;
>
> >     # Load config files from the /etc/nginx/conf.d directory
>
> >     #
> >     # The default server
> >     #
> >     server {
> >         listen       80;
> >         server_name  _;
>
> >         #charset koi8-r;
> >         root   /var/www/html;
>
> >         #access_log  logs/host.access.log  main;
>
> >         location / {
> >             index  robots.txt;
> >         }
>
> >         error_page  404              /404.html;
> >         location = /404.html {
> >             root   /usr/share/nginx/html;
> >         }
>
> >         # redirect server error pages to the static page /50x.html
> >         #
> >         error_page   500 502 503 504  /50x.html;
> >         location = /50x.html {
> >             root   /usr/share/nginx/html;
> >         }
>
> >         location ~ / {
> >             deny  all;
> >         }
> >         location = /robots.txt {
> >             allow all;
> >         }
> >     }
> >     include /etc/nginx/conf.d/*.conf;
>
> > }
>
> > server {
> >     listen       80;
> >     server_name  blah.example.com;
> >     root   /var/www/aq/html;
> >     location ~ \.php$ {
> >         include /etc/nginx/fastcgi_params;
> >         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
> >         fastcgi_pass  unix:/dev/shm/php-fpm.socket.0;
> >     }
> >     location / {
> >         index  index.php;
> >     }
>
> > }
>
> > <?xml version="1.0" ?>
> > <configuration>
> >         <section name="global_options">
> >                 <value name="pid_file">/var/run/php-fpm.pid</value>
> >                 <value name="error_log">/var/log/php-fpm.log</value>
> >                 <value name="log_level">debug</value>
> >                 <value name="emergency_restart_threshold">10</value>
> >                 <value name="emergency_restart_interval">1m</value>
> >                 <value name="process_control_timeout">5s</value>
> >                 <value name="daemonize">yes</value>
> >         </section>
> >         <workers>
> >                 <section name="pool">
> >                         <value name="name">aq</value>
> >                         <value name="listen_address">/dev/shm/php-fpm.socket.0</value>
> >                         <value name="listen_options">
> >                                 <value name="backlog">-1</value>
> >                                 <value name="owner">nginx</value>
> >                                 <value name="group">nginx</value>
> >                                 <value name="mode">0666</value>
> >                         </value>
> >                         <value name="php_defines">
> >                         <value name="display_errors">0</value>
> >                         </value>
> >                         <value name="user">nginx</value>
> >                         <value name="group">nginx</value>
> >                         <value name="pm">
> >                                 <value name="style">static</value>
> >                                 <value name="max_children">200</value>
> >                                 <value name="apache_like">
> >                                         <value name="StartServers">20</value>
> >                                         <value name="MinSpareServers">5</value>
> >                                         <value name="MaxSpareServers">35</value>
> >                                 </value>
> >                         </value>
> >                         <value name="request_terminate_timeout">30s</value>
> >                         <value name="request_slowlog_timeout">5s</value>
> >                         <value name="slowlog">/var/log/slow.log</value>
> >                         <value name="rlimit_files">16384</value>
> >                         <value name="rlimit_core">0</value>
> >                         <value name="chroot"></value>
> >                         <value name="chdir"></value>
> >                         <value name="catch_workers_output">yes</value>
> >                         <value name="max_requests">1500</value>
> >                         <value name="allowed_clients">127.0.0.1</value>
> >                         <value name="environment">
> >                                 <value name="HOSTNAME">$HOSTNAME</value>
> >                                 <value name="PATH">/usr/local/bin:/usr/bin:/bin</value>
> >                                 <value name="TMP">/tmp</value>
> >                                 <value name="TMPDIR">/tmp</value>
> >                                 <value name="TEMP">/tmp</value>
> >                                 <value name="OSTYPE">$OSTYPE</value>
> >                                 <value name="MACHTYPE">$MACHTYPE</value>
> >                                 <value name="MALLOC_CHECK_">2</value>
> >                         </value>
> >                 </section>
> >         </workers>
> > </configuration>
>
>
You use FreeBSD or Linux?

2010/1/13 tanlinh <trantanlinh@gmail.com>

> Many thanks
> I have fixed my config with your suggest. May be this is a bug php-fpm
>
> On Jan 6, 1:44 am, tachu <tac...@gmail.com> wrote:
> > I figured out that the -1 value of the backlog that supposedly should
> > take the somaxconn value from the sysctl doesnt work. If i increase
> > the backlog on the fpm config to 4096 the errors disappear. my sysctl
> > value for somaxconn was 8192
> >
> > On Dec 17 2009, 5:07 pm, tachu <tac...@gmail.com> wrote:
> >
> > > I'm trying to migrate my platform from lighttpd and spawn-fcgi to
> > > nginx and php-fpm. I've setup a very basic config on nginx and php-fpm
> > > my server handles about 120r/s all php calls I've been trying to use a
> > > unix socket because i heard that they are faster than using the
> > > loopback device. I keep getting (11: Resource temporarily unavailable)
> > > while connecting to upstream as soon as i turn on the traffic to it.
> > > the load on the server is about 1 and its an 8 core machine that under
> > > lighttpd responds fine at a load of 9. memory is not an issue as i
> > > only use about 3gb of the 8 it has available.
> > > on lighttpd and spawn i also use unix sockets and spawn cgi
> >
> > > fastcgi.server = ( ".php" =>
> > > ( "localhost" =>
> > > (
> > > "socket" => "/tmp/php-fastcgi" +
> > > PID + ".socket",
> > > "bin-path" => "/usr/bin/php-cgi",
> > > "max-procs" => 50,
> > > "min-procs" => 5,
> > > "bin-environment" => (
> > > "PHP_FCGI_CHILDREN" => "2",
> > > "PHP_FCGI_MAX_REQUESTS" =>
> > > "15000")
> > > )
> > > )
> > > )
> >
> > > Here are my configs
> > > nginx.conf
> > > user nginx;
> > > worker_processes 8;
> > > worker_rlimit_nofile 8192;
> > > error_log /var/log/nginx/error.log debug;
> > > #error_log /var/log/nginx/error.log notice;
> > > #error_log /var/log/nginx/error.log info;
> >
> > > pid /var/run/nginx.pid;
> > > events {
> > > worker_connections 8192;
> > > use epoll;
> >
> > > }
> >
> > > http {
> > > include /etc/nginx/mime.types;
> > > default_type application/octet-stream;
> > > log_format main '$remote_addr - $remote_user [$time_local]
> > > $request '
> > > '"$status" $body_bytes_sent "$http_referer" '
> > > '"$http_user_agent" "$http_x_forwarded_for"';
> > > access_log /var/log/nginx/access.log main;
> >
> > > sendfile on;
> > > #tcp_nopush on;
> >
> > > #keepalive_timeout 0;
> > > keepalive_timeout 65;
> >
> > > #gzip on;
> >
> > > # Load config files from the /etc/nginx/conf.d directory
> >
> > > #
> > > # The default server
> > > #
> > > server {
> > > listen 80;
> > > server_name _;
> >
> > > #charset koi8-r;
> > > root /var/www/html;
> >
> > > #access_log logs/host.access.log main;
> >
> > > location / {
> > > index robots.txt;
> > > }
> >
> > > error_page 404 /404.html;
> > > location = /404.html {
> > > root /usr/share/nginx/html;
> > > }
> >
> > > # redirect server error pages to the static page /50x.html
> > > #
> > > error_page 500 502 503 504 /50x.html;
> > > location = /50x.html {
> > > root /usr/share/nginx/html;
> > > }
> >
> > > location ~ / {
> > > deny all;
> > > }
> > > location = /robots.txt {
> > > allow all;
> > > }
> > > }
> > > include /etc/nginx/conf.d/*.conf;
> >
> > > }
> >
> > > server {
> > > listen 80;
> > > server_name blah.example.com;
> > > root /var/www/aq/html;
> > > location ~ \.php$ {
> > > include /etc/nginx/fastcgi_params;
> > > fastcgi_param SCRIPT_FILENAME
> $document_root$fastcgi_script_name;
> > > fastcgi_pass unix:/dev/shm/php-fpm.socket.0;
> > > }
> > > location / {
> > > index index.php;
> > > }
> >
> > > }
> >
> > > <?xml version="1.0" ?>
> > > <configuration>
> > > <section name="global_options">
> > > <value name="pid_file">/var/run/php-fpm.pid</value>
> > > <value name="error_log">/var/log/php-fpm.log</value>
> > > <value name="log_level">debug</value>
> > > <value name="emergency_restart_threshold">10</value>
> > > <value name="emergency_restart_interval">1m</value>
> > > <value name="process_control_timeout">5s</value>
> > > <value name="daemonize">yes</value>
> > > </section>
> > > <workers>
> > > <section name="pool">
> > > <value name="name">aq</value>
> > > <value
> name="listen_address">/dev/shm/php-fpm.socket.0</value>
> > > <value name="listen_options">
> > > <value name="backlog">-1</value>
> > > <value name="owner">nginx</value>
> > > <value name="group">nginx</value>
> > > <value name="mode">0666</value>
> > > </value>
> > > <value name="php_defines">
> > > <value name="display_errors">0</value>
> > > </value>
> > > <value name="user">nginx</value>
> > > <value name="group">nginx</value>
> > > <value name="pm">
> > > <value name="style">static</value>
> > > <value name="max_children">200</value>
> > > <value name="apache_like">
> > > <value
> name="StartServers">20</value>
> > > <value
> name="MinSpareServers">5</value>
> > > <value
> name="MaxSpareServers">35</value>
> > > </value>
> > > </value>
> > > <value
> name="request_terminate_timeout">30s</value>
> > > <value
> name="request_slowlog_timeout">5s</value>
> > > <value name="slowlog">/var/log/slow.log</value>
> > > <value name="rlimit_files">16384</value>
> > > <value name="rlimit_core">0</value>
> > > <value name="chroot"></value>
> > > <value name="chdir"></value>
> > > <value name="catch_workers_output">yes</value>
> > > <value name="max_requests">1500</value>
> > > <value name="allowed_clients">127.0.0.1</value>
> > > <value name="environment">
> > > <value
> name="HOSTNAME">$HOSTNAME</value>
> > > <value
> name="PATH">/usr/local/bin:/usr/bin:/bin</value>
> > > <value name="TMP">/tmp</value>
> > > <value name="TMPDIR">/tmp</value>
> > > <value name="TEMP">/tmp</value>
> > > <value name="OSTYPE">$OSTYPE</value>
> > > <value
> name="MACHTYPE">$MACHTYPE</value>
> > > <value name="MALLOC_CHECK_">2</value>
> > > </value>
> > > </section>
> > > </workers>
> > > </configuration>
> >
> >
>
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 281
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