Hi.

nginx has got an
proxy_read_timeout<http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout>
parameter
that you can change.



On 10 April 2014 19:38, Scott <[email protected]> wrote:

> I have started experiencing errors in my nginx log that says "upstream
> prematurely closed connection while reading response header from upstream."
> Upstream (reverse-proxy to hypnotoad) would be my Mojolicious app I assume.
> I have had user reports of gateway errors and I have experienced that as
> well.
>
> The specific app is a Mojolicious/Mango app written to be non-blocking.
> The MongoDB server is on the same machine, but I thought under load it may
> block so I wrote the app to be non-blocking. It is an online test where at
> end of day the overall usage is light, but it can get hit somewhat heavy
> during a test. The controller methods during the test each use a Mango read
> followed by a Mango write using Mojo::IO::Delay steps so they are
> sequential.
>
> I adjusted nginx and hypnotoad settings but it did not help. I upped the
> system ulimit for open files (MongoDB suggestion), but it did not help. I
> changed the code back to blocking and the errors greatly reduced (3 an hour
> vs 50+), but have not stopped completely.
>
> *Obviously, I am dangerous.* Was the mango read followed by a write each
> within a delay step not the proper use? I have a feeling that at times they
> were not sequential (or the read did not occur). And if it still happens
> with blocking code, the blocking is causing a timeout? Is there a way to
> increase the timeout between nginx and the hypnotoad app?
>
> Thanks, skiehn
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Pelle

Research is what I'm doing when I don't know what I'm doing.
- Wernher von Braun

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to