Results 1 to 18 of 18
-
01-06-2011, 12:42 PM #1Newbie
- Join Date
- Jan 2011
- Posts
- 18
NginX upstream timed out (110: Connection timed out) while connecting to upstream
Hello,
I keep on getting problems with my NginX setup using php-fpm, all latest versions.
It's many like these:
2011/01/06 19:50:00 [error] 4660#0: *10702343 upstream timed out (110: Connection timed out) while connecting to upstream, client: xx.xx.xx.xx, server: xxx.yyy, request: "GET / HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "xxx.yyy"
These errors only occur while there are many requests, like over 1,000/s.
[root@db ~]# uname -a
Linux db.2.6.18-194.26.1.el5 #1 SMP Tue Nov 9 12:54:20 EST 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@db ~]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 210944
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 50000
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 210944
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
request_terminate_timeout = 60 is already set in php-fpm.conf .
I searched the whole Internet for this problem and couldn't find anything to help me out.
Thank you!
-
01-06-2011, 12:51 PM #2Web Hosting Master
- Join Date
- Mar 2009
- Location
- Gods Own Country
- Posts
- 681
Try increasing the worker thread ( max_children )
█ Fabin Mundattil @ Xieles Support
█ High Quality Server Management | support @ xieles.com
█ https://xieles.com
-
01-06-2011, 12:59 PM #3Problem Solver
- Join Date
- Mar 2003
- Location
- California USA
- Posts
- 13,681
You need more php workers, not nginx workers.
Steven Ciaburri | Industry's Best Server Management - Rack911.com
Software Auditing - 400+ Vulnerabilities Found - Quote @ https://www.RACK911Labs.com
Fully Managed Dedicated Servers (Las Vegas, New York City, & Amsterdam) (AS62710)
FreeBSD & Linux Server Management, Security Auditing, Server Optimization, PCI Compliance
-
01-06-2011, 01:31 PM #4Newbie
- Join Date
- Jan 2011
- Posts
- 18
That still didn't work.
These are my php-fpm settings:
pm.max_children = 20000
pm.start_servers = 40
pm.min_spare_servers = 20
pm.max_requests = 0
pm.max_spare_servers = 40
Thanks
-
01-07-2011, 12:11 AM #5Problem Solver
- Join Date
- Mar 2003
- Location
- California USA
- Posts
- 13,681
You could be hitting other limits in your fastcgi implementation - file descriptor limits on the php user (you only showed us root limit) etc.
Regardless of the cause, the problem is with php. Check/Enable logging for your php fastcgi installation.Steven Ciaburri | Industry's Best Server Management - Rack911.com
Software Auditing - 400+ Vulnerabilities Found - Quote @ https://www.RACK911Labs.com
Fully Managed Dedicated Servers (Las Vegas, New York City, & Amsterdam) (AS62710)
FreeBSD & Linux Server Management, Security Auditing, Server Optimization, PCI Compliance
-
01-07-2011, 01:38 AM #6Web Hosting Master
- Join Date
- Jun 2001
- Location
- Denver, CO
- Posts
- 3,302
Why are you running PHP on your nginix host? Use nginix to reverse proxy to a couple of backend servers. Spread the love.
Jay Sudowski // Handy Networks LLC // Co-Founder & CTO
AS30475 - Level(3), HE, Telia, XO and Cogent. Noction optimized network.
Offering Dedicated Server and Colocation Hosting from our SSAE 16 SOC 2, Type 2 Certified Data Center.
Current specials here. Check them out.
-
01-07-2011, 06:08 AM #7Newbie
- Join Date
- Jan 2011
- Posts
- 18
It's not that
[root@db ~]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 210944
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 10000
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 210944
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
daemon soft nofile 90000
daemon hard nofile 90000
Thanks
-
01-07-2011, 11:30 AM #8Web Hosting Master
- Join Date
- Nov 2006
- Posts
- 939
Also, when using php-fpm with nginx, I've found it better to use a unix socket instead of tcp/ip if it's all on the same box.
-
01-07-2011, 11:35 AM #9Newbie
- Join Date
- Jan 2011
- Posts
- 18
-
01-07-2011, 12:03 PM #10Web Hosting Master
- Join Date
- Nov 2006
- Posts
- 939
Taken from a live conf file:
In nginx.conf:
location ~ \.php$ {
fastcgi_pass unix:/tmp/php.sock;
etc etc etc
}
In php-fpm.conf:
;listen = 127.0.0.1:9000
listen = /tmp/php.sock
Just change from an IP address to a unix socket address basically, simples. Not sure it'd fix your problem though. Are you on 5.3.4?Last edited by EasyInternet_Nick; 01-07-2011 at 12:10 PM.
-
01-07-2011, 12:17 PM #11Problem Solver
- Join Date
- Mar 2003
- Location
- California USA
- Posts
- 13,681
Steven Ciaburri | Industry's Best Server Management - Rack911.com
Software Auditing - 400+ Vulnerabilities Found - Quote @ https://www.RACK911Labs.com
Fully Managed Dedicated Servers (Las Vegas, New York City, & Amsterdam) (AS62710)
FreeBSD & Linux Server Management, Security Auditing, Server Optimization, PCI Compliance
-
01-07-2011, 05:23 PM #12Web Hosting Master
- Join Date
- Jun 2005
- Posts
- 2,752
-
01-08-2011, 06:46 AM #13Newbie
- Join Date
- Jan 2011
- Posts
- 18
No, I am running it under a default user "daemon".
I've added session required pam_limits.so to /etc/pam.d/login and also set
daemon soft nofile unlimited
daemon hard nofile unlimited
daemon soft nproc unlimited
daemon hard nproc unlimited
in /etc/security/limits.conf
I still get the error "upstream timed out (110: Connection timed out) while connecting to upstream, client"
-
01-08-2011, 06:56 AM #14Newbie
- Join Date
- Jan 2011
- Posts
- 18
-
01-08-2011, 07:00 AM #15Newbie
- Join Date
- Jan 2011
- Posts
- 18
-
01-08-2011, 07:04 AM #16Web Hosting Master
- Join Date
- Jun 2005
- Posts
- 2,752
It makes a lot of sense but not all sites need multitiered configuration. I was not suggesting you to use as I don't know what is your application, server load, traffic, visitor geographic distribution, etc -- just asking Jay Suds an opinion regarding two specific software (ngnix vs varnish) between many others used to do reverse proxy.
Last edited by dotHostel; 01-08-2011 at 07:19 AM.
You will only find out how good a provider is when the going gets tough
-
04-21-2012, 12:26 AM #17Newbie
- Join Date
- Dec 2010
- Posts
- 16
why does my php-fpm.conf be written with XML style. The INI format broken the server starting up. help~
-
01-05-2013, 03:34 AM #18New Member
- Join Date
- Jan 2006
- Posts
- 1
I have the same problem, did you find any solution to this?
Similar Threads
-
nginx upstream timed out error
By heropage in forum Hosting Security and TechnologyReplies: 14Last Post: 11-30-2012, 06:39 PM -
Connection Timed Out
By mamasfinds in forum Web HostingReplies: 5Last Post: 01-27-2008, 01:57 PM -
The connection has timed out - Please Help
By computerness in forum Hosting Security and TechnologyReplies: 7Last Post: 01-24-2008, 11:59 PM -
The connection has timed out
By zodehala in forum Hosting Security and TechnologyReplies: 2Last Post: 12-25-2007, 09:26 PM -
425 Unable to build data connection: Connection timed out
By vnunited in forum Hosting Security and TechnologyReplies: 3Last Post: 05-15-2006, 12:42 PM