Nginx + php-fpm - recv() errorNginx + PHP-FPM = “Random” 502 Bad GatewayBlank Page: wordpress on nginx+php-fpmNginx load balance with dedicated php-fpm serverphp-fpm, nginx magento store. Coming to a haltnginx returning error 502 when get not exist key on memcachedatomic deployments with Nginx and PHP FPM504 Gateway timeout / 502 Bad gateway after installing php curl - server nginxGetting a 502 Bad gateway error with nginx on ubuntuGetting recv() failed (104: Connection reset by peer)logrotate causes php5-fpm downtime
Displaying an Estimated Execution Plan generates CXPACKET, PAGELATCH_SH, and LATCH_EX [ACCESS_METHODS_DATASET_PARENT] waits
Why can’t you see at the start of the Big Bang?
How is it believable that Euron could so easily pull off this ambush?
Explaining intravenous drug abuse to a small child
Can a player choose to add detail and flavor to their character's spells and abilities?
Why was Gemini VIII terminated after recovering from the OAMS thruster failure?
Was there a dinosaur-counter in the original Jurassic Park movie?
The unknown and unexplained in science fiction
Where do 5 or more U.S. counties meet in a single point?
What detail can Hubble see on Mars?
How can I finally understand the confusing modal verb "мочь"?
How to make a kid's bike easier to pedal
How to increase speed on my hybrid bike with flat handlebars and 700X35C tyres?
My C Drive is full without reason
Why did Dr. Strange keep looking into the future after the snap?
Convert Numbers To Emoji Math
LiOH hydrolysis of methyl 2,2-dimethoxyacetate not giving product?
What calendar would the Saturn nation use?
Good introductory book to type theory?
HTML folder located within IOS Image file?
Would a legitimized Baratheon have the best claim for the Iron Throne?
Why is the blank symbol not considered part of the input alphabet of a Turing machine?
What is more safe for browsing the web: PC or smartphone?
While drilling into kitchen wall, hit a wire - any advice?
Nginx + php-fpm - recv() error
Nginx + PHP-FPM = “Random” 502 Bad GatewayBlank Page: wordpress on nginx+php-fpmNginx load balance with dedicated php-fpm serverphp-fpm, nginx magento store. Coming to a haltnginx returning error 502 when get not exist key on memcachedatomic deployments with Nginx and PHP FPM504 Gateway timeout / 502 Bad gateway after installing php curl - server nginxGetting a 502 Bad gateway error with nginx on ubuntuGetting recv() failed (104: Connection reset by peer)logrotate causes php5-fpm downtime
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I get the follow error in the nginx log
[error] 17734#0: *6643 recv() failed (104: Connection reset by peer)
while reading response header from upstream, client: [cut],
server: [cut], request: "GET /venues HTTP/1.1", upstream:
"fastcgi://127.0.0.1:9000", host: "[cut]"
I have a dedicated box with 8 gb ram, quad core chip. Good server.
Nginx, php-fpm & mysql all latest versions running under ubuntu 10.04
I only get this when I stress test the server with siege. If I increase the number of concurrent connections to 100, I can get up to 20% of all requests to fail.
Furthermore, I don't get this on pages that have no mysql queries. And only a few failures on pages with moderate number of queries. Bit, I'm not sure if that's got to do anything with it.
I have a feeling this is something to do with php. But I can't figure it out.
Any suggestions of where to even start looking?
Update: and the php error log is silent. No record of anything going wrong
nginx php-fpm mysql5
add a comment |
I get the follow error in the nginx log
[error] 17734#0: *6643 recv() failed (104: Connection reset by peer)
while reading response header from upstream, client: [cut],
server: [cut], request: "GET /venues HTTP/1.1", upstream:
"fastcgi://127.0.0.1:9000", host: "[cut]"
I have a dedicated box with 8 gb ram, quad core chip. Good server.
Nginx, php-fpm & mysql all latest versions running under ubuntu 10.04
I only get this when I stress test the server with siege. If I increase the number of concurrent connections to 100, I can get up to 20% of all requests to fail.
Furthermore, I don't get this on pages that have no mysql queries. And only a few failures on pages with moderate number of queries. Bit, I'm not sure if that's got to do anything with it.
I have a feeling this is something to do with php. But I can't figure it out.
Any suggestions of where to even start looking?
Update: and the php error log is silent. No record of anything going wrong
nginx php-fpm mysql5
I've seen many of these threads pop up in the php-highload-en group. One guys problem was hitting the mysql connection limit durring siege . Most of the time they recommend profiling the application and its sql queries. You could try posting there: groups.google.com/group/highload-php-en
– iainlbc
Aug 18 '11 at 23:24
What about the nginx error log? And the MySQL normal log as well as the slow query log? Is query caching in play at all? What is the nginx.conf like? What is the php config like?
– JayMcTee
Nov 11 '15 at 9:23
add a comment |
I get the follow error in the nginx log
[error] 17734#0: *6643 recv() failed (104: Connection reset by peer)
while reading response header from upstream, client: [cut],
server: [cut], request: "GET /venues HTTP/1.1", upstream:
"fastcgi://127.0.0.1:9000", host: "[cut]"
I have a dedicated box with 8 gb ram, quad core chip. Good server.
Nginx, php-fpm & mysql all latest versions running under ubuntu 10.04
I only get this when I stress test the server with siege. If I increase the number of concurrent connections to 100, I can get up to 20% of all requests to fail.
Furthermore, I don't get this on pages that have no mysql queries. And only a few failures on pages with moderate number of queries. Bit, I'm not sure if that's got to do anything with it.
I have a feeling this is something to do with php. But I can't figure it out.
Any suggestions of where to even start looking?
Update: and the php error log is silent. No record of anything going wrong
nginx php-fpm mysql5
I get the follow error in the nginx log
[error] 17734#0: *6643 recv() failed (104: Connection reset by peer)
while reading response header from upstream, client: [cut],
server: [cut], request: "GET /venues HTTP/1.1", upstream:
"fastcgi://127.0.0.1:9000", host: "[cut]"
I have a dedicated box with 8 gb ram, quad core chip. Good server.
Nginx, php-fpm & mysql all latest versions running under ubuntu 10.04
I only get this when I stress test the server with siege. If I increase the number of concurrent connections to 100, I can get up to 20% of all requests to fail.
Furthermore, I don't get this on pages that have no mysql queries. And only a few failures on pages with moderate number of queries. Bit, I'm not sure if that's got to do anything with it.
I have a feeling this is something to do with php. But I can't figure it out.
Any suggestions of where to even start looking?
Update: and the php error log is silent. No record of anything going wrong
nginx php-fpm mysql5
nginx php-fpm mysql5
asked Aug 18 '11 at 22:43
Ilya BiryukovIlya Biryukov
13336
13336
I've seen many of these threads pop up in the php-highload-en group. One guys problem was hitting the mysql connection limit durring siege . Most of the time they recommend profiling the application and its sql queries. You could try posting there: groups.google.com/group/highload-php-en
– iainlbc
Aug 18 '11 at 23:24
What about the nginx error log? And the MySQL normal log as well as the slow query log? Is query caching in play at all? What is the nginx.conf like? What is the php config like?
– JayMcTee
Nov 11 '15 at 9:23
add a comment |
I've seen many of these threads pop up in the php-highload-en group. One guys problem was hitting the mysql connection limit durring siege . Most of the time they recommend profiling the application and its sql queries. You could try posting there: groups.google.com/group/highload-php-en
– iainlbc
Aug 18 '11 at 23:24
What about the nginx error log? And the MySQL normal log as well as the slow query log? Is query caching in play at all? What is the nginx.conf like? What is the php config like?
– JayMcTee
Nov 11 '15 at 9:23
I've seen many of these threads pop up in the php-highload-en group. One guys problem was hitting the mysql connection limit durring siege . Most of the time they recommend profiling the application and its sql queries. You could try posting there: groups.google.com/group/highload-php-en
– iainlbc
Aug 18 '11 at 23:24
I've seen many of these threads pop up in the php-highload-en group. One guys problem was hitting the mysql connection limit durring siege . Most of the time they recommend profiling the application and its sql queries. You could try posting there: groups.google.com/group/highload-php-en
– iainlbc
Aug 18 '11 at 23:24
What about the nginx error log? And the MySQL normal log as well as the slow query log? Is query caching in play at all? What is the nginx.conf like? What is the php config like?
– JayMcTee
Nov 11 '15 at 9:23
What about the nginx error log? And the MySQL normal log as well as the slow query log? Is query caching in play at all? What is the nginx.conf like? What is the php config like?
– JayMcTee
Nov 11 '15 at 9:23
add a comment |
2 Answers
2
active
oldest
votes
Most probably you ran out of php-fpm workers. The log was silent because nothing was wrong in the code itself - workers just were busy processing your requests. If you did not get this on pages without MySQL queries, the bottleneck was the MySQL DB. You should identify long-running queries (using mytop or slow log feature or maybe some custom PHP logging around your SQL processing) and optimize them. Of course, "long queries" are actually quite short in high-load we world. Even 200ms query is long enough to put your server on its knees.
Doesphp-fpmseriously just silently drop connections when it's pool is fully occupied? That's horrendous.
– womble♦
Aug 18 '11 at 23:08
@womble When load comes in peaks it depends on a TCP backlog size I guess, but when load is constantly high the backlog will end sooner or later, so this behavior is quite predictable.
– Alex
Aug 18 '11 at 23:14
1
Sure, sometimes you can't handle something, and dropping a connection is possibly the best option. It's the silence I can't fathom. If you're going to do something out of the ordinary, you have to log it. No exceptions.
– womble♦
Aug 18 '11 at 23:42
add a comment |
this may be resolved. i reported a similar issue with opening and reusing persistent tcp sockets under almost no load at all. there's now a patch landed for this in git:
https://groups.google.com/forum/#!topic/highload-php-en/qGu3Eaifj9s
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f302822%2fnginx-php-fpm-recv-error%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Most probably you ran out of php-fpm workers. The log was silent because nothing was wrong in the code itself - workers just were busy processing your requests. If you did not get this on pages without MySQL queries, the bottleneck was the MySQL DB. You should identify long-running queries (using mytop or slow log feature or maybe some custom PHP logging around your SQL processing) and optimize them. Of course, "long queries" are actually quite short in high-load we world. Even 200ms query is long enough to put your server on its knees.
Doesphp-fpmseriously just silently drop connections when it's pool is fully occupied? That's horrendous.
– womble♦
Aug 18 '11 at 23:08
@womble When load comes in peaks it depends on a TCP backlog size I guess, but when load is constantly high the backlog will end sooner or later, so this behavior is quite predictable.
– Alex
Aug 18 '11 at 23:14
1
Sure, sometimes you can't handle something, and dropping a connection is possibly the best option. It's the silence I can't fathom. If you're going to do something out of the ordinary, you have to log it. No exceptions.
– womble♦
Aug 18 '11 at 23:42
add a comment |
Most probably you ran out of php-fpm workers. The log was silent because nothing was wrong in the code itself - workers just were busy processing your requests. If you did not get this on pages without MySQL queries, the bottleneck was the MySQL DB. You should identify long-running queries (using mytop or slow log feature or maybe some custom PHP logging around your SQL processing) and optimize them. Of course, "long queries" are actually quite short in high-load we world. Even 200ms query is long enough to put your server on its knees.
Doesphp-fpmseriously just silently drop connections when it's pool is fully occupied? That's horrendous.
– womble♦
Aug 18 '11 at 23:08
@womble When load comes in peaks it depends on a TCP backlog size I guess, but when load is constantly high the backlog will end sooner or later, so this behavior is quite predictable.
– Alex
Aug 18 '11 at 23:14
1
Sure, sometimes you can't handle something, and dropping a connection is possibly the best option. It's the silence I can't fathom. If you're going to do something out of the ordinary, you have to log it. No exceptions.
– womble♦
Aug 18 '11 at 23:42
add a comment |
Most probably you ran out of php-fpm workers. The log was silent because nothing was wrong in the code itself - workers just were busy processing your requests. If you did not get this on pages without MySQL queries, the bottleneck was the MySQL DB. You should identify long-running queries (using mytop or slow log feature or maybe some custom PHP logging around your SQL processing) and optimize them. Of course, "long queries" are actually quite short in high-load we world. Even 200ms query is long enough to put your server on its knees.
Most probably you ran out of php-fpm workers. The log was silent because nothing was wrong in the code itself - workers just were busy processing your requests. If you did not get this on pages without MySQL queries, the bottleneck was the MySQL DB. You should identify long-running queries (using mytop or slow log feature or maybe some custom PHP logging around your SQL processing) and optimize them. Of course, "long queries" are actually quite short in high-load we world. Even 200ms query is long enough to put your server on its knees.
answered Aug 18 '11 at 23:06
AlexAlex
6,63132846
6,63132846
Doesphp-fpmseriously just silently drop connections when it's pool is fully occupied? That's horrendous.
– womble♦
Aug 18 '11 at 23:08
@womble When load comes in peaks it depends on a TCP backlog size I guess, but when load is constantly high the backlog will end sooner or later, so this behavior is quite predictable.
– Alex
Aug 18 '11 at 23:14
1
Sure, sometimes you can't handle something, and dropping a connection is possibly the best option. It's the silence I can't fathom. If you're going to do something out of the ordinary, you have to log it. No exceptions.
– womble♦
Aug 18 '11 at 23:42
add a comment |
Doesphp-fpmseriously just silently drop connections when it's pool is fully occupied? That's horrendous.
– womble♦
Aug 18 '11 at 23:08
@womble When load comes in peaks it depends on a TCP backlog size I guess, but when load is constantly high the backlog will end sooner or later, so this behavior is quite predictable.
– Alex
Aug 18 '11 at 23:14
1
Sure, sometimes you can't handle something, and dropping a connection is possibly the best option. It's the silence I can't fathom. If you're going to do something out of the ordinary, you have to log it. No exceptions.
– womble♦
Aug 18 '11 at 23:42
Does
php-fpm seriously just silently drop connections when it's pool is fully occupied? That's horrendous.– womble♦
Aug 18 '11 at 23:08
Does
php-fpm seriously just silently drop connections when it's pool is fully occupied? That's horrendous.– womble♦
Aug 18 '11 at 23:08
@womble When load comes in peaks it depends on a TCP backlog size I guess, but when load is constantly high the backlog will end sooner or later, so this behavior is quite predictable.
– Alex
Aug 18 '11 at 23:14
@womble When load comes in peaks it depends on a TCP backlog size I guess, but when load is constantly high the backlog will end sooner or later, so this behavior is quite predictable.
– Alex
Aug 18 '11 at 23:14
1
1
Sure, sometimes you can't handle something, and dropping a connection is possibly the best option. It's the silence I can't fathom. If you're going to do something out of the ordinary, you have to log it. No exceptions.
– womble♦
Aug 18 '11 at 23:42
Sure, sometimes you can't handle something, and dropping a connection is possibly the best option. It's the silence I can't fathom. If you're going to do something out of the ordinary, you have to log it. No exceptions.
– womble♦
Aug 18 '11 at 23:42
add a comment |
this may be resolved. i reported a similar issue with opening and reusing persistent tcp sockets under almost no load at all. there's now a patch landed for this in git:
https://groups.google.com/forum/#!topic/highload-php-en/qGu3Eaifj9s
add a comment |
this may be resolved. i reported a similar issue with opening and reusing persistent tcp sockets under almost no load at all. there's now a patch landed for this in git:
https://groups.google.com/forum/#!topic/highload-php-en/qGu3Eaifj9s
add a comment |
this may be resolved. i reported a similar issue with opening and reusing persistent tcp sockets under almost no load at all. there's now a patch landed for this in git:
https://groups.google.com/forum/#!topic/highload-php-en/qGu3Eaifj9s
this may be resolved. i reported a similar issue with opening and reusing persistent tcp sockets under almost no load at all. there's now a patch landed for this in git:
https://groups.google.com/forum/#!topic/highload-php-en/qGu3Eaifj9s
answered Oct 21 '13 at 21:47
leeoniyaleeoniya
1175
1175
add a comment |
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f302822%2fnginx-php-fpm-recv-error%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I've seen many of these threads pop up in the php-highload-en group. One guys problem was hitting the mysql connection limit durring siege . Most of the time they recommend profiling the application and its sql queries. You could try posting there: groups.google.com/group/highload-php-en
– iainlbc
Aug 18 '11 at 23:24
What about the nginx error log? And the MySQL normal log as well as the slow query log? Is query caching in play at all? What is the nginx.conf like? What is the php config like?
– JayMcTee
Nov 11 '15 at 9:23