2011年3月20日星期日

Re: 504 error Gateway Timeout.

Fine. But please note, this is only part of configuration. There are
some files regarding to directive:
/etc/nginx/vhosts/*

Please include them also.

--
Regards, Vitaly Tskhovrebov
System Administrator
U.S. +1 (206) 905-9939
Russia +7 911 094-2035

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: 504 error Gateway Timeout.

maybe is apache or php close the connection, for example exceed php max
file upload size or php max running time.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183412,184120#msg-184120


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: 504 error Gateway Timeout.

> http {

proxy_read_timeout 600;
proxy_send_timeout 600;

>  server_name_in_redirect off;
>  server_names_hash_max_size 2048;
>  server_names_hash_bucket_size 256;


I added the above proxy read and proxy send lines. I had just
reinstalled this morning after doing some testing and accidentally
sent you the file without those added.

Thanks,

Jamie

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

2011年3月19日星期六

Re: Status 401 Behaviour Issue

> Hi there,
>
> > I noticed a certain behaviour of the 401 status
> code response I will like to change.
>
> > With Nginx however, if I define an html page
> error_page for 401, this gets served every time a
> user requests the protected directory and there is
> no opportunity to fill in the authentication
> details.
>
> That sounds odd to me.
>
> What *should* happen is the web server returns
> http 401 with some body
> content; the web browser chooses whether to
> display that body content,
> or to request authentication credentials, as it
> sees fit.
>
> What is your error_page config?
>
> Quick testing here shows that
>
> error_page 401 /401.html;
>
> returns the right content with the right status,
> as I would expect.
>
> error_page 401 = /401.html;
>
> returns the right content, but with a http 200
> status, which sounds like
> it matches what you are seeing.
>
> As per
> http://wiki.nginx.org/HttpCoreModule#error_page,
> adding the
> "=" means "handle this (sub)request, and change
> the return status to
> whatever it generates instead of what we started
> with". For 401, you
> probably don't want that.
>
> > Is it possible to set it up such that it behaves
> like Apache does? I.E. only return the html
> error_page if the authentication fails? This seems
> like a better implementation to me.
>
> Leave out the "="?
>
> > Running 0.8.54
>
> I tested with 0.9.4, but I don't see any obvious
> code fixes that would
> have changed this.

Hi. Thanks for that.

Yep, the second config was what was causing it for me. It didn't
"matter" with the other codes as there is no further processing to be
done and users saw the right pages for the circumstances. Does also
explain why my caching config for error pages did no quite work
properly.

In summary, after rereading the docs properly

1. "error_page code url" means return "code" and show "url"
2. "error_page code =anycode url" means return "anycode" and show "url"
3. "error_page code = url" means redirect to this url whenever "code" is
encountered. A "200 OK" response is returned if "url" is found.

Thanks again for helping me get to understand this better

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,184007,184098#msg-184098


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Status 401 Behaviour Issue

On Sat, Mar 19, 2011 at 03:03:11PM -0400, Dayo wrote:

Hi there,

> I noticed a certain behaviour of the 401 status code response I will like to change.

> With Nginx however, if I define an html page error_page for 401, this gets served every time a user requests the protected directory and there is no opportunity to fill in the authentication details.

That sounds odd to me.

What *should* happen is the web server returns http 401 with some body
content; the web browser chooses whether to display that body content,
or to request authentication credentials, as it sees fit.

What is your error_page config?

Quick testing here shows that

error_page 401 /401.html;

returns the right content with the right status, as I would expect.

error_page 401 = /401.html;

returns the right content, but with a http 200 status, which sounds like
it matches what you are seeing.

As per http://wiki.nginx.org/HttpCoreModule#error_page, adding the
"=" means "handle this (sub)request, and change the return status to
whatever it generates instead of what we started with". For 401, you
probably don't want that.

> Is it possible to set it up such that it behaves like Apache does? I.E. only return the html error_page if the authentication fails? This seems like a better implementation to me.

Leave out the "="?

> Running 0.8.54

I tested with 0.9.4, but I don't see any obvious code fixes that would
have changed this.

All the best,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: 100% CPU Usage (on all 8 cores)

Nevermind... I have sorted this issue out and will post the resolution
when I confirm its not crashing my server anymore.

Thank you very much for replying :)

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183858,184052#msg-184052


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

nginx reverse proxy must understand lighttpd rewrite rules

Hi,

Server 1: got lighttpd with rewrite rules (lighttpd rewrite rules)
Server 2: got reverse proxy (no rewrite rules)

When on server 2 as proxy serving lighttpd i dont have any rules in its
config and it still understand what server 1 sending and serving as it
would have rewrite rules.

Problem arise when i switch on Server 2 lighttpd to nginx. Nginx serving
pages but doing 404 for rewrite pages received from Server 1.
Do i must convert rewrite rules from lighttpd on Server 1 and place it
in Server 2 nginx configuration to make nginx understand rewrites?

Or problem is somewhere else.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,184048,184048#msg-184048


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: 100% CPU Usage (on all 8 cores)

On 3/19/11 3:18 PM, kthxbai2u wrote:
> I have done some more debugging, and it appears the issue is with the VHosts... As soon as I comment out this line:
>
> include "/etc/nginx/vhosts/*";
>
> and restart nginx, htop reports normal usage. CPU + Mem all fine.
>
> I think I am going to poke around a bit more, but it seems there is a problem with the way NginX converts apache VirtualHosts to NginX VirtualHosts.

This is an interesting feature that I have never used. Can you explain
how nginx does this "conversion". Most of write our own configuration
files. Are you using a commercial prodict?

>
> Oh another thing, the errors that should be ignorable are actually not ignorable... They all dissappeared. My guess is that someone went around telling people they can ignore errors like this:
>
> nginx: [warn] conflicting server name "79.142.67.113" on 79.142.67.113:80, ignored
> nginx: [warn] conflicting server name "79.142.67.113" on 79.142.67.113:80, ignored
> nginx: [warn] conflicting server name "79.142.67.113" on 79.142.67.113:80, ignored
> nginx: [warn] conflicting server name "79.142.67.113" on 79.142.67.113:80, ignored
> nginx: [warn] conflicting server name "79.142.67.113" on 79.142.67.113:80, ignored
> nginx: [warn] conflicting server name "79.142.67.113" on 79.142.67.113:80, ignored
> nginx: [warn] conflicting server name "79.142.67.113" on 79.142.67.113:80, ignored

This means nginx is ignoring your conflicting server names and not
incorporating them at run time. This is your clue.

> nginx: [emerg] bind() to 79.142.67.110:80 failed (98: Address already in use)
> nginx: [emerg] bind() to 79.142.67.113:80 failed (98: Address already in use)
> nginx: [emerg] bind() to 79.142.67.112:80 failed (98: Address already in use)
> nginx: [emerg] bind() to 79.142.67.110:80 failed (98: Address already in use)
> nginx: [emerg] bind() to 79.142.67.113:80 failed (98: Address already in use)
> nginx: [emerg] bind() to 79.142.67.112:80 failed (98: Address already in use)
> nginx: [emerg] bind() to 79.142.67.110:80 failed (98: Address already in use)


Please run lsof -i :80 | grep -v nginx

This should tell you what other processes are bound to port 80.

>
>
> Those errors can NOT be ignored, according to my findings... Oh and by the way thats only half the errors, but they all seem to be the same or similair to those ones.
>
> Is there any 3rd party tool to convert Apache VHosts to NginX Vhosts? I am googling as we speak :)

Again, I think you are using one. Or believe that you are.

>
> Thanks for your help, it seems you may have nudged me in the right direction :)
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183858,184011#msg-184011
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx


--
Jim Ohlstein

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: 100% CPU Usage (on all 8 cores)

On Sat, 19 Mar 2011, kthxbai2u wrote:

> Oh another thing, the errors that should be ignorable are actually not
> ignorable... They all dissappeared. My guess is that someone went around
> telling people they can ignore errors like this:
>
> nginx: [warn] conflicting server name "79.142.67.113" on 79.142.67.113:80, ignored
> nginx: [warn] conflicting server name "79.142.67.113" on 79.142.67.113:80, ignored
You are drawing the wrong conclusion here.

It is nginx telling yout that nginx is ignoring the conflicting server
names and continuing.

Grep for your server names in your generated config files that is where
you should start to figure out what went wrong in the conversion.

/Chris

--
http://www.arnold.se/chris/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: 100% CPU Usage (on all 8 cores)

On 3/19/11 2:28 PM, kthxbai2u wrote:

This is too rich for me to not take a stab.

>> <sarcasm>
>> Congratulations
>> It's really difficult to get 100% efficiency for
>> modern code - this is
>> truly scalable
>> </sarcasm>
>
> Sorry not sure what you mean here...

Google "sarcasm"

But the whole deal was that nginx is BETTER than apache, not worse. You
ework for nginx,

I'm guessing you think he "works" for nginx. Bad ASSumption. nginx is
FOSS. Google "FOSS" if you don't know what that means.

> I thought you would know that? With apache, the server load is normal, but the server responds slow (20 sec. pg loads).
>
> As soon as i put nginx in, server load is 100%. It responds lightning fast (< 5 seconds), but after a while it crashes and I need to reboot.
>
> I know this is not the way nginx performs. There is something wrong with it, or the config. Whole deal is, this was supposedly a script to install and get nginx working, and as it seems, 60% of users with multiple IP's and a shared host are reporting issues like mine. (not able to bind, etc)
>
>> The server went offline and needed a reboot not
>> because a userland
>> application misbehaved, but there is a problem at
>> the kernel level which
>> isn't normally exposed.
>
> Your blaming this on CentOS? CentOS works fine. Always has.
>
>> Why not debug the httpd.conf and or post more
>> meaningful details - Like
>> a pastie of the config or some way for others to
>> reproduce it? I can't
>> help directly, but I hope this helps get you on
>> track to get help..
>
> If nginx had told me there were errors in the config, maybe I would debug it. Because it says each error (ignored) and NginX staff have told others they can ignore it, shouldn't I ignore those errors? Which config would you like to see? The 30+ vhost files that nginx made? or the httpd.conf from apache? Either way it is kind of an insane request to have such private, sensitive configuration data posted for the whole WWW to see....
>

How is he to help you without the information? You can conceal sensitive
information if need be.

> Especially asking a webhost to do so...

Do you think that you're the only "webhost" to try to get help here?

> If you want this kind of information, I could email it to you, or I can get you access to the server. The forum really should have a PM system, which would save me having to email you, but of course it doesnt :)

"This forum" (of which I just happen to be the webmaster) is merely a
gateway to a mailing list. Please look carefully at the name of the
specific forum in which you are posting and its description. You will
see that it is "Nginx Mailing List - English A portal to and from from
the mailing list.". Most mailing list users do not use the forum and
vice versa. A PM system to the person who *tried* to help you would have
been rejected for that very reason. This is why I *intentionally* turned
off the PM system.

>
> NginX worked before, it should work again...

It does work. The problem is with your configuration. That's why you
were asked to post it.

>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183858,183994#msg-183994
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx


--
Jim Ohlstein

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: active connection counter always increased (nginx 0.8.54)

i have 4 nginx and the same configuration use lvs dr load balance, two of them have this problem:
Active connections: 4476
server accepts handled requests
27097803 27097803 27064329
Reading: 1959 Writing: 2517 Waiting: 0
# netstat -an | wc -l
459

and the normal server:
Active connections: 8
server accepts handled requests
58386943 58386943 58312509
Reading: 2 Writing: 6 Waiting: 0
# netstat -an | wc -l
1104

These two error server have the same kernel version:
Linux abc.com 2.6.9-78.ELsmp #1 SMP Wed Jul 9 15:46:26 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux

I do not know where it went wrong.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,182264,184016#msg-184016


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Status 401 Behaviour Issue

> Do u mean a 403?
No, 401 as written.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,184007,184015#msg-184015


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Status 401 Behaviour Issue

Do u mean a 403?

On 3/19/11, Dayo <nginx-forum@nginx.us> wrote:
> Hi all.
>
> I noticed a certain behaviour of the 401 status code response I will like to
> change.
>
> Firstly, in Apache, there is an html page for 401 that is defined in the
> error_page equivalent. When the request for a protected directory comes in,
> the user gets the form for the authentication and only if the authentication
> fails is that html page served.
>
> With Nginx however, if I define an html page error_page for 401, this gets
> served every time a user requests the protected directory and there is no
> opportunity to fill in the authentication details.
>
> Is it possible to set it up such that it behaves like Apache does? I.E. only
> return the html error_page if the authentication fails? This seems like a
> better implementation to me.
>
> Running 0.8.54
>
> Thanks
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,184007,184007#msg-184007
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

--
Sent from my mobile device

Payam Tarverdyan Chychi
Network Security Specialist / Network Engineer

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: 100% CPU Usage (on all 8 cores)

I have done some more debugging, and it appears the issue is with the VHosts... As soon as I comment out this line:

include "/etc/nginx/vhosts/*";

and restart nginx, htop reports normal usage. CPU + Mem all fine.

I think I am going to poke around a bit more, but it seems there is a problem with the way NginX converts apache VirtualHosts to NginX VirtualHosts.

Oh another thing, the errors that should be ignorable are actually not ignorable... They all dissappeared. My guess is that someone went around telling people they can ignore errors like this:

nginx: [warn] conflicting server name "79.142.67.113" on 79.142.67.113:80, ignored
nginx: [warn] conflicting server name "79.142.67.113" on 79.142.67.113:80, ignored
nginx: [warn] conflicting server name "79.142.67.113" on 79.142.67.113:80, ignored
nginx: [warn] conflicting server name "79.142.67.113" on 79.142.67.113:80, ignored
nginx: [warn] conflicting server name "79.142.67.113" on 79.142.67.113:80, ignored
nginx: [warn] conflicting server name "79.142.67.113" on 79.142.67.113:80, ignored
nginx: [warn] conflicting server name "79.142.67.113" on 79.142.67.113:80, ignored
nginx: [emerg] bind() to 79.142.67.110:80 failed (98: Address already in use)
nginx: [emerg] bind() to 79.142.67.113:80 failed (98: Address already in use)
nginx: [emerg] bind() to 79.142.67.112:80 failed (98: Address already in use)
nginx: [emerg] bind() to 79.142.67.110:80 failed (98: Address already in use)
nginx: [emerg] bind() to 79.142.67.113:80 failed (98: Address already in use)
nginx: [emerg] bind() to 79.142.67.112:80 failed (98: Address already in use)
nginx: [emerg] bind() to 79.142.67.110:80 failed (98: Address already in use)


Those errors can NOT be ignored, according to my findings... Oh and by the way thats only half the errors, but they all seem to be the same or similair to those ones.

Is there any 3rd party tool to convert Apache VHosts to NginX Vhosts? I am googling as we speak :)

Thanks for your help, it seems you may have nudged me in the right direction :)

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183858,184011#msg-184011


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: 504 error Gateway Timeout.

>On Sat, Mar 19, 2011 at 1:49 PM, Vitaly Tskhovrebov <vt@chgk.info> wrote:
> This things should be fine. Please post your entire config.
> Regards, Vitaly Tskhovrebov
> System Administrator
> U.S. +1 (206) 905-9939
> Russia +7 911 094-2035

Thank You. This is my config file:

user nobody;
# no need for more workers in the proxy mode
worker_processes 4;
error_log /var/log/nginx/error.log info;
worker_rlimit_nofile 20480;
events {
worker_connections 5120; # increase for busier servers
use epoll; # you should use epoll here for Linux kernels 2.6.x
}
http {
server_name_in_redirect off;
server_names_hash_max_size 2048;
server_names_hash_bucket_size 256;
include mime.types;
default_type application/octet-stream;
server_tokens off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 60;
gzip on;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
gzip_proxied any;
gzip_http_version 1.1;
gzip_min_length 0;
gzip_comp_level 6;
gzip_buffers 16 8k;
# You can remove image/png image/x-icon image/gif image/jpeg if you
have slow CPU
gzip_types text/plain text/xml text/css application/x-javascript
application/xml image/png image/x-icon image/gif image/jpeg
application/xml+rss text/javascript application/atom+xml;
ignore_invalid_headers on;
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
reset_timedout_connection on;
connection_pool_size 256;
client_header_buffer_size 256k;
large_client_header_buffers 4 256k;
client_max_body_size 4M;
client_body_buffer_size 128k;
request_pool_size 32k;
output_buffers 4 32k;
postpone_output 1460;
proxy_temp_path /tmp/nginx_proxy/;
client_body_in_file_only on;
log_format bytes_log "$msec $bytes_sent .";
include "/etc/nginx/vhosts/*";
}


Regards;

Jamie

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Status 401 Behaviour Issue

Hi all.

I noticed a certain behaviour of the 401 status code response I will like to change.

Firstly, in Apache, there is an html page for 401 that is defined in the error_page equivalent. When the request for a protected directory comes in, the user gets the form for the authentication and only if the authentication fails is that html page served.

With Nginx however, if I define an html page error_page for 401, this gets served every time a user requests the protected directory and there is no opportunity to fill in the authentication details.

Is it possible to set it up such that it behaves like Apache does? I.E. only return the html error_page if the authentication fails? This seems like a better implementation to me.

Running 0.8.54

Thanks

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,184007,184007#msg-184007


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: 504 error Gateway Timeout.

This things should be fine. Please post your entire config.

--
Regards, Vitaly Tskhovrebov
System Administrator
U.S. +1 (206) 905-9939
Russia +7 911 094-2035

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: 100% CPU Usage (on all 8 cores)

Oh and sorry for the double post, but I believe its legal to say:

Thanks for your time :P

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183858,183995#msg-183995


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: 100% CPU Usage (on all 8 cores)

> <sarcasm>
> Congratulations
> It's really difficult to get 100% efficiency for
> modern code - this is
> truly scalable
> </sarcasm>

Sorry not sure what you mean here... But the whole deal was that nginx is BETTER than apache, not worse. You ework for nginx, I thought you would know that? With apache, the server load is normal, but the server responds slow (20 sec. pg loads).

As soon as i put nginx in, server load is 100%. It responds lightning fast (< 5 seconds), but after a while it crashes and I need to reboot.

I know this is not the way nginx performs. There is something wrong with it, or the config. Whole deal is, this was supposedly a script to install and get nginx working, and as it seems, 60% of users with multiple IP's and a shared host are reporting issues like mine. (not able to bind, etc)

> The server went offline and needed a reboot not
> because a userland
> application misbehaved, but there is a problem at
> the kernel level which
> isn't normally exposed.

Your blaming this on CentOS? CentOS works fine. Always has.

> Why not debug the httpd.conf and or post more
> meaningful details - Like
> a pastie of the config or some way for others to
> reproduce it? I can't
> help directly, but I hope this helps get you on
> track to get help..

If nginx had told me there were errors in the config, maybe I would debug it. Because it says each error (ignored) and NginX staff have told others they can ignore it, shouldn't I ignore those errors? Which config would you like to see? The 30+ vhost files that nginx made? or the httpd.conf from apache? Either way it is kind of an insane request to have such private, sensitive configuration data posted for the whole WWW to see....

Especially asking a webhost to do so... If you want this kind of information, I could email it to you, or I can get you access to the server. The forum really should have a PM system, which would save me having to email you, but of course it doesnt :)

NginX worked before, it should work again...

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183858,183994#msg-183994


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: async n/w logging

Compile your nginx with syslog support:
http://www.joeandmotorboat.com/2009/09/08/compiling-nginx-with-syslog-support/

Use syslog-ng feature to send packets to loghost.

Regards,
Vitaly Tskhovrebov

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

nginx resolver NGX_RESOLVE_SERVFAIL

Hi,

I have strange behavior for nginx when I'm getting:
.... .... .... 0010 = Reply code: Server failure (2)

All logs of my production is full of tries to resolve some domains where timeout happened
and proxying BIND returned (Server failure (2))

below is tcpdump for it.
# tcpdump -Nnni lo udp port 53
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo, link-type EN10MB (Ethernet), capture size 96 bytes
15:29:23.010072 IP 127.0.0.1.39498 > 127.0.0.1.53: 12118+ A? www.jsoftj.com. (32)
15:29:28.006177 IP 127.0.0.1.39498 > 127.0.0.1.53: 12118+ A? www.jsoftj.com. (32)
15:29:33.006157 IP 127.0.0.1.39498 > 127.0.0.1.53: 12118+ A? www.jsoftj.com. (32)
15:29:38.006155 IP 127.0.0.1.39498 > 127.0.0.1.53: 12118+ A? www.jsoftj.com. (32)
15:29:43.006162 IP 127.0.0.1.39498 > 127.0.0.1.53: 12118+ A? www.jsoftj.com. (32)
15:29:48.006400 IP 127.0.0.1.39498 > 127.0.0.1.53: 12118+ A? www.jsoftj.com. (32)
15:29:53.010832 IP 127.0.0.1.53 > 127.0.0.1.39498: 12118 ServFail 0/0/0 (32)
15:29:53.010904 IP 127.0.0.1.53 > 127.0.0.1.39498: 12118 ServFail 0/0/0 (32)
15:29:53.010980 IP 127.0.0.1.53 > 127.0.0.1.39498: 12118 ServFail 0/0/0 (32)
15:29:53.011036 IP 127.0.0.1.53 > 127.0.0.1.39498: 12118 ServFail 0/0/0 (32)
15:29:53.011072 IP 127.0.0.1.53 > 127.0.0.1.39498: 12118 ServFail 0/0/0 (32)
15:29:53.011098 IP 127.0.0.1.53 > 127.0.0.1.39498: 12118 ServFail 0/0/0 (32)

In nginx error.log I'm finding a lot messages as:
2011/03/18 16:20:42 [error] 15214#0: unexpected response for www.jsoftj.com
2011/03/18 16:20:42 [error] 15214#0: unexpected response for www.jsoftj.com
2011/03/18 16:20:42 [error] 15214#0: unexpected response for www.jsoftj.com
2011/03/18 16:20:42 [error] 15214#0: unexpected response for www.jsoftj.com
2011/03/18 16:20:42 [error] 15214#0: unexpected response for www.jsoftj.com
2011/03/18 16:20:42 [error] 15214#0: unexpected response for www.jsoftj.com

changing
if (code > NGX_RESOLVE_REFUSED) {
to
if (code > NGX_RESOLVE_REFUSED || NGX_RESOLVE_SERVFAIL ) {
in ngx_resolver_process_response
is solving problem.
Is it bug or feature :) ?
or what the best way to solve this issue?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183857,183857#msg-183857


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Running nginx as reverse proxy with Apache, rewrite problem

Thanks so much guys. It worked great.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183798,183905#msg-183905


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

2011年3月18日星期五

async n/w logging

Is there some module that tries to log messages (access log) over the
network by plugging into the core event loop?

I am use Boost.ASIO, GIO of glib etc. etc. but they all start their own
event loop.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: 100% CPU Usage (on all 8 cores)

kthxbai2u wrote:
> I have installed NGinX and struggled getting the server to work. It apparantly converts the httpd.conf and ports them to nginx vhosts. As many would know, the server upon starting would error out and die.
>
> I have sorted that issue out, now the server actually starts, and pages load. There is only one problem... My CPU is 100% load (on all 8 cores)
>
> See for yourself:
> [img] http://i51.tinypic.com/34zaphe.jpg [/img]
>
> The server actually went offline and needed a reboot because of this...
>
<sarcasm>
Congratulations
It's really difficult to get 100% efficiency for modern code - this is
truly scalable
</sarcasm>

The server went offline and needed a reboot not because a userland
application misbehaved, but there is a problem at the kernel level which
isn't normally exposed.

Why not debug the httpd.conf and or post more meaningful details - Like
a pastie of the config or some way for others to reproduce it? I can't
help directly, but I hope this helps get you on track to get help..


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Running nginx as reverse proxy with Apache, rewrite problem

On 18 Mar 2011 20h30 WET, nginx-forum@nginx.us wrote:

> Try:
>
> Server {
> server_name site.com; listen 80; root
> /path/to/regular/content/; if ($http_user_agent ~*
> (mobile|android|blackberry|brew|htc|j2me|lg|midp|mot|netfront|nokia|obigo|openweb|opera\smini|palm|psp|samsung|sanyo|sch|sonyericsson|symbian|symbos|teleca|up.browser|wap|webos|windows\sce)
> ) {
> rewrite ^ http://mobile.site.com$request_uri redirect;

Remember to add '?' at the end, otherwise you risk repeating the
query arguments.

Should be: rewrite ^ http://mobile.site.com$request_uri? redirect;

Ditto for the mobile.site.com server.

> }
> location /xyz/ {
> ...
> }
> }
>
> Server {
> server_name mobile.site.com; listen 80; root
> /path/to/mobile/content/; if ($http_user_agent !~*
> (mobile|android|blackberry|brew|htc|j2me|lg|midp|mot|netfront|nokia|obigo|openweb|opera\smini|palm|psp|samsung|sanyo|sch|sonyericsson|symbian|symbos|teleca|up.browser|wap|webos|windows\sce)
> ) {
> rewrite ^ http://site.com$request_uri redirect;
This: rewrite ^ http://site.com$request_uri? redirect;
> }
> location /xyz/ {
> ...
> }
> }
--- appa

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

100% CPU Usage (on all 8 cores)

I have installed NGinX and struggled getting the server to work. It apparantly converts the httpd.conf and ports them to nginx vhosts. As many would know, the server upon starting would error out and die.

I have sorted that issue out, now the server actually starts, and pages load. There is only one problem... My CPU is 100% load (on all 8 cores)

See for yourself:
[img] http://i51.tinypic.com/34zaphe.jpg [/img]

The server actually went offline and needed a reboot because of this...

I confirmed it was nginx causing this, by dropping services one by one (mysql, ftp, ssh, etc.) and the load stayed there until nginx was stopped.

Any Ideas? I still get a massive amount of errors upon starting nginx but I was told the ones I had could be ignored, as it said in the error itself...

Any and all help is greatly appreciated as I am trying to get this working on a production server and time is critical.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183858,183858#msg-183858


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Mobile browser detection at server level

On 3/18/11 4:53 PM, "Ian M. Evans" <ianevans@digitalhit.com> wrote:

> Any way to integrate something like wurfl at the server level?

For us, we just care about if the browser is mobile or not, so we just use a
nasty regex with a redirect. The mobile site does the full wurfl like
detection.

--
Brian Akins

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Mobile browser detection at server level

Just wonder if anyone's been doing anything with detecting mobile browsers
at the nginx level.

Something like wurfl can be great through PHP, but if you're serving
static cached versions, the PHP doesn't get hot for that user.

Any way to integrate something like wurfl at the server level?

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Running nginx as reverse proxy with Apache, rewrite problem

Try:

Server {
server_name site.com;
listen 80;
root /path/to/regular/content/;
if ($http_user_agent ~* (mobile|android|blackberry|brew|htc|j2me|lg|midp|mot|netfront|nokia|obigo|openweb|opera\smini|palm|psp|samsung|sanyo|sch|sonyericsson|symbian|symbos|teleca|up.browser|wap|webos|windows\sce) ) {
rewrite ^ http://mobile.site.com$request_uri redirect;
}
location /xyz/ {
...
}
}

Server {
server_name mobile.site.com;
listen 80;
root /path/to/mobile/content/;
if ($http_user_agent !~* (mobile|android|blackberry|brew|htc|j2me|lg|midp|mot|netfront|nokia|obigo|openweb|opera\smini|palm|psp|samsung|sanyo|sch|sonyericsson|symbian|symbos|teleca|up.browser|wap|webos|windows\sce) ) {
rewrite ^ http://site.com$request_uri redirect;
}
location /xyz/ {
...
}
}

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183798,183819#msg-183819


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Problem with nginx/0.8.54 and alias

Jim

Nice to see that you seem to have resolved the data eating problem. I hope my post here: http://forum.nginx.org/read.php?6,30896 helped to locate the bit of code that needed changing.

I hope you will also find the time to further improve the forum by adding the option to disable the preview for those that want this.

Well done and keep up the good work!

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,176110,183805#msg-183805


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Running nginx as reverse proxy with Apache, rewrite problem

I'm using a cPanel plugin located here cpnginx.com that allows me to use nginx to serve static content and Apache to serve dynamic content. They use a method called Direct Push so that I'm still able to use my apache htaccess rules with the setup. Tonight I've run into a problem trying to add a new rule to my .htaccess file to redirect all my mobile traffic:

RewriteCond %{HTTP_USER_AGENT} (mobile|android|blackberry|brew|htc|j2me|lg|midp|mot|netfront|nokia|obigo|openweb|opera mini|palm|psp|samsung|sanyo|sch|sonyericsson|symbian|symbos|teleca|up.browser|wap|webos|windows ce) [NC]
RewriteRule ^(.*)$ http://url [R=302,L]

I'm constantly getting 500 internal server errors when I added this rule and the support at cpnginx.com isn't able to help me at all. Is there anyone out there that can provide me with some advice?

Thanks

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183798,183798#msg-183798


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

upstream with fastcgi_pass

I have a problem when use upstream,my config is like this(nginx
version:0.8.54):

upstream www.a.com {
server 10.249.200.76:9000;
server 10.249.200.76:9001;
}

server{

.....

location ~ \.php$ {
root html;
fastcgi_pass www.a.com;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/$host
/$fastcgi_script_name;
include fastcgi_params;
}
}

and then can success to visit www.a.com;

but when "fastcgi_pass www.a.com;" relace by
"fastcgi_pass $host;", visit www.a.com is failed.

I don't know why? can somebody know?

new config like this:

upstream www.a.com {
server 10.249.200.76:9000;
server 10.249.200.76:9001;
}

server{

.....

location ~ \.php$ {
root html;
fastcgi_pass $host;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/$host
/$fastcgi_script_name;
include fastcgi_params;
}
}

--
Posted via http://www.ruby-forum.com/.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Purge Css and JS files

On 03/18/2011 09:37 AM, rajivv wrote:
> No that returns 404

Let's see your configuration ...

--
Simone

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Purge Css and JS files

No that returns 404

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183411,183666#msg-183666


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Purge Css and JS files

On 03/17/2011 05:41 AM, rajivv wrote:
> Just installed purge module and its working fine for url and images
> how do I purge Css and Js files
> eg need to purge the file /css/base.css
> and /js/virtualpaginate.js

If you used the default directory just call

/purge/js/virtualpaginate.js
/purge/css/base.css

Regards

--
Simone

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

2011年3月17日星期四

Nginx for windows Found a bug,How to solve?

Nginx for windows Found a bug,How to solve?
 
You see next configuration file is on this machine with www.xyz.com,. Net program can not properly proxy. I think the problem is nginx!
There are windows version of the nginx load and multi-process multi-core load is not available, found that the memory will be overrun windows version
Do not know why after a period of time will automatically pop up error window. Denial of service! Hope to resolve the following. .

Re: Very Simple htaccess rule

try this:

location / {
try_files $request_uri $request_uri/ site$request_uri site/index.php;
}

Note: You shold define the php location in order to serve php page.

Il 17/03/2011 11:03, michaelvv ha scritto:
> Hi Nginx.
>
> Properly so simple you may laugh , but this world save my day :-)
>
> RewriteEngine On
>
> RewriteBase /
>
> RewriteCond %{SCRIPT_FILENAME} !-f
> RewriteCond %{SCRIPT_FILENAME} !-d
> RewriteRule ^(.*)$ site/$1 [NC,L,QSA]
> RewriteRule ^$ site/index.php [NC,L,QSA]
>
> When you hit the domain.com i simple need to access domain.com/site/index.php.
>
> After this info , i would like to study the rules more intense.
> But i'm in a shortage of time right now.
>
> Thanks In advance..
>
> /Michael
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183435,183435#msg-183435
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: cant find openssl

well this is off topic a bit, but this might all be a moot point. We are putting nginx in front of apache for drupal implementation.
One requirement is SSO via apache auth_ntlm_windbind, for ntlm against AD. Nginx does not support keepalive as apache does? So it will not be able to utlize NTLM?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183476,183507#msg-183507


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: cant find openssl

Hello!

On Thu, Mar 17, 2011 at 09:51:45AM -0400, c_saunders wrote:

> OS:redhat 5.6
>
> nginx version=nginx-0.8.54
>
> getting following error
>
> checking for OpenSSL library ... not found
>
> ./configure: error: SSL modules require the OpenSSL library.
> You can either do not enable the modules, or install the OpenSSL library
> into the system, or build the OpenSSL library statically from the source
> with nginx by using --with-openssl=<path> option.
>
> openssl is installed
> -bash-3.2# which openssl
> /usr/bin/openssl
>
> openssl-devel is as well
>
> which lib is it looking forward?

nginx looks for openssl/ssl.h header and libssl and libcrypto
libraries.

Use something like

./configure --with-cc-opt="-I /path/to/include" --with-ld-opt="-L /path/to/lib"

if you don't have these available to compiler by default.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: cant find openssl

also seeing this in objs/autoconf.err


gcc: unrecognized option '-R/lib64/'

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183476,183481#msg-183481


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

cant find openssl

OS:redhat 5.6

nginx version=nginx-0.8.54

getting following error

checking for OpenSSL library ... not found

./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.

openssl is installed
-bash-3.2# which openssl
/usr/bin/openssl

openssl-devel is as well

which lib is it looking forward?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183476,183476#msg-183476


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: nginx resets connection

Hello!

On Thu, Mar 17, 2011 at 12:09:53AM +0100, Gerhard Heift wrote:

> Hello,
>
> I found a bug in the request finalization on linux:
>
> If the server has a keep-alive set to 0 and the client sends pipelined
> requests which exeeds client_header_buffer_size, nginx closes the
> connection and linux sends a TCP RST since there is still data in
> the TCP buffer of the kernel. This results in an incomplete transfer on
> the client site.
>
> One possible solution would be to allow pipelined request even if
> keep-alive is set to zero. Another one would be to wait until the kernel
> receives the ACK for all pending data in the send buffer.

Yes, thank you for report. Pipilining in nginx currently have
some rough edges and need for lingering close is one of them.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Issue in Lua-nginx-module when use both ngx.location.capture and ngx.exec

My Pleasure, ^_^

Wating for your fixed version

在 2011年3月17日 下午2:44,agentzh <agentzh@gmail.com>写道:
On Tue, Mar 15, 2011 at 7:45 PM, Wendal Chen <wendal1985@gmail.com> wrote:
>
> #用中文再说一遍,英语水平有限:
> 我得到的最小集合就是:
> 1. nginx.conf
> location /test {
>     root html;
>     content_by_lua_file "conf/test.lua";
> }
> server/http等配置按默认的, event module用的是 epoll
>
> 2. test.lua文件仅2行:
> ngx.location.capture('/1.html')
> ngx.exec("/1.html")
>
> 我尝试过,无论这两句话是否请求同一个文件,结果都一样.
>
> 3. 1.html文件里面仅有几个字母,我已经试过不同的文件大小,结果一样
>
>
> 我遇到的情况是这样的:
> 1. 通过wget/curl/Firefox来访问 localhost/test 都能正常显示1.html中的内容
> 2. 使用ab访问 localhost/1.html是正常的,能够pass
> 3. 使用ab进行测试,总是timeout ,

I've reproduced it on my side. This is indeed a bug. When ngx.exec()
is used after ngx.location.capture() or ngx.location.capture_multi(),
nginx 0.8.11+ will not close the client connection due to leaked
request reference counter (r->main->count). A hacky work-around is to
disable nginx http keepalive and rely on the browser (and other http
clients) to actively close the connection. And that's why wget, curl,
firefox, and other well-written http clients worked for you.

Nginx 0.7.68 (and older) is confirmed to work in this context just
because older nginx does not use reference counting.

I'll attempt fix in the next few days. Thank you for reporting this
and sorry about this issue :)

Cheers,
-agentzh

Re: Performance impact of 100+ SSI directives

On Thu, Mar 17, 2011 at 1:30 AM, Hone Watson <hone@codingstore.com> wrote:
> My personal experience is the more SSI includes you have the more
> CPU's are used.

I personally don't have any experience with SSI, but I think CPU usage
isn't going to be a limiting factor in performance here: I can imagine
the CPU being used more, but with 100+ SSI includes, meaning 100+
files can't mean anything else then 100+ IO operations. Having that
many separate files might become an issue without proper caching in
place. I'd strongly suggest you'd use a script to merge all that data
only each time the data changes, if you'd rather have it in separate
files. This way your web server won't have the burden of managing
hundreds of includes/IOps at request-time.

Just my two cents,
Luit van Drongelen

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Very Simple htaccess rule

Hi Nginx.

Properly so simple you may laugh , but this world save my day :-)

RewriteEngine On

RewriteBase /

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ site/$1 [NC,L,QSA]
RewriteRule ^$ site/index.php [NC,L,QSA]

When you hit the domain.com i simple need to access domain.com/site/index.php.

After this info , i would like to study the rules more intense.
But i'm in a shortage of time right now.

Thanks In advance..

/Michael

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183435,183435#msg-183435


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

2011年3月16日星期三

Re: Issue in Lua-nginx-module when use both ngx.location.capture and ngx.exec

On Tue, Mar 15, 2011 at 7:45 PM, Wendal Chen <wendal1985@gmail.com> wrote:
>
> #用中文再说一遍,英语水平有限:
> 我得到的最小集合就是:
> 1. nginx.conf
> location /test {
> root html;
> content_by_lua_file "conf/test.lua";
> }
> server/http等配置按默认的, event module用的是 epoll
>
> 2. test.lua文件仅2行:
> ngx.location.capture('/1.html')
> ngx.exec("/1.html")
>
> 我尝试过,无论这两句话是否请求同一个文件,结果都一样.
>
> 3. 1.html文件里面仅有几个字母,我已经试过不同的文件大小,结果一样
>
>
> 我遇到的情况是这样的:
> 1. 通过wget/curl/Firefox来访问 localhost/test 都能正常显示1.html中的内容
> 2. 使用ab访问 localhost/1.html是正常的,能够pass
> 3. 使用ab进行测试,总是timeout ,

I've reproduced it on my side. This is indeed a bug. When ngx.exec()
is used after ngx.location.capture() or ngx.location.capture_multi(),
nginx 0.8.11+ will not close the client connection due to leaked
request reference counter (r->main->count). A hacky work-around is to
disable nginx http keepalive and rely on the browser (and other http
clients) to actively close the connection. And that's why wget, curl,
firefox, and other well-written http clients worked for you.

Nginx 0.7.68 (and older) is confirmed to work in this context just
because older nginx does not use reference counting.

I'll attempt fix in the next few days. Thank you for reporting this
and sorry about this issue :)

Cheers,
-agentzh
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

504 error Gateway Timeout.

HI;

I'm using Nginx in a reverse proxy setup with Apache. I'm having a
problem when I submit a large upload via php; while Mogrify is
processing the photo upload, Nginx returns a 504 error - Gateway
Timeout.

I tried adding in proxy_read_timeout 600; proxy_send_timeout 600;, but
I am still having the same problem.

I've searched for answers for quite a few hours now, and am at a loss.
All of my PHP memory and time out settings are quite high.

It works when I do smaller uploads. It is the ones that take Mogrify
more than about 60 to 90 seconds to process that cause the error.
(uploads of over about 50 MB of images).

I was able to upload / process with this system prior to installing
Nginx. Please let me know if you want to see a copy of my config file
or any other information.

Thank You Kindly;

Jamie

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Purge Css and JS files

Hi,

Just installed purge module and its working fine for url and images
how do I purge Css and Js files
eg need to purge the file /css/base.css
and /js/virtualpaginate.js

Regards

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183411,183411#msg-183411


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Performance impact of 100+ SSI directives

My personal experience is the more SSI includes you have the more
CPU's are used.

On Thu, Mar 17, 2011 at 5:47 AM, Maxim Khitrov <max@mxcrypt.com> wrote:
> Hi everyone,
>
> I'm trying to refactor a website composed entirely of static files.
> Part of the content is a long list of scientific publication
> references (> 100), which are all listed on a common publications
> page, and also repeated on other project-specific pages.
>
> I'm considering placing each reference (1 line of text) into a
> separate file and using SSI directives to include those files as
> needed throughout the site. The reason for doing this is that the
> references are not static. The publications go through several stages
> (under review, in press, published), which are reflected in the
> references. On top of that, we occasionally need to make formatting
> changes and it's a bit problematic trying to remember all the
> different places where a reference is used.
>
> The question is how would nginx deal with more than 100 or even 200
> include directives on a single page? This setup would make my job of
> updating the references easier, but if there is a significant impact
> on the time it takes to serve the publications list, then I would
> rather write some search/replace shell scripts to handle the updates.
>
> Any other suggestions are welcome, but databases and server-side
> coding are not an option :)
>
> - Max
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

nginx resets connection

Hello,

I found a bug in the request finalization on linux:

If the server has a keep-alive set to 0 and the client sends pipelined
requests which exeeds client_header_buffer_size, nginx closes the
connection and linux sends a TCP RST since there is still data in
the TCP buffer of the kernel. This results in an incomplete transfer on
the client site.

One possible solution would be to allow pipelined request even if
keep-alive is set to zero. Another one would be to wait until the kernel
receives the ACK for all pending data in the send buffer.

Regards,
Gerhard

Re: nginx access logs, timestamps "jump back"

That makes perfect sense, Maxim. I hadn't even thought about the HTTP 1.1 connections staying open.

Thanks.

David.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,182969,183379#msg-183379


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Performance impact of 100+ SSI directives

Hi everyone,

I'm trying to refactor a website composed entirely of static files.
Part of the content is a long list of scientific publication
references (> 100), which are all listed on a common publications
page, and also repeated on other project-specific pages.

I'm considering placing each reference (1 line of text) into a
separate file and using SSI directives to include those files as
needed throughout the site. The reason for doing this is that the
references are not static. The publications go through several stages
(under review, in press, published), which are reflected in the
references. On top of that, we occasionally need to make formatting
changes and it's a bit problematic trying to remember all the
different places where a reference is used.

The question is how would nginx deal with more than 100 or even 200
include directives on a single page? This setup would make my job of
updating the references easier, but if there is a significant impact
on the time it takes to serve the publications list, then I would
rather write some search/replace shell scripts to handle the updates.

Any other suggestions are welcome, but databases and server-side
coding are not an option :)

- Max

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Nginx Access_log Bytes

Hello!

On Wed, Mar 16, 2011 at 11:57:21AM -0400, frankatchoopa wrote:

> In the directive for logging access logs i'm trying to determine
> if the following variable $bytes_sent also accounts for proxy
> traffic if i'm pulling content from an origin server?

http://wiki.nginx.org/HttpLogModule#log_format

: $bytes_sent, the number of bytes transmitted to client

It accounts for traffic sent to client, nothing more nor less.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Nginx Access_log Bytes

In the directive for logging access logs i'm trying to determine if the following variable $bytes_sent also accounts for proxy traffic if i'm pulling content from an origin server?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183270,183270#msg-183270


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: nginx access logs, timestamps "jump back"

Hello!

On Tue, Mar 15, 2011 at 10:26:16PM -0400, assistlydavid wrote:

> Hi Maxim,
>
> Thanks for the response.
>
> How are the workers allocated work? I'm still curious as to why
> I'd see a large block of ELB-only traffic flushed to the log at
> the same time, rather than a mix. Any thoughts on that?

Workers accept() connections and process requests on accepted
connections.

Depending on settings (notably accept_mutex) and number of already
accepted connections conditions on which workers call accept()
vary. With accept_mutex turned on (default) it's likely that on
underloaded servers all/most of new connections will be accepted by
the same worker.

> Presumably, the chance of multiple workers flushing the same
> type of log messages (ELB-only) at the same time is very low,
> especially when we're seeing constant traffic from end-users
> more frequently than ELB health checks. Am I perhaps seeing all
> ELB-only traffic flushed from the buffer of a single worker?

Most likely health checks use single keepalive connection, and
that's why all health checks go to the same worker.

And new client connections are currently accepted by another
worker.

> Are workers chosen based on server/location directives?

No.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Upstream timeout issue

Great that you fixed it.... but how? Is it possible to write the solution?
thanks

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,165055,183229#msg-183229


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: [ANN] ngx_echo v0.35: ability to POST/PUT local files as subrequest bodies

On Wed, Mar 16, 2011 at 3:22 PM, Alexander Kunz <akunz@ntmedia.de> wrote:
>
> Thanks so much for your detailed answer. Works like a charm :)
>

Cool :)

> But i see i can't access this from LUA?
>

No :)

>
> but is it possible to get
>
> echo_request_body
>
> directly in nginx LUA?
>

It indeed can be ported from ngx_echo to ngx_lua. Patches welcome :)

For now you can just read your disk files directly from within Lua. See

http://www.lua.org/pil/21.2.html

It may be less efficient, depending on the size of your disk files.
But generally, it can not be too slow.

No request body hassle is really needed here, I think ;)

Cheers,
-agentzh

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: [ANN] ngx_echo v0.35: ability to POST/PUT local files as subrequest bodies


Thanks so much for your detailed answer. Works like a charm :)

But i see i can't access this from LUA?

> The ngx.location.capture and ngx.location.capture_multi Lua methods cannot
> capture locations configured by ngx_echo module's echo_location, echo_location_async,
> echo_subrequest
, or echo_subrequest_async directives. This won't be fixed in the future due to technical problems :)

but is it possible to get 
echo_request_body
directly in nginx LUA?

Thanks.

Alexander

  

On 16.03.2011 03:28, agentzh wrote:
On Wed, Mar 16, 2011 at 6:15 AM, Alexander Kunz <akunz@ntmedia.de> wrote: 
 Hello,  any chance to debug the -f function? I use the debug log, but get no information about the file... /body1 shows me "test" but /body2 shows nothing... no error, no body content...  
 Because there's no error in your /body2 request, no log is expected to be printed ;)  
     location /body1 {            echo_subrequest POST /sub -b 'test';        }       location /body2 {            echo_subrequest POST /sub -f /tmp/hello.txt;        }         location /sub {            echo "body: $echo_request_body";        } 
 Why $echo_request_body is empty for /body2? Because "echo_subrequest /sub -f /tmp/hello.txt" produces a request body that consists of *file* buffers only (such that nginx does not bother reading the whole disk file into RAM at once) and $echo_request_body only respects pure *memory* buffers.  The following example comes from the ngx_echo's test suite:      location /main {         echo_subrequest POST /sub -f html/blah.txt;     }      location /sub {         echo "sub method: $echo_request_method";         # we don't need to call echo_read_client_body explicitly here         echo_request_body;     }  where html/blah.txt contains the following contents:      Hello, world  Then GET /main gives      sub method: POST     Hello, world  Cheers, -agentzh  _______________________________________________ nginx mailing list nginx@nginx.org http://nginx.org/mailman/listinfo/nginx 

2011年3月15日星期二

Re: [ANN] ngx_echo v0.35: ability to POST/PUT local files as subrequest bodies

On Wed, Mar 16, 2011 at 6:15 AM, Alexander Kunz <akunz@ntmedia.de> wrote:
>
> Hello,
>
> any chance to debug the -f function? I use the debug log, but get no
> information about the file... /body1
> shows me "test" but /body2 shows nothing... no error, no body content...
>

Because there's no error in your /body2 request, no log is expected to
be printed ;)

> location /body1 {
> echo_subrequest POST /sub -b 'test';
> }
>
> location /body2 {
> echo_subrequest POST /sub -f /tmp/hello.txt;
> }
>
> location /sub {
> echo "body: $echo_request_body";
> }

Why $echo_request_body is empty for /body2? Because "echo_subrequest
/sub -f /tmp/hello.txt" produces a request body that consists of
*file* buffers only (such that nginx does not bother reading the whole
disk file into RAM at once) and $echo_request_body only respects pure
*memory* buffers.

The following example comes from the ngx_echo's test suite:

location /main {
echo_subrequest POST /sub -f html/blah.txt;
}

location /sub {
echo "sub method: $echo_request_method";
# we don't need to call echo_read_client_body explicitly here
echo_request_body;
}

where html/blah.txt contains the following contents:

Hello, world

Then GET /main gives

sub method: POST
Hello, world

Cheers,
-agentzh

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: nginx access logs, timestamps "jump back"

Hi Maxim,

Thanks for the response.

How are the workers allocated work? I'm still curious as to why I'd see a large block of ELB-only traffic flushed to the log at the same time, rather than a mix. Any thoughts on that?

Presumably, the chance of multiple workers flushing the same type of log messages (ELB-only) at the same time is very low, especially when we're seeing constant traffic from end-users more frequently than ELB health checks. Am I perhaps seeing all ELB-only traffic flushed from the buffer of a single worker? Are workers chosen based on server/location directives?

ps. Each web server in the load balancer pool is dealing with approximately 60 simultaneous connections, approximately 6 requests per second, and an ELB health check is performed every 30 seconds for each of 4 ELBs. The logs show that 3 of those health checks happen in the same second.

Cheers,
David.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,182969,183186#msg-183186


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: nginx, from connected to first byte.

On Tue, Mar 15, 2011 at 12:05:52AM -0400, digginchina wrote:

Hi there,

> thanks a lot for the reply, i disable debug when compile the nginx, need i re-compile? i don't know the exact meaning of "debug log", whether it's a general nginx log or another log?

Debug log: http://nginx.org/en/docs/debugging_log.html

Must be enabled at compile time.

> and one more question, how to check the status of nginx-fastcgi connection and the fastcgi-application interaction?

nginx-fastcgi: nginx is the client, your fastcgi server is the
server. Debug log shows the nginx side; tcpdump or something similar
can show the traffic between the two; and your server may have a "debug"
mode to show its idea of the interaction.

fastcgi-application: your fastcgi server and your application. Maybe
extra sleeps and prints can show what is going on?

> btw, i use unix file pid to connect fastcgi, could you please tell me whether this method or network port method is better?

If the fastcgi server is on a different machine, the network port method
is better because it works.

If nginx and fastcgi are on the same machine, the connection method
shouldn't matter (much). Unix sockets should be better from an
access-control view. But there are suggestions on this list recently
that the combination of "sendfile on" and unix sockets on at least one
OS has problems with largish uploads.

The two options seem close enough to me, that if your testing doesn't
show a good reason to pick one over the other, then choose either and
don't worry about it.

Good luck with it,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: [ANN] ngx_echo v0.35: ability to POST/PUT local files as subrequest bodies

Hello,

any chance to debug the -f function? I use the debug log, but get no
information about the file... /body1
shows me "test" but /body2 shows nothing... no error, no body content...

location /body1 {
echo_subrequest POST /sub -b 'test';
}

location /body2 {
echo_subrequest POST /sub -f /tmp/hello.txt;
}

location /sub {
echo "body: $echo_request_body";
}

Thanks for your help.

Alexander

On 10.03.2011 10:34, agentzh wrote:
> On Thu, Mar 10, 2011 at 5:01 PM, Elena Zwetkow<ezwetkow@gmx.de> wrote:
>> Thanks so much for the detailed information.
>>
>> Storing uploaded data nonblocking sounds not so easy... What do you think about a solution sending data as base64 encoded sting, then i can use your form-input addon and send this data directly to redis?
>>
> When your data is small enough to be hold in RAM, just use ngx_lua as
> the glue. Use
>
> lua_need_request_body on in nginx.conf
> + client_body_in_single_buffer on in nginx.conf
> + ngx.var.request_body + ngx.decode_base64() +
> ngx.location.capture() in Lua
> + ngx_redis2 in nginx.conf
>
> Then it'll no longer block on disk operations because no disk
> operations will be involved.
>
> Cheers,
> -agentzh
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Caching, purging & gzip

Hello everybody,

I currently have Nginx running as a reverse static proxy cache. I cache CSS/JPG/JS file with proxy_cache directive. I've also cache purging with ngx_cache_purge module ( http://labs.frickle.com/nginx_ngx_cache_purge/ )

Now I would like to serve my CSS/JPG/JS gzipped. What do you think is the best way to achive this ?

1) Modify apache conf to serve gzipped file to Nginx
2) Configure NGINX to serve gzipped version with HttpGzipStaticModule

Please consider that :

1) I still want my CSS/JPG/JS to be cached by nginx
2) I still want be able to purge CSS/JPG/JS from the cache by using ngx_cache_purge module
3) I don't want to overload the reverse proxy machine with gzip operations so I was thinking about http://wiki.nginx.org/HttpGzipStaticModule#gzip_static directives

Waiting for your hints

Ciao

--
Simone

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Nginx Cache not working with wget or curl

Hello!

On Tue, Mar 15, 2011 at 08:52:59AM -0400, Fred91 wrote:

> I found how to solve this problem : a cookie was set by the loadbalancer of our backends.
> I added Set-cookie to proxy_ignore_headers.
>
> What I don't understand, however is why it's working with standard web browsers.

Most likely standard browsers sent previously set cookie and
your backends doesn't try to set new one.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Nginx Cache not working with wget or curl

I found how to solve this problem : a cookie was set by the loadbalancer of our backends.
I added Set-cookie to proxy_ignore_headers.

What I don't understand, however is why it's working with standard web browsers.

Fred

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183034,183053#msg-183053


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Issue in Lua-nginx-module when use both ngx.location.capture and ngx.exec

nginx.conf

location /test {
    root html;
    content_by_lua_file "conf/test.lua";
}

test.lua:
-- start
ngx.location.capture('/1.html')

ngx.exec("/1.html")
-- end

Files in folder :

nginx
    -- conf
        -- nginx.conf
        -- test.lua
    -- html
        -- 1.html

That is all

#用中文再说一遍,英语水平有限:
我得到的最小集合就是:
1. nginx.conf
location /test {
    root html;
    content_by_lua_file "conf/test.lua";
}
server/http等配置按默认的, event module用的是 epoll

2. test.lua文件仅2行:
ngx.location.capture('/1.html')

ngx.exec("/1.html")

我尝试过,无论这两句话是否请求同一个文件,结果都一样.

3. 1.html文件里面仅有几个字母,我已经试过不同的文件大小,结果一样


我遇到的情况是这样的:
1. 通过wget/curl/Firefox来访问 localhost/test 都能正常显示1.html中的内容
2. 使用ab访问 localhost/1.html是正常的,能够pass
3. 使用ab进行测试,总是timeout , 我使用的语句是 ab -v 5 localhost/test 
Benchmarking localhost (be patient)...INFO: POST header ==
---
GET /down2 HTTP/1.0
Host: localhost
User-Agent: ApacheBench/2.3
Accept: */*


---
LOG: header received:
HTTP/1.1 200 OK
Server: nginx/0.8.54
Date: Tue, 15 Mar 2011 07:22:30 GMT
Content-Type: text/plain
Content-Length: 4
Last-Modified: Fri, 11 Mar 2011 09:32:28 GMT
Connection: close
Accept-Ranges: bytes

ABC

LOG: Response code = 200
apr_poll: The timeout specified has expired (70007)

其中的ABC就是1.html的内容, 非常抱歉我之前写错了.

对于0A0D的描述,仅仅是我的猜测,请无视之.

单独写 ngx.exec("/1.html") 也是能够通过ab测试的.

环境:
Ubuntu 10.10
Luajit-5.1-dev
Nginx 0.8.54
Lua-nginx-module 0.16rc2

Thanks,
Wendal Chen

2011/3/15 agentzh <agentzh@gmail.com>
On Tue, Mar 15, 2011 at 3:26 PM, Wendal Chen <wendal1985@gmail.com> wrote:
> Hi,
>
> Lua-nginx-module 0.16RC2
> Nginx  0.8.54
>
[snip]
>
> I am Best
>
> LOG: Response code = 200
> apr_poll: The timeout specified has expired (70007)
>

Can you provide a minimized but complete example to help us reproduce
this issue?

I do not understand where the output "I am Best" came from in your
sample, for example.

And in particular, what exactly were you doing in "-- do something for res" ?

> I think lua-nginx-module lose some 0x0A 0x0D in resp.
>

Where does "0x0A 0x0D" come from?

Cheers,
-agentzh

Nginx Cache not working with wget or curl

Hello,

I set up Ninx as a cache proxy for our webservers.

Everything is working fine when using a standard web browser (Firefox, IE, Chrome), pages are correctly cached according to the rules I have defined.

However, I noticed that non standard tools to retrieve web pages (wget, curl and some monitoring tools) are not caching pages and are always getting content from the backend. In the log file, I have upstream_cache_status with MISS (however, if I first call my page with Firefox, wget or curl are displaying the cached page).

I thought first it was due to the fact that the monitoring tool and wget are using HTTP/1.0 but curl is using HTTP/1.1 and the result is the same.

Is there a special parameters to allow such tools to cache pages ?

Thank you for your help,

Fred

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183034,183034#msg-183034


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Issue in Lua-nginx-module when use both ngx.location.capture and ngx.exec

On Tue, Mar 15, 2011 at 3:26 PM, Wendal Chen <wendal1985@gmail.com> wrote:
> Hi,
>
> Lua-nginx-module 0.16RC2
> Nginx  0.8.54
>
[snip]
>
> I am Best
>
> LOG: Response code = 200
> apr_poll: The timeout specified has expired (70007)
>

Can you provide a minimized but complete example to help us reproduce
this issue?

I do not understand where the output "I am Best" came from in your
sample, for example.

And in particular, what exactly were you doing in "-- do something for res" ?

> I think lua-nginx-module lose some 0x0A 0x0D in resp.
>

Where does "0x0A 0x0D" come from?

Cheers,
-agentzh

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: nginx cache exceeded, cache manager busy

Hi, we're experiencing exactly the same issue using the local filesystem as cache store. We had the same issue with nginx 0.7.67 and now with 0.8.54. The cache grows outside the specified boundaries and nginx process uses the 100% of a single core.

I tried to strace the malfunctioning running process but all I got is tons of gettimeofday
gettimeofday({1300181425, 698292}, NULL) = 0
gettimeofday({1300181425, 698360}, NULL) = 0
gettimeofday({1300181425, 698410}, NULL) = 0
gettimeofday({1300181425, 698459}, NULL) = 0
gettimeofday({1300181425, 698508}, NULL) = 0
...

Are you using CentOS 5 64bit? Can you check nginx error log and see if you have crashed workers please?

Thanks.

--

nginx error log:

2011/03/12 09:09:09 [notice] 5979#0: signal 17 (SIGCHLD) received
2011/03/12 09:09:09 [alert] 5979#0: worker process 5988 exited on signal 11
2011/03/12 09:09:09 [notice] 5979#0: start worker process 29906
2011/03/12 09:09:09 [notice] 5979#0: signal 29 (SIGIO) received
*** glibc detected *** nginx: worker process: free(): invalid next size (normal): 0x00000000006e13c0 ***
======= Backtrace: =========
/lib64/libc.so.6[0x2b197d5f630f]
/lib64/libc.so.6(cfree+0x4b)[0x2b197d5f676b]
nginx: worker process[0x404ce4]
nginx: worker process[0x42701b]
nginx: worker process[0x427065]
nginx: worker process[0x42929f]
nginx: worker process[0x4346aa]
nginx: worker process[0x435056]
nginx: worker process[0x435130]
nginx: worker process[0x436c03]
nginx: worker process[0x435237]
nginx: worker process[0x41732e]
nginx: worker process[0x4171f0]
nginx: worker process[0x41c951]
nginx: worker process[0x41b2a7]
nginx: worker process[0x41d139]
nginx: worker process[0x40419a]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x2b197d5a1994]
nginx: worker process[0x4029b9]
======= Memory map: ========
00400000-00468000 r-xp 00000000 ca:02 5210299 /usr/local/nginx/sbin/nginx
00668000-00675000 rw-p 00068000 ca:02 5210299 /usr/local/nginx/sbin/nginx
00675000-0074d000 rw-p 00675000 00:00 0 [heap]
2b197c9ad000-2b197c9c9000 r-xp 00000000 ca:02 4047069 /lib64/ld-2.5.so
2b197c9c9000-2b197c9ca000 rw-p 2b197c9c9000 00:00 0
2b197c9d1000-2b197c9ff000 rw-p 2b197c9d1000 00:00 0
2b197cbc8000-2b197cbc9000 r--p 0001b000 ca:02 4047069 /lib64/ld-2.5.so
2b197cbc9000-2b197cbca000 rw-p 0001c000 ca:02 4047069 /lib64/ld-2.5.so
2b197cbca000-2b197cbd3000 r-xp 00000000 ca:02 606255 /lib64/libcrypt-2.5.so
2b197cbd3000-2b197cdd2000 ---p 00009000 ca:02 606255 /lib64/libcrypt-2.5.so
2b197cdd2000-2b197cdd3000 r--p 00008000 ca:02 606255 /lib64/libcrypt-2.5.so
2b197cdd3000-2b197cdd4000 rw-p 00009000 ca:02 606255 /lib64/libcrypt-2.5.so
2b197cdd4000-2b197ce02000 rw-p 2b197cdd4000 00:00 0
2b197ce02000-2b197ce1d000 r-xp 00000000 ca:02 606375 /lib64/libpcre.so.0.0.1
2b197ce1d000-2b197d01d000 ---p 0001b000 ca:02 606375 /lib64/libpcre.so.0.0.1
2b197d01d000-2b197d01e000 rw-p 0001b000 ca:02 606375 /lib64/libpcre.so.0.0.1
2b197d01e000-2b197d14b000 r-xp 00000000 ca:02 4047961 /lib64/libcrypto.so.0.9.8e
2b197d14b000-2b197d34a000 ---p 0012d000 ca:02 4047961 /lib64/libcrypto.so.0.9.8e
2b197d34a000-2b197d36b000 rw-p 0012c000 ca:02 4047961 /lib64/libcrypto.so.0.9.8e
2b197d36b000-2b197d370000 rw-p 2b197d36b000 00:00 0
2b197d370000-2b197d384000 r-xp 00000000 ca:02 5033221 /usr/lib64/libz.so.1.2.3
2b197d384000-2b197d583000 ---p 00014000 ca:02 5033221 /usr/lib64/libz.so.1.2.3
2b197d583000-2b197d584000 rw-p 00013000 ca:02 5033221 /usr/lib64/libz.so.1.2.3
2b197d584000-2b197d6d2000 r-xp 00000000 ca:02 606251 /lib64/libc-2.5.so
2b197d6d2000-2b197d8d1000 ---p 0014e000 ca:02 606251 /lib64/libc-2.5.so
2b197d8d1000-2b197d8d5000 r--p 0014d000 ca:02 606251 /lib64/libc-2.5.so
2b197d8d5000-2b197d8d6000 rw-p 00151000 ca:02 606251 /lib64/libc-2.5.so
2b197d8d6000-2b197d8db000 rw-p 2b197d8d6000 00:00 0
2b197d8db000-2b197d8dd000 r-xp 00000000 ca:02 606257 /lib64/libdl-2.5.so
2b197d8dd000-2b197dadd000 ---p 00002000 ca:02 606257 /lib64/libdl-2.5.so
2b197dadd000-2b197dade000 r--p 00002000 ca:02 606257 /lib64/libdl-2.5.so
2b197dade000-2b197dadf000 rw-p 00003000 ca:02 606257 /lib64/libdl-2.5.so
2b197dadf000-2b197dae1000 rw-p 2b197dadf000 00:00 0
2b197dae1000-2b197daeb000 r-xp 00000000 ca:02 606383 /lib64/libnss_files-2.5.so
2b197daeb000-2b197dcea000 ---p 0000a000 ca:02 606383 /lib64/libnss_files-2.5.so
2b197dcea000-2b197dceb000 r--p 00009000 ca:02 606383 /lib64/libnss_files-2.5.so
2b197dceb000-2b197dcec000 rw-p 0000a000 ca:02 606383 /lib64/libnss_files-2.5.so
2b197dcec000-2b198a4ec000 rw-s 00000000 00:08 1855417355 /dev/zero (deleted)
2b198a4ec000-2b198acec000 rw-s 00000000 00:08 1855417356 /dev/zero (deleted)
2b198acec000-2b198aced000 rw-s 00000000 00:08 1855417359 /dev/zero (deleted)
2b198aced000-2b198acfa000 r-xp 00000000 ca:02 4047067 /lib64/libgcc_s-4.1.2-20080825.so.1
2b198acfa000-2b198aefa000 ---p 0000d000 ca:02 4047067 /lib64/libgcc_s-4.1.2-20080825.so.1
2b198aefa000-2b198aefb000 rw-p 0000d000 ca:02 4047067 /lib64/libgcc_s-4.1.2-20080825.so.1
7fff2e0e7000-7fff2e0fd000 rw-p 7fff2e0e7000 00:00 0 [stack]
ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0 [vdso]

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,182995,183019#msg-183019


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

nginx cache exceeded, cache manager busy

Hi,
We are using nginx/0.8.15 on our front web server, mainly for caching and reverse proxy. Our cache is located in /dev/shm disk in order to obtain a better performance. Recently, we've found that sometimes the total size of the cache path would exceed the "max_size" in the configuration, and the process of "cache manager process" is quite busy, using 100% for one CPU.
We presume that the cache manager process might not be able to delete those expired files in time, because the read/write frequency on the cache disk is very high in our production environment, so the total size of the cache path sometimes exceeds the configuration. Is it correct? The configuration about it is "proxy_cache_path /dev/shm/nginx/cache/ levels=2:2 keys_zone=proxy-cache:154m max_size=4g inactive=72h ;"

Could someone tell us how to fix this problem? Thanks a lot.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,182995,182995#msg-182995


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Issue in Lua-nginx-module when use both ngx.location.capture and ngx.exec

Hi,

Lua-nginx-module 0.16RC2
Nginx  0.8.54

my nginx.conf :
        location =/down2 {
                content_by_lua_file "conf/lua_test.lua";
        }

and lua_test.lua:
local res = ngx.location.capture('/somepath')
-- do something for res

ngx.exec("/down/pathXXX")  -- File content is "ABC"

then , If I use command:
curl localhost/down2
#print out ABC

if I use Firefox to visit URL "http://localhost/down/pathXXX" and then "ABC" show out.

BUT , if I use ab to test it :
ab -v http://localhost/down2
#Fail with timeout

Log of ab:

Benchmarking localhost (be patient)...INFO: POST header ==
---
GET /down2 HTTP/1.0
Host: localhost
User-Agent: ApacheBench/2.3
Accept: */*


---
LOG: header received:
HTTP/1.1 200 OK
Server: nginx/0.8.54
Date: Tue, 15 Mar 2011 07:22:30 GMT
Content-Type: text/plain
Content-Length: 10
Last-Modified: Fri, 11 Mar 2011 09:32:28 GMT
Connection: close
Accept-Ranges: bytes

I am Best

LOG: Response code = 200
apr_poll: The timeout specified has expired (70007)

I think lua-nginx-module lose some 0x0A 0x0D in resp.

Thanks,
Wendal Chen
http://myblog.sunfarms.net

2011年3月14日星期一

Re: nginx access logs, timestamps "jump back"

Hello!

On Tue, Mar 15, 2011 at 12:41:32AM -0400, assistlydavid wrote:

> We're running multiple nginx web servers on EC2 behind multiple
> ELBs (load balancers). I'm seeing strange behaviour in our
> nginx system logs. This strange behaviour seems to coincide
> with brief outages spotted by our external monitoring (chartbeat
> & new relic). I'm not sure whether I'm on the right track here,
> investigating this strange logging ... or if it's just a
> coincidence and this is normal logging for nginx.
>
> It starts with typical nginx logging, timestamps increasing
> chronologically. Then there's a jump back in the timestamps
> while a large block of ELB-only traffic is logged (health
> checks). After that, logging returns to normal (increasing
> chronologically) and the timestamps resume from where they left
> off before the ELB-only burst.
>
> For example (details changed to protect the innocent):
>
> 1.2.3.4 - - [14/Mar/2011:06:39:08 +0000] "GET /stuff HTTP/1.1" 301 178 "-" "Jakarta Commons-HttpClient/3.1" http example.com /stuff
> 10.162.18.95 - - [14/Mar/2011:06:23:17 +0000] "GET /host HTTP/1.1" 200 0 "-" "ELB-HealthChecker/1.0" - 10.162.217.229:80 /host

[...]

> Notice the jump back in time, then ELB-only traffic is logged,
> then logging returns to normal once the ELB timestamps have
> caught up with user traffic.
>
> Should I expect all nginx log messages to increase
> chronologically? What would explain these large jumps back?
>
> We redefined our log format to use a 32k buffer. Unfortunately,
> I can't risk changing/disabling this in production to see if the
> behaviour changes. Could there be more than one 32k buffer
> flushing at different times?

Each worker process has it's own log buffer and flush it as soon
it's filled up. So the observed behaviour is normal with log
buffering used and low traffic.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx