Yes Mike, that's a very logic things.<br><br><br clear="all">Regards,<br>Joe<br>
<br><br><div class="gmail_quote">On Sun, May 30, 2010 at 1:51 AM, Michael Shadle <span dir="ltr"><<a href="mailto:mike503@gmail.com">mike503@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Yup. General rule of thumb is roughly how many concurrent php requests you expect at peak time. Hopefully your code runs fast enough to spend less than 1 second processing. Cause if the children are busy it will block until one opens up or until nginx's configured timeout hits.<div>
<div></div><div class="h5"><br>
<br>
On May 29, 2010, at 11:24 AM, Jérôme Loyet <<a href="mailto:jerome@loyet.net" target="_blank">jerome@loyet.net</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2010/5/29 Joe <<a href="mailto:frumentius@gmail.com" target="_blank">frumentius@gmail.com</a>>:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Usually using 5 is quiet enough.<br>
</blockquote>
<br>
either you have a well optimized website with a 99% cache ratio or you<br>
don't have traffic. In the real world, there is so much web apps which<br>
consume a lot of resources and for thoses you'll need much more than 5<br>
children to handle them.<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
Regards,<br>
Joe<br>
<br>
<br>
2010/5/30 Michael Shadle <<a href="mailto:mike503@gmail.com" target="_blank">mike503@gmail.com</a>><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
150 children is quite a lot. Sure you need that? :)<br>
<br>
On May 29, 2010, at 6:02 AM, "TheCrach" <<a href="mailto:nginx-forum@nginx.us" target="_blank">nginx-forum@nginx.us</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
I'm French and I've some problem with nginx 0.8.38 and PHP-FPM 5.3.0 with<br>
Suhosin patch :/<br>
I've got random instant 502 Bad Gateway errors, generaly a refresh make<br>
the page works again but it's really anoying.<br>
<br>
Nginx Config :<br>
[code]<br>
user www;<br>
worker_processes 1;<br>
daemon on;<br>
<br>
error_log /var/log/nginx/error.log;<br>
pid /var/run/nginx.pid;<br>
<br>
worker_rlimit_nofile 32000;<br>
<br>
events {<br>
worker_connections 4096;<br>
use epoll;<br>
}<br>
<br>
http {<br>
<br>
include mime.types;<br>
default_type text/plain;<br>
<br>
limit_zone http $binary_remote_addr 1m;<br>
limit_zone https $binary_remote_addr 1m;<br>
<br>
client_body_timeout 8;<br>
client_header_timeout 5;<br>
keepalive_timeout 5;<br>
keepalive_requests 10;<br>
send_timeout 8;<br>
<br>
client_max_body_size 512k;<br>
<br>
access_log off;<br>
error_log off;<br>
<br>
client_header_buffer_size 16k;<br>
large_client_header_buffers 16 16k;<br>
<br>
output_buffers 2 32k;<br>
postpone_output 1460;<br>
<br>
sendfile on;<br>
tcp_nopush on;<br>
tcp_nodelay on;<br>
reset_timedout_connection on;<br>
<br>
ignore_invalid_headers on;<br>
autoindex on;<br>
msie_padding on;<br>
<br>
gzip on;<br>
gzip_http_version 1.1;<br>
gzip_vary on;<br>
gzip_comp_level 6;<br>
gzip_proxied any;<br>
gzip_types text/plain text/css application/json<br>
application/x-javascript text/xml application/xml application/xml+rss<br>
text/javascript;<br>
gzip_buffers 16 16k;<br>
gzip_disable “MSIE [1-6].(?!.*SV1)”;<br>
<br>
server<br>
{<br>
listen 80 default rcvbuf=8192 sndbuf=16384 backlog=65536;<br>
index index.html index.htm index.php;<br>
root /home/www/;<br>
<br>
limit_conn http 10;<br>
<br>
access_log off;<br>
<br>
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {<br>
expires 3600;<br>
break;<br>
}<br>
<br>
location ~ \.php(/|$) {<br>
include fastcgi_params;<br>
}<br>
<br>
location ~ \.php5(/|$) {<br>
include fastcgi_params;<br>
}<br>
<br>
location ~ \.php4(/|$) {<br>
include fastcgi_params;<br>
}<br>
<br>
location /cache/status {<br>
stub_status on;<br>
access_log off;<br>
}<br>
}<br>
[/code]<br>
<br>
Fastcgi params :<br>
<br>
[code]<br>
fastcgi_connect_timeout 5;<br>
fastcgi_send_timeout 8;<br>
fastcgi_buffer_size 512k;<br>
fastcgi_buffers 64 64k;<br>
fastcgi_busy_buffers_size 512k;<br>
fastcgi_temp_file_write_size 512k;<br>
fastcgi_ignore_client_abort on;<br>
fastcgi_intercept_errors on;<br>
fastcgi_read_timeout 45;<br>
<br>
fastcgi_pass unix:/tmp/php.socket;<br>
fastcgi_index index.php;<br>
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br>
fastcgi_param QUERY_STRING $query_string;<br>
fastcgi_param REQUEST_METHOD $request_method;<br>
fastcgi_param CONTENT_TYPE $content_type;<br>
fastcgi_param CONTENT_LENGTH $content_length;<br>
fastcgi_param SCRIPT_NAME $fastcgi_script_name;<br>
fastcgi_param REQUEST_URI $request_uri;<br>
fastcgi_param DOCUMENT_URI $document_uri;<br>
fastcgi_param DOCUMENT_ROOT $document_root;<br>
fastcgi_param SERVER_PROTOCOL $server_protocol;<br>
fastcgi_param GATEWAY_INTERFACE CGI;<br>
fastcgi_param SERVER_SOFTWARE RD;<br>
fastcgi_param REMOTE_ADDR $remote_addr;<br>
fastcgi_param REMOTE_PORT $remote_port;<br>
fastcgi_param SERVER_ADDR $server_addr;<br>
fastcgi_param SERVER_PORT $server_port;<br>
fastcgi_param SERVER_NAME $server_name;<br>
fastcgi_param REDIRECT_STATUS 200;<br>
[/code]<br>
<br>
PHP-FPM conf :<br>
<br>
[code]<br>
<?xml version="1.0" ?><br>
<configuration><br>
<section name="global_options"><br>
<value name="pid_file">/var/run/php5-fpm.pid</value><br>
<value name="error_log">/var/log/php-fpm.log</value><br>
<value name="log_level">warn</value><br>
<value name="emergency_restart_threshold">60</value><br>
<value name="emergency_restart_interval">1m</value><br>
<value name="process_control_timeout">4s</value><br>
<value name="daemonize">yes</value><br>
</section><br>
<br>
<workers><br>
<section name="pool"><br>
<value name="name">RD</value><br>
<value name="listen_address">/tmp/php.socket</value><br>
<value name="listen_options"><br>
<value name="backlog">-1</value><br>
<value name="owner">www</value><br>
<value name="group">www</value><br>
<value name="mode">0666</value><br>
</value><br>
<br>
<value name="php_defines"><br>
</value><br>
<br>
<value name="user">www</value><br>
<value name="group">www</value><br>
<br>
<value name="pm"><br>
<value name="style">static</value><br>
<value name="max_children">150</value><br>
<value name="apache_like"><br>
<value name="StartServers">25</value><br>
<value name="MinSpareServers">5</value><br>
<value name="MaxSpareServers">35</value><br>
</value><br>
</value><br>
<br>
<value name="request_terminate_timeout">0s</value><br>
<value name="request_slowlog_timeout">0s</value><br>
<value name="slowlog">/var/log/php-fpm.log.slow</value><br>
<value name="rlimit_files">1024</value><br>
<value name="rlimit_core">0</value><br>
<value name="chroot"></value><br>
<value name="chdir"></value><br>
<value name="catch_workers_output">yes</value><br>
<value name="max_requests">65536</value><br>
<value name="allowed_clients">127.0.0.1</value><br>
<br>
<value name="environment"><br>
<value name="HOSTNAME">$HOSTNAME</value><br>
<value name="PATH">/usr/local/bin:/usr/bin:/bin</value><br>
<value name="TMP">/tmp</value><br>
<value name="TMPDIR">/tmp</value><br>
<value name="TEMP">/tmp</value><br>
<value name="OSTYPE">$OSTYPE</value><br>
<value name="MACHTYPE">$MACHTYPE</value><br>
<value name="MALLOC_CHECK_">2</value><br>
</value><br>
</section><br>
</workers><br>
</configuration><br>
[/code]<br>
<br>
Server config :<br>
<br>
[code]<br>
Intel Corei5 (Lynnfield) 4x 2.66+ GHz 8 Mo L2 - FSB 1333 MHz<br>
64 bits<br>
8 Go DDR3<br>
Intel SSD X25-M 2x 80 Go RAID 0/1<br>
GigaEthernet<br>
[/code]<br>
<br>
If anyone have an idea :)<br>
<br>
It's very strange because it's instant and random whereas it would be<br>
timedout all the time :/<br>
<br>
Thank's in advance.<br>
<br>
Posted at Nginx Forum:<br>
<a href="http://forum.nginx.org/read.php?2,91854,91854#msg-91854" target="_blank">http://forum.nginx.org/read.php?2,91854,91854#msg-91854</a><br>
<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
</blockquote>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
</blockquote>
<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
<br>
<br>
</blockquote>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
</blockquote>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br>