Welcome! Log In Create A New Profile

Advanced

Re: Some times header cannot be sent due too high traffic

Lord Nynex
September 25, 2015 01:40PM
Hello,

I'm just guessing here, but it sounds like the connection is closed before
the headers are sent. This is a common problem unrelated to nginx (unless
your module has some sort of serious performance issue elsewhere). This is
especially common for requests generated by mobile clients who's networks
are often unavailable.

The thing that stands out to me is your conditional to catch errors is very
similar to the conditional used in ngx_http_request.c, hoever, it's missing
NGX_HTTP_CLIENT_CLOSED_REQUEST. If this is the case, your condition is
satisfied because NGX_HTTP_CLIENT_CLOSED_REQUEST is > NGX_OK. I recommend
you amend your logging to include more information about why the request
has failed.

If you find that NGX_HTTP_CLIENT_CLOSED_REQUEST is returned, I would look
for culprits elsewhere. Perhaps the load is greater than the server/kernels
link speed?

On Thu, Sep 24, 2015 at 2:18 AM, Hung Nguyen <hungnv@opensource.com.vn>
wrote:

> Hello,
>
> In my module I do something like this:
>
> nlog->action = "sending file to client";
> r->headers_out.status = NGX_HTTP_OK;
> r->headers_out.content_length_n = bucket->content_length;
> r->headers_out.last_modified_time = of.mtime;
> r->headers_out.content_type.len = sizeof ("text/html") - 1;
> r->headers_out.content_type.data = (u_char *) "text/html";
> rc = ngx_http_send_header(r);
> if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
> ngx_log_error(NGX_LOG_ALERT, nlog, ngx_errno, ngx_close_file_n
> "ngx_http_send_header failed");
> return rc;
> }
>
>
>
> it’s ok when traffic is low, but when there are many user request to
> nginx, error log is full of these similar errors:
>
> 2015/09/17 08:57:16 [alert] 9915#0: *5205 close()ngx_http_send_header
> failed while sending file to client, client: 127.0.0.1, server: my.local,
> request: "GET
> /slides/128553.pdf?secl=LMz1w4xNwd9pt_88-ROxkw&sect=1442496276 HTTP/1..0",
> host: “m http://kvazar.china-cdn88nmbwacdnln8hq8qwe.comy.server..com",
> referrer: "http://my.server.com/uppod.swf http://uakino.net/uppod.swf”
>
>
>
>
> Is this a normal behavior, or there much be something wrong in my module
> cause nginx cannot send header to client?
>
>
> Thanks,
>
> Hưng
>
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Some times header cannot be sent due too high traffic

Hung Nguyen 869 September 24, 2015 05:20AM

Re: Some times header cannot be sent due too high traffic

Lord Nynex 433 September 25, 2015 01:40PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 216
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready