Welcome! Log In Create A New Profile

Advanced

Re: Weird 0.8.11.1 connections spike

All files from this thread

File Name File Size   Posted by Date  
patch-0.8.11.2 424 bytes open | download Igor Sysoev 08/31/2009 Read message
August 31, 2009 08:14AM
Igor Sysoev wrote:
> On Sun, Aug 30, 2009 at 10:55:57PM -0400, Jim Ohlstein wrote:
>
>
>> Igor Sysoev wrote:
>>
>>> On Sun, Aug 30, 2009 at 11:52:51AM -0400, Jim Ohlstein wrote:
>>>
>>>
>>>
>>>>>> 2009/08/30 10:29:00 [alert] 2042#0: open socket #1023 left in
>>>>>> connection 1015
>>>>>> 2009/08/30 10:29:00 [alert] 2042#0: aborting
>>>>>>
>>>>>> Other servers seem to be running fine including ones with busy sites.
>>>>>> For the moment I have reverted that VPS to 0.8.10.
>>>>>>
>>>>>>
>>>>>>
>>>>> Could you do the following:
>>>>>
>>>>> 1) enable coredumps
>>>>> 2) set in nginx.conf:
>>>>> debug_points abort;
>>>>> 3) reconfigure nginx, if there are open connections, then nginx creates
>>>>> coredump on exit
>>>>>
>>>>>
>>>>>
>>>> Do you want nginx reconfigured "--with-debug" or is there another option
>>>> you need?
>>>>
>>>>
>>> No. The coredump is enough, it's just should have debug info (gcc -g
>>> option).
>>>
>>>
>>>
>>>>> 4) look in log for alerts: open socket #... left in connection NN
>>>>> 5) run "gdb /path/to/nginx /path/to/core", then
>>>>>
>>>>> p ((ngx_connection_t *) ngx_cycle->connections[NN]->data)->uri
>>>>> p ((ngx_connection_t *) ngx_cycle->connections[NN]->data)->main->count
>>>>>
>>>>> where NN is NN from log message.
>>>>>
>>>>>
>> Unfortunately I don't think it gave too much information.
>>
>> I watched connections gradually rise. I have ulimit -n set to 1024, two
>> workers, 1024 connections/worker. As connections neared 2048 the site
>> became unresponsive and load went up dramatically.
>>
>> I began to see the same errors in the log. Nginx did not abort on its
>> own so I killed it after a few minutes. I then saw the same entries in
>> the error log like:
>>
>> 2009/08/30 22:22:40 [alert] 6118#0: open socket #980 left in connection 993
>>
>
> nginx aborts only when you send -HUP and it found leaked connections.
>
>
>> I ran gdb on the core but this was the output from three connections:
>>
>> [root@mars proc]# gdb /vz/private/101/fs/root/usr/local/sbin/nginx ./kcore
>> GNU gdb Red Hat Linux (6.5-37.el5_2.2rh)
>> Copyright (C) 2006 Free Software Foundation, Inc.
>> GDB is free software, covered by the GNU General Public License, and you are
>> welcome to change it and/or distribute copies of it under certain
>> conditions.
>> Type "show copying" to see the conditions.
>> There is absolutely no warranty for GDB. Type "show warranty" for details.
>> This GDB was configured as "x86_64-redhat-linux-gnu"...Using host
>> libthread_db library "/lib64/libthread_db.so.1".
>>
>> warning: core file may not match specified executable file.
>> Core was generated by `ro root=LABEL=/ console=tty0
>> console=ttyS1,19200n8 debug'.
>> #0 0x0000000000000000 in ?? ()
>> (gdb) p ((ngx_connection_t *) ngx_cycle->connections[1014]->data)->uri
>> Cannot access memory at address 0x130
>> (gdb) p ((ngx_connection_t *) ngx_cycle->connections[1014]->data)->uri
>> Cannot access memory at address 0x130
>> (gdb) p ((ngx_connection_t *) ngx_cycle->connections[1010]->data)->uri
>> Cannot access memory at address 0x130
>> (gdb) p ((ngx_connection_t *)
>> ngx_cycle->connections[1014]->data)->main->count
>> Cannot access memory at address 0x130
>> (gdb) p ((ngx_connection_t *)
>> ngx_cycle->connections[1010]->data)->main->count
>> Cannot access memory at address 0x130
>> (gdb) p ((ngx_connection_t *) ngx_cycle->connections[993]->data)->uri
>> Cannot access memory at address 0x130
>> (gdb) p ((ngx_connection_t *)
>> ngx_cycle->connections[993]->data)->main->count
>> Cannot access memory at address 0x130
>> (gdb) quit
>> [root@mars proc]#
>>
>> During this time there were hundreds of connections in "CLOSE_WAIT"
>> state. They gradually increased to just over 1000 when it crashed.
>>
>
> Sorry, I've mistaked:
>
> p ((ngx_http_request_t *) ngx_cycle->connections[1014].data)->uri
> p ((ngx_http_request_t *) ngx_cycle->connections[1014].data)->main->count
>
>
>
It looks as though you got the data that you needed overnight in my time
zone. That server does use a try_files directive:

location /forums/ {
try_files $uri $uri/ /forums/vbseo.php;
...
}

Previously we used a rewrite:

#if (!-e $request_filename) {
#rewrite ^/forums/(.*)$ /forums/vbseo.php last;
#}

which ironically would probably not have caused this difficulty.

I'll try 0.8.12 and report if any difficulties unless you want me to
generate another coredump with 0.8.11

Jim
Subject Author Posted

Weird 0.8.11.1 connections spike

Jeff Waugh August 29, 2009 08:50AM

Re: Weird 0.8.11.1 connections spike

Igor Sysoev August 29, 2009 09:48AM

Re: Weird 0.8.11.1 connections spike

Jeff Waugh August 29, 2009 10:33AM

Re: Weird 0.8.11.1 connections spike

Igor Sysoev August 29, 2009 11:08AM

Re: Weird 0.8.11.1 connections spike

Jeff Waugh August 29, 2009 11:45AM

Re: Weird 0.8.11.1 connections spike

Igor Sysoev August 29, 2009 12:41PM

Re: Weird 0.8.11.1 connections spike

Jim Ohlstein August 30, 2009 11:00AM

Re: Weird 0.8.11.1 connections spike

Igor Sysoev August 30, 2009 11:31AM

Re: Weird 0.8.11.1 connections spike

Jim Ohlstein August 30, 2009 11:52AM

Re: Weird 0.8.11.1 connections spike

Igor Sysoev August 30, 2009 12:30PM

Re: Weird 0.8.11.1 connections spike

Jim Ohlstein August 30, 2009 10:55PM

Re: Weird 0.8.11.1 connections spike

Igor Sysoev August 31, 2009 01:24AM

Re: Weird 0.8.11.1 connections spike

Jim Ohlstein August 31, 2009 08:14AM

Re: Weird 0.8.11.1 connections spike

Igor Sysoev August 31, 2009 08:27AM

Re: Weird 0.8.11.1 connections spike

Jeff Waugh August 30, 2009 11:04PM

Re: Weird 0.8.11.1 connections spike

Igor Sysoev August 31, 2009 01:46AM

Re: Weird 0.8.11.1 connections spike

Jeff Waugh August 31, 2009 02:36AM

Re: Weird 0.8.11.1 connections spike

Jeff Waugh August 31, 2009 03:14AM

Re: Weird 0.8.11.1 connections spike

Igor Sysoev August 31, 2009 03:24AM

Re: Weird 0.8.11.1 connections spike

Jeff Waugh August 31, 2009 03:55AM

Re: Weird 0.8.11.1 connections spike

Jeff Waugh August 31, 2009 04:36AM

Re: Weird 0.8.11.1 connections spike

Igor Sysoev August 31, 2009 06:38AM

Re: Weird 0.8.11.1 connections spike

Igor Sysoev August 31, 2009 10:08AM

Re: Weird 0.8.11.1 connections spike

Jeff Waugh August 31, 2009 09:54AM

Re: Weird 0.8.11.1 connections spike Attachments

Igor Sysoev August 31, 2009 07:28AM

Re: Weird 0.8.11.1 connections spike

Igor Sysoev August 31, 2009 04:34AM

Re: Weird 0.8.11.1 connections spike

Jeff Waugh August 31, 2009 05:04AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 279
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