Welcome! Log In Create A New Profile

Advanced

Upstream timeouts

Posted by edbloom 
Upstream timeouts
October 22, 2012 08:08AM
Hi folks,

Getting reasonably frequent upstream timeouts in my nginx error logs:

*45896 upstream timed out (110: Connection timed out) while reading
response header from upstream, client: 127.0.0.1

The site in question is a Magento powered shop with fairly low/moderate
traffic (few thousand visits per day)

My setup

- VPS with 4GB RAM, 8 core CPU
- ubuntu 12.04
- nginx 1.2.1 w/ extras
- php-fpm 5.3.10 w/ suhosin v0.9.33
- apc
- mysql 5.5.24

fairly standard static PM settings:

pm.max_children = 15
pm.max_requests = 500

I know Magento is slow. But surely this spec of a machine shouldn't be
getting upstream timeouts with so little traffic?

I've plenty of RAM left in the tank - machine never goes over 60% usage.

I do see some CPU spikes and monit sends me alerts telling me the load
average hits > 2.0 quite a lot.

Any useful tips for helping me to being diagnosing what to tweak/change to
reduce these upstream timeouts?

Ed
Przemysław Pawliczuk
Re: Upstream timeouts
October 22, 2012 08:10AM
What is yours I/O ops number per second? Have you any PHP accelerator
installed?
On Oct 22, 2012 2:06 PM, "ct_roy" <colmtroy@gmail.com> wrote:

> Hi folks,
>
> Getting reasonably frequent upstream timeouts in my nginx error logs:
>
> *45896 upstream timed out (110: Connection timed out) while reading
> response header from upstream, client: 127.0.0.1
>
> The site in question is a Magento powered shop with fairly low/moderate
> traffic (few thousand visits per day)
>
> My setup
>
> - VPS with 4GB RAM, 8 core CPU
> - ubuntu 12.04
> - nginx 1.2.1 w/ extras
> - php-fpm 5.3.10 w/ suhosin v0.9.33
> - apc
> - mysql 5.5.24
>
> fairly standard static PM settings:
>
> pm.max_children = 15
> pm.max_requests = 500
>
> I know Magento is slow. But surely this spec of a machine shouldn't be
> getting upstream timeouts with so little traffic?
>
> I've plenty of RAM left in the tank - machine never goes over 60% usage.
>
> I do see some CPU spikes and monit sends me alerts telling me the load
> average hits > 2.0 quite a lot.
>
> Any useful tips for helping me to being diagnosing what to tweak/change to
> reduce these upstream timeouts?
>
> Ed
>
Felipe
Re: Upstream timeouts
October 22, 2012 08:18AM
You are using the communication between nginx and php-fpm via tcp?

Unix sockets are much much faster and have less incidence of problems.

We have many shared servers with around 1000 domains each, and many use
Magento without any problems.

[]'s

2012/10/22 Przemysław Pawliczuk <p.pawliczuk@gmail.com>

> What is yours I/O ops number per second? Have you any PHP accelerator
> installed?
> On Oct 22, 2012 2:06 PM, "ct_roy" <colmtroy@gmail.com> wrote:
>
>> Hi folks,
>>
>> Getting reasonably frequent upstream timeouts in my nginx error logs:
>>
>> *45896 upstream timed out (110: Connection timed out) while reading
>> response header from upstream, client: 127.0.0.1
>>
>> The site in question is a Magento powered shop with fairly low/moderate
>> traffic (few thousand visits per day)
>>
>> My setup
>>
>> - VPS with 4GB RAM, 8 core CPU
>> - ubuntu 12.04
>> - nginx 1.2.1 w/ extras
>> - php-fpm 5.3.10 w/ suhosin v0.9.33
>> - apc
>> - mysql 5.5.24
>>
>> fairly standard static PM settings:
>>
>> pm.max_children = 15
>> pm.max_requests = 500
>>
>> I know Magento is slow. But surely this spec of a machine shouldn't be
>> getting upstream timeouts with so little traffic?
>>
>> I've plenty of RAM left in the tank - machine never goes over 60% usage.
>>
>> I do see some CPU spikes and monit sends me alerts telling me the load
>> average hits > 2.0 quite a lot.
>>
>> Any useful tips for helping me to being diagnosing what to tweak/change
>> to reduce these upstream timeouts?
>>
>> Ed
>>
>


--
Atenciosamente;
Felipe Braz
Linux User # 323052
Re: Upstream timeouts
October 22, 2012 08:58AM
Hey Felipe,

Thanks for your input.

I've switched between sockets and tcp and found no real difference - the
problem persists with both.

Ed

On Monday, October 22, 2012 1:16:49 PM UTC+1, Felipe Braz wrote:
>
> You are using the communication between nginx and php-fpm via tcp?
>
> Unix sockets are much much faster and have less incidence of problems.
>
> We have many shared servers with around 1000 domains each, and many use
> Magento without any problems.
>
> []'s
>
> 2012/10/22 Przemysław Pawliczuk <p.paw...@gmail.com <javascript:>>
>
>> What is yours I/O ops number per second? Have you any PHP accelerator
>> installed?
>> On Oct 22, 2012 2:06 PM, "ct_roy" <colm...@gmail.com <javascript:>>
>> wrote:
>>
>>> Hi folks,
>>>
>>> Getting reasonably frequent upstream timeouts in my nginx error logs:
>>>
>>> *45896 upstream timed out (110: Connection timed out) while reading
>>> response header from upstream, client: 127.0.0.1
>>>
>>> The site in question is a Magento powered shop with fairly low/moderate
>>> traffic (few thousand visits per day)
>>>
>>> My setup
>>>
>>> - VPS with 4GB RAM, 8 core CPU
>>> - ubuntu 12.04
>>> - nginx 1.2.1 w/ extras
>>> - php-fpm 5.3.10 w/ suhosin v0.9.33
>>> - apc
>>> - mysql 5.5.24
>>>
>>> fairly standard static PM settings:
>>>
>>> pm.max_children = 15
>>> pm.max_requests = 500
>>>
>>> I know Magento is slow. But surely this spec of a machine shouldn't be
>>> getting upstream timeouts with so little traffic?
>>>
>>> I've plenty of RAM left in the tank - machine never goes over 60% usage..
>>>
>>> I do see some CPU spikes and monit sends me alerts telling me the load
>>> average hits > 2.0 quite a lot.
>>>
>>> Any useful tips for helping me to being diagnosing what to tweak/change
>>> to reduce these upstream timeouts?
>>>
>>> Ed
>>>
>>
>
>
> --
> Atenciosamente;
> Felipe Braz
> Linux User # 323052
>
Re: Upstream timeouts
October 22, 2012 09:00AM
are you sure that the php script itself isn't timing out in terms of hitting max execution time?
can you share your nginx fastcgi_params?


--
Vid Luther
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Monday, October 22, 2012 at 7:57 AM, ct_roy wrote:

> Hey Felipe,
>
> Thanks for your input.
>
> I've switched between sockets and tcp and found no real difference - the problem persists with both.
>
> Ed
>
> On Monday, October 22, 2012 1:16:49 PM UTC+1, Felipe Braz wrote:
> > You are using the communication between nginx and php-fpm via tcp?
> >
> > Unix sockets are much much faster and have less incidence of problems..
> >
> > We have many shared servers with around 1000 domains each, and many use Magento without any problems.
> >
> > []'s
> >
> > 2012/10/22 Przemysław Pawliczuk <p.paw...@gmail.com (javascript:)>
> > > What is yours I/O ops number per second? Have you any PHP accelerator installed?
> > > On Oct 22, 2012 2:06 PM, "ct_roy" <colm...@gmail.com (javascript:)> wrote:
> > > > Hi folks,
> > > >
> > > > Getting reasonably frequent upstream timeouts in my nginx error logs:
> > > >
> > > > *45896 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1
> > > >
> > > > The site in question is a Magento powered shop with fairly low/moderate traffic (few thousand visits per day)
> > > >
> > > > My setup
> > > >
> > > > - VPS with 4GB RAM, 8 core CPU
> > > > - ubuntu 12.04
> > > > - nginx 1.2.1 w/ extras
> > > > - php-fpm 5.3.10 w/ suhosin v0.9.33
> > > > - apc
> > > > - mysql 5.5.24
> > > >
> > > > fairly standard static PM settings:
> > > >
> > > > pm.max_children = 15
> > > > pm.max_requests = 500
> > > >
> > > > I know Magento is slow. But surely this spec of a machine shouldn't be getting upstream timeouts with so little traffic?
> > > >
> > > > I've plenty of RAM left in the tank - machine never goes over 60% usage.
> > > >
> > > > I do see some CPU spikes and monit sends me alerts telling me the load average hits > 2.0 quite a lot.
> > > >
> > > > Any useful tips for helping me to being diagnosing what to tweak/change to reduce these upstream timeouts?
> > > >
> > > > Ed
> >
> >
> > --
> > Atenciosamente;
> > Felipe Braz
> > Linux User # 323052
Re: Upstream timeouts
October 22, 2012 09:04AM
Hey eRIZ,
*
*
*Re: php accelerator - APC.*
*
*
*Re: I/O ops number per second - I've not looked into this in detail yet -
I'll take a look and report back - from running top I can see my wait time
fluctuating above 20% quite often but then drops to 6-7%*
*
*
*Ed*
*
*
*
*

On Monday, October 22, 2012 1:09:19 PM UTC+1, eRIZ wrote:
>
> What is yours I/O ops number per second? Have you any PHP accelerator
> installed?
> On Oct 22, 2012 2:06 PM, "ct_roy" <colm...@gmail.com <javascript:>> wrote:
>
>> Hi folks,
>>
>> Getting reasonably frequent upstream timeouts in my nginx error logs:
>>
>> *45896 upstream timed out (110: Connection timed out) while reading
>> response header from upstream, client: 127.0.0.1
>>
>> The site in question is a Magento powered shop with fairly low/moderate
>> traffic (few thousand visits per day)
>>
>> My setup
>>
>> - VPS with 4GB RAM, 8 core CPU
>> - ubuntu 12.04
>> - nginx 1.2.1 w/ extras
>> - php-fpm 5.3.10 w/ suhosin v0.9.33
>> - apc
>> - mysql 5.5.24
>>
>> fairly standard static PM settings:
>>
>> pm.max_children = 15
>> pm.max_requests = 500
>>
>> I know Magento is slow. But surely this spec of a machine shouldn't be
>> getting upstream timeouts with so little traffic?
>>
>> I've plenty of RAM left in the tank - machine never goes over 60% usage.
>>
>> I do see some CPU spikes and monit sends me alerts telling me the load
>> average hits > 2.0 quite a lot.
>>
>> Any useful tips for helping me to being diagnosing what to tweak/change
>> to reduce these upstream timeouts?
>>
>> Ed
>>
>
Przemysław Pawliczuk
Re: Upstream timeouts
October 22, 2012 09:08AM
How about buffers set up in configuration? Have you tried increasing them?
Magento is a quite huge application and I suspect that the accelerator
can't cache all necessary files due to the insufficient buffer size.

Ps. Don't forget to reload pool after changing. (;
On Oct 22, 2012 3:02 PM, "ct_roy" <colmtroy@gmail.com> wrote:

> Hey eRIZ,
> *
> *
> *Re: php accelerator - APC.*
> *
> *
> *Re: I/O ops number per second - I've not looked into this in detail yet
> - I'll take a look and report back - from running top I can see my wait
> time fluctuating above 20% quite often but then drops to 6-7%*
> *
> *
> *Ed*
> *
> *
> *
> *
>
> On Monday, October 22, 2012 1:09:19 PM UTC+1, eRIZ wrote:
>>
>> What is yours I/O ops number per second? Have you any PHP accelerator
>> installed?
>> On Oct 22, 2012 2:06 PM, "ct_roy" <colm...@gmail.com> wrote:
>>
>>> Hi folks,
>>>
>>> Getting reasonably frequent upstream timeouts in my nginx error logs:
>>>
>>> *45896 upstream timed out (110: Connection timed out) while reading
>>> response header from upstream, client: 127.0.0.1
>>>
>>> The site in question is a Magento powered shop with fairly low/moderate
>>> traffic (few thousand visits per day)
>>>
>>> My setup
>>>
>>> - VPS with 4GB RAM, 8 core CPU
>>> - ubuntu 12.04
>>> - nginx 1.2.1 w/ extras
>>> - php-fpm 5.3.10 w/ suhosin v0.9.33
>>> - apc
>>> - mysql 5.5.24
>>>
>>> fairly standard static PM settings:
>>>
>>> pm.max_children = 15
>>> pm.max_requests = 500
>>>
>>> I know Magento is slow. But surely this spec of a machine shouldn't be
>>> getting upstream timeouts with so little traffic?
>>>
>>> I've plenty of RAM left in the tank - machine never goes over 60% usage.
>>>
>>> I do see some CPU spikes and monit sends me alerts telling me the load
>>> average hits > 2.0 quite a lot.
>>>
>>> Any useful tips for helping me to being diagnosing what to tweak/change
>>> to reduce these upstream timeouts?
>>>
>>> Ed
>>>
>>
Felipe
Re: Upstream timeouts
October 22, 2012 09:24AM
Try to put these parameters on FastCgiExternalServer line

-appConnTimeout 10 -idle-timeout 60

Example:
FastCgiExternalServer /var/run/fastcgi/myapp-fcgi -appConnTimeout 10
-idle-timeout 60 -socket /var/run/fastcgi/myapp.socket -pass-header
Authorization

2012/10/22 Przemysław Pawliczuk <p.pawliczuk@gmail.com>

> How about buffers set up in configuration? Have you tried increasing them?
> Magento is a quite huge application and I suspect that the accelerator
> can't cache all necessary files due to the insufficient buffer size.
>
> Ps. Don't forget to reload pool after changing. (;
> On Oct 22, 2012 3:02 PM, "ct_roy" <colmtroy@gmail.com> wrote:
>
>> Hey eRIZ,
>> *
>> *
>> *Re: php accelerator - APC.*
>> *
>> *
>> *Re: I/O ops number per second - I've not looked into this in detail yet
>> - I'll take a look and report back - from running top I can see my wait
>> time fluctuating above 20% quite often but then drops to 6-7%*
>> *
>> *
>> *Ed*
>> *
>> *
>> *
>> *
>>
>> On Monday, October 22, 2012 1:09:19 PM UTC+1, eRIZ wrote:
>>>
>>> What is yours I/O ops number per second? Have you any PHP accelerator
>>> installed?
>>> On Oct 22, 2012 2:06 PM, "ct_roy" <colm...@gmail.com> wrote:
>>>
>>>> Hi folks,
>>>>
>>>> Getting reasonably frequent upstream timeouts in my nginx error logs:
>>>>
>>>> *45896 upstream timed out (110: Connection timed out) while reading
>>>> response header from upstream, client: 127.0.0.1
>>>>
>>>> The site in question is a Magento powered shop with fairly low/moderate
>>>> traffic (few thousand visits per day)
>>>>
>>>> My setup
>>>>
>>>> - VPS with 4GB RAM, 8 core CPU
>>>> - ubuntu 12.04
>>>> - nginx 1.2.1 w/ extras
>>>> - php-fpm 5.3.10 w/ suhosin v0.9.33
>>>> - apc
>>>> - mysql 5.5.24
>>>>
>>>> fairly standard static PM settings:
>>>>
>>>> pm.max_children = 15
>>>> pm.max_requests = 500
>>>>
>>>> I know Magento is slow. But surely this spec of a machine shouldn't be
>>>> getting upstream timeouts with so little traffic?
>>>>
>>>> I've plenty of RAM left in the tank - machine never goes over 60% usage.
>>>>
>>>> I do see some CPU spikes and monit sends me alerts telling me the load
>>>> average hits > 2.0 quite a lot.
>>>>
>>>> Any useful tips for helping me to being diagnosing what to tweak/change
>>>> to reduce these upstream timeouts?
>>>>
>>>> Ed
>>>>
>>>


--
Atenciosamente;
Felipe Braz
Linux User # 323052
Re: Upstream timeouts
October 22, 2012 09:28AM
Re: buffers - this was my next avenue of investigation :)

When we talk about buffers are we talking about nginx or php buffers - or
both??


On Monday, October 22, 2012 2:06:02 PM UTC+1, eRIZ wrote:
>
> How about buffers set up in configuration? Have you tried increasing them?
> Magento is a quite huge application and I suspect that the accelerator
> can't cache all necessary files due to the insufficient buffer size.
>
> Ps. Don't forget to reload pool after changing. (;
> On Oct 22, 2012 3:02 PM, "ct_roy" <colm...@gmail.com <javascript:>> wrote:
>
>> Hey eRIZ,
>> *
>> *
>> *Re: php accelerator - APC.*
>> *
>> *
>> *Re: I/O ops number per second - I've not looked into this in detail yet
>> - I'll take a look and report back - from running top I can see my wait
>> time fluctuating above 20% quite often but then drops to 6-7%*
>> *
>> *
>> *Ed*
>> *
>> *
>> *
>> *
>>
>> On Monday, October 22, 2012 1:09:19 PM UTC+1, eRIZ wrote:
>>>
>>> What is yours I/O ops number per second? Have you any PHP accelerator
>>> installed?
>>> On Oct 22, 2012 2:06 PM, "ct_roy" <colm...@gmail.com> wrote:
>>>
>>>> Hi folks,
>>>>
>>>> Getting reasonably frequent upstream timeouts in my nginx error logs:
>>>>
>>>> *45896 upstream timed out (110: Connection timed out) while reading
>>>> response header from upstream, client: 127.0.0.1
>>>>
>>>> The site in question is a Magento powered shop with fairly low/moderate
>>>> traffic (few thousand visits per day)
>>>>
>>>> My setup
>>>>
>>>> - VPS with 4GB RAM, 8 core CPU
>>>> - ubuntu 12.04
>>>> - nginx 1.2.1 w/ extras
>>>> - php-fpm 5.3.10 w/ suhosin v0.9.33
>>>> - apc
>>>> - mysql 5.5.24
>>>>
>>>> fairly standard static PM settings:
>>>>
>>>> pm.max_children = 15
>>>> pm.max_requests = 500
>>>>
>>>> I know Magento is slow. But surely this spec of a machine shouldn't be
>>>> getting upstream timeouts with so little traffic?
>>>>
>>>> I've plenty of RAM left in the tank - machine never goes over 60% usage.
>>>>
>>>> I do see some CPU spikes and monit sends me alerts telling me the load
>>>> average hits > 2.0 quite a lot.
>>>>
>>>> Any useful tips for helping me to being diagnosing what to tweak/change
>>>> to reduce these upstream timeouts?
>>>>
>>>> Ed
>>>>
>>>
Re: Upstream timeouts
October 22, 2012 09:32AM
Hey Vid,

My fastcgi_params file - it's pretty much the stock params file:

http://pastebin.com/XBF9jaUq

On Monday, October 22, 2012 1:58:51 PM UTC+1, Vid Luther wrote:
>
> are you sure that the php script itself isn't timing out in terms of
> hitting max execution time?
> can you share your nginx fastcgi_params?
>
> --
> Vid Luther
> Sent with Sparrow http://www.sparrowmailapp.com/?sig
>
> On Monday, October 22, 2012 at 7:57 AM, ct_roy wrote:
>
> Hey Felipe,
>
> Thanks for your input.
>
> I've switched between sockets and tcp and found no real difference - the
> problem persists with both.
>
> Ed
>
> On Monday, October 22, 2012 1:16:49 PM UTC+1, Felipe Braz wrote:
>
> You are using the communication between nginx and php-fpm via tcp?
>
> Unix sockets are much much faster and have less incidence of problems.
>
> We have many shared servers with around 1000 domains each, and many use
> Magento without any problems.
>
> []'s
>
> 2012/10/22 Przemysław Pawliczuk <p.paw...@gmail.com>
>
> What is yours I/O ops number per second? Have you any PHP accelerator
> installed?
> On Oct 22, 2012 2:06 PM, "ct_roy" <colm...@gmail.com> wrote:
>
> Hi folks,
>
> Getting reasonably frequent upstream timeouts in my nginx error logs:
>
> *45896 upstream timed out (110: Connection timed out) while reading
> response header from upstream, client: 127.0.0.1
>
> The site in question is a Magento powered shop with fairly low/moderate
> traffic (few thousand visits per day)
>
> My setup
>
> - VPS with 4GB RAM, 8 core CPU
> - ubuntu 12.04
> - nginx 1.2.1 w/ extras
> - php-fpm 5.3.10 w/ suhosin v0.9.33
> - apc
> - mysql 5.5.24
>
> fairly standard static PM settings:
>
> pm.max_children = 15
> pm.max_requests = 500
>
> I know Magento is slow. But surely this spec of a machine shouldn't be
> getting upstream timeouts with so little traffic?
>
> I've plenty of RAM left in the tank - machine never goes over 60% usage.
>
> I do see some CPU spikes and monit sends me alerts telling me the load
> average hits > 2.0 quite a lot.
>
> Any useful tips for helping me to being diagnosing what to tweak/change to
> reduce these upstream timeouts?
>
> Ed
>
>
>
>
> --
> Atenciosamente;
> Felipe Braz
> Linux User # 323052
>
>
>
Re: Upstream timeouts
October 22, 2012 12:10PM
Have you seen this page? http://wiki.nginx.org/HttpFastcgiModule

Things you may want to mess with are below.. read that page, understand what the vars mean and apply for your app accordingly.


fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 1200;
fastcgi_max_temp_file_size 0;


fastcgi_buffers 512 32k;
fastcgi_buffer_size 64k;




--
Vid Luther
CEO and Founder
ZippyKid - WordPress Hosting for Businesses
https://www.zippykid.com/
210-789-0369


On Monday, October 22, 2012 at 8:29 AM, ct_roy wrote:

> Hey Vid,
>
> My fastcgi_params file - it's pretty much the stock params file:
>
> http://pastebin.com/XBF9jaUq
>
> On Monday, October 22, 2012 1:58:51 PM UTC+1, Vid Luther wrote:
> > are you sure that the php script itself isn't timing out in terms of hitting max execution time?
> > can you share your nginx fastcgi_params?
> >
> >
> > --
> > Vid Luther
> > Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
> >
> >
> > On Monday, October 22, 2012 at 7:57 AM, ct_roy wrote:
> >
> > > Hey Felipe,
> > >
> > > Thanks for your input.
> > >
> > > I've switched between sockets and tcp and found no real difference - the problem persists with both.
> > >
> > > Ed
> > >
> > > On Monday, October 22, 2012 1:16:49 PM UTC+1, Felipe Braz wrote:
> > > > You are using the communication between nginx and php-fpm via tcp?
> > > >
> > > > Unix sockets are much much faster and have less incidence of problems.
> > > >
> > > > We have many shared servers with around 1000 domains each, and many use Magento without any problems.
> > > >
> > > > []'s
> > > >
> > > > 2012/10/22 Przemysław Pawliczuk <p.paw...@gmail.com>
> > > > > What is yours I/O ops number per second? Have you any PHP accelerator installed?
> > > > > On Oct 22, 2012 2:06 PM, "ct_roy" <colm...@gmail.com> wrote:
> > > > > > Hi folks,
> > > > > >
> > > > > > Getting reasonably frequent upstream timeouts in my nginx error logs:
> > > > > >
> > > > > > *45896 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1
> > > > > >
> > > > > > The site in question is a Magento powered shop with fairly low/moderate traffic (few thousand visits per day)
> > > > > >
> > > > > > My setup
> > > > > >
> > > > > > - VPS with 4GB RAM, 8 core CPU
> > > > > > - ubuntu 12.04
> > > > > > - nginx 1.2.1 w/ extras
> > > > > > - php-fpm 5.3.10 w/ suhosin v0.9.33
> > > > > > - apc
> > > > > > - mysql 5.5.24
> > > > > >
> > > > > > fairly standard static PM settings:
> > > > > >
> > > > > > pm.max_children = 15
> > > > > > pm.max_requests = 500
> > > > > >
> > > > > > I know Magento is slow. But surely this spec of a machine shouldn't be getting upstream timeouts with so little traffic?
> > > > > >
> > > > > > I've plenty of RAM left in the tank - machine never goes over 60% usage.
> > > > > >
> > > > > > I do see some CPU spikes and monit sends me alerts telling me the load average hits > 2.0 quite a lot.
> > > > > >
> > > > > > Any useful tips for helping me to being diagnosing what to tweak/change to reduce these upstream timeouts?
> > > > > >
> > > > > > Ed
> > > >
> > > >
> > > > --
> > > > Atenciosamente;
> > > > Felipe Braz
> > > > Linux User # 323052
> >
Re: Upstream timeouts
October 25, 2012 11:12AM
Hey Vid,

Forgot to say thanks for the additional suggestions re: fastcgi buffers -
they're making a bit of a difference but I need to run some more tests to
optimize them further.

p..s. Just realised you run Zippykid! - heard great things :)

On Monday, October 22, 2012 5:09:26 PM UTC+1, Vid Luther wrote:
>
> Have you seen this page? http://wiki.nginx.org/HttpFastcgiModule
>
> Things you may want to mess with are below.. read that page, understand
> what the vars mean and apply for your app accordingly.
>
>
> fastcgi_connect_timeout 60;
> fastcgi_send_timeout 180;
> fastcgi_read_timeout 1200;
> fastcgi_max_temp_file_size 0;
>
>
> fastcgi_buffers 512 32k;
> fastcgi_buffer_size 64k;
>
>
>
> --
> Vid Luther
> CEO and Founder
> ZippyKid - WordPress Hosting for Businesses
> https://www.zippykid.com/
> 210-789-0369
>
> On Monday, October 22, 2012 at 8:29 AM, ct_roy wrote:
>
> Hey Vid,
>
> My fastcgi_params file - it's pretty much the stock params file:
>
> http://pastebin.com/XBF9jaUq
>
> On Monday, October 22, 2012 1:58:51 PM UTC+1, Vid Luther wrote:
>
> are you sure that the php script itself isn't timing out in terms of
> hitting max execution time?
> can you share your nginx fastcgi_params?
>
> --
> Vid Luther
> Sent with Sparrow http://www.sparrowmailapp.com/?sig
>
> On Monday, October 22, 2012 at 7:57 AM, ct_roy wrote:
>
> Hey Felipe,
>
> Thanks for your input.
>
> I've switched between sockets and tcp and found no real difference - the
> problem persists with both.
>
> Ed
>
> On Monday, October 22, 2012 1:16:49 PM UTC+1, Felipe Braz wrote:
>
> You are using the communication between nginx and php-fpm via tcp?
>
> Unix sockets are much much faster and have less incidence of problems.
>
> We have many shared servers with around 1000 domains each, and many use
> Magento without any problems.
>
> []'s
>
> 2012/10/22 Przemysław Pawliczuk <p.paw...@gmail.com>
>
> What is yours I/O ops number per second? Have you any PHP accelerator
> installed?
> On Oct 22, 2012 2:06 PM, "ct_roy" <colm...@gmail.com> wrote:
>
> Hi folks,
>
> Getting reasonably frequent upstream timeouts in my nginx error logs:
>
> *45896 upstream timed out (110: Connection timed out) while reading
> response header from upstream, client: 127.0.0.1
>
> The site in question is a Magento powered shop with fairly low/moderate
> traffic (few thousand visits per day)
>
> My setup
>
> - VPS with 4GB RAM, 8 core CPU
> - ubuntu 12.04
> - nginx 1.2.1 w/ extras
> - php-fpm 5.3.10 w/ suhosin v0.9.33
> - apc
> - mysql 5.5.24
>
> fairly standard static PM settings:
>
> pm.max_children = 15
> pm.max_requests = 500
>
> I know Magento is slow. But surely this spec of a machine shouldn't be
> getting upstream timeouts with so little traffic?
>
> I've plenty of RAM left in the tank - machine never goes over 60% usage.
>
> I do see some CPU spikes and monit sends me alerts telling me the load
> average hits > 2.0 quite a lot.
>
> Any useful tips for helping me to being diagnosing what to tweak/change to
> reduce these upstream timeouts?
>
> Ed
>
>
>
>
> --
> Atenciosamente;
> Felipe Braz
> Linux User # 323052
>
>
>
>
Re: Upstream timeouts
October 25, 2012 11:38AM
CT,
I'm glad that helped. Tweak those as you need, but if the defaults aren't working out for you for a vanilla install, then there may be a bigger issue.

PS: Glad you've heard good things about us :)



On Thursday, October 25, 2012 at 10:11 AM, ct_roy wrote:

> Hey Vid,
>
> Forgot to say thanks for the additional suggestions re: fastcgi buffers - they're making a bit of a difference but I need to run some more tests to optimize them further.
>
> p..s. Just realised you run Zippykid! - heard great things :)
>
> On Monday, October 22, 2012 5:09:26 PM UTC+1, Vid Luther wrote:
> > Have you seen this page? http://wiki.nginx.org/HttpFastcgiModule
> >
> > Things you may want to mess with are below.. read that page, understand what the vars mean and apply for your app accordingly.
> >
> >
> > fastcgi_connect_timeout 60;
> > fastcgi_send_timeout 180;
> > fastcgi_read_timeout 1200;
> > fastcgi_max_temp_file_size 0;
> >
> >
> > fastcgi_buffers 512 32k;
> > fastcgi_buffer_size 64k;
> >
> >
> >
> >
> > --
> > Vid Luther
> > CEO and Founder
> > ZippyKid - WordPress Hosting for Businesses
> > https://www.zippykid.com/
> > 210-789-0369
> >
> >
> > On Monday, October 22, 2012 at 8:29 AM, ct_roy wrote:
> >
> > > Hey Vid,
> > >
> > > My fastcgi_params file - it's pretty much the stock params file:
> > >
> > > http://pastebin.com/XBF9jaUq
> > >
> > > On Monday, October 22, 2012 1:58:51 PM UTC+1, Vid Luther wrote:
> > > > are you sure that the php script itself isn't timing out in terms of hitting max execution time?
> > > > can you share your nginx fastcgi_params?
> > > >
> > > >
> > > > --
> > > > Vid Luther
> > > > Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
> > > >
> > > >
> > > > On Monday, October 22, 2012 at 7:57 AM, ct_roy wrote:
> > > >
> > > > > Hey Felipe,
> > > > >
> > > > > Thanks for your input.
> > > > >
> > > > > I've switched between sockets and tcp and found no real difference - the problem persists with both.
> > > > >
> > > > > Ed
> > > > >
> > > > > On Monday, October 22, 2012 1:16:49 PM UTC+1, Felipe Braz wrote:
> > > > > > You are using the communication between nginx and php-fpm via tcp?
> > > > > >
> > > > > > Unix sockets are much much faster and have less incidence of problems.
> > > > > >
> > > > > > We have many shared servers with around 1000 domains each, and many use Magento without any problems.
> > > > > >
> > > > > > []'s
> > > > > >
> > > > > > 2012/10/22 Przemysław Pawliczuk <p.paw...@gmail.com>
> > > > > > > What is yours I/O ops number per second? Have you any PHP accelerator installed?
> > > > > > > On Oct 22, 2012 2:06 PM, "ct_roy" <colm...@gmail.com> wrote:
> > > > > > > > Hi folks,
> > > > > > > >
> > > > > > > > Getting reasonably frequent upstream timeouts in my nginx error logs:
> > > > > > > >
> > > > > > > > *45896 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1
> > > > > > > >
> > > > > > > > The site in question is a Magento powered shop with fairly low/moderate traffic (few thousand visits per day)
> > > > > > > >
> > > > > > > > My setup
> > > > > > > >
> > > > > > > > - VPS with 4GB RAM, 8 core CPU
> > > > > > > > - ubuntu 12.04
> > > > > > > > - nginx 1.2.1 w/ extras
> > > > > > > > - php-fpm 5.3.10 w/ suhosin v0.9.33
> > > > > > > > - apc
> > > > > > > > - mysql 5.5.24
> > > > > > > >
> > > > > > > > fairly standard static PM settings:
> > > > > > > >
> > > > > > > > pm.max_children = 15
> > > > > > > > pm.max_requests = 500
> > > > > > > >
> > > > > > > > I know Magento is slow. But surely this spec of a machine shouldn't be getting upstream timeouts with so little traffic?
> > > > > > > >
> > > > > > > > I've plenty of RAM left in the tank - machine never goes over 60% usage.
> > > > > > > >
> > > > > > > > I do see some CPU spikes and monit sends me alerts telling me the load average hits > 2.0 quite a lot.
> > > > > > > >
> > > > > > > > Any useful tips for helping me to being diagnosing what to tweak/change to reduce these upstream timeouts?
> > > > > > > >
> > > > > > > > Ed
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Atenciosamente;
> > > > > > Felipe Braz
> > > > > > Linux User # 323052
> > > >
> >
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 241
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready