# Nginx 1.0 + IPv6 kills server when accessed over IPv6

**URL:** <https://www.ruby-forum.com/t/nginx-1-0-ipv6-kills-server-when-accessed-over-ipv6/205922>\
**Category:** NGINX\
**Created:** [April 18, 2011, 7:26pm UTC](https://www.ruby-forum.com/t/nginx-1-0-ipv6-kills-server-when-accessed-over-ipv6/205922 "2011-04-18T19:26:40Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [April 18, 2011, 7:26pm UTC](https://www.ruby-forum.com/t/nginx-1-0-ipv6-kills-server-when-accessed-over-ipv6/205922/1 "2011-04-18T19:26:40Z")

</div>

I just upgraded from 0.8.54 to 1.0 (I’ve also tried various versions of  
0.9.x experiencing the same issue).

Running 2.6.35-28-generic #50-Ubuntu SMP on a 64bit Ubuntu 10.10

As soon as I try to open a connection to an ipv6 enabled site via ipv6 -  
the  
server just hangs instantly, requiring a hard reboot (nothing is dumped  
to  
any logs).

Since the server is located in another country I’ve only managed to grab  
a  
screenshot of the KVM:  
[![](http://tinypic.com/images/goodbye.jpg) ](http://tinypic.com/images/goodbye.jpg)

This does not happen when using 0.8.54 (or any other 0.8.x version I’ve  
used  
before).

Not sure if this is an Nginx issue, kernel issue, hardware issue, but I  
thought this would be the best place to start.  
Has anyone else experienced something similar?

Kind regards,  
Egill R.

---

<div class="post-metadata">

**Author:** ![Egill\_RSErlendsson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/87869e/32.png) [@Egill\_RSErlendsson](https://www.ruby-forum.com/u/Egill_RSErlendsson)\
**Post date:** [April 18, 2011, 8:26pm UTC](https://www.ruby-forum.com/t/nginx-1-0-ipv6-kills-server-when-accessed-over-ipv6/205922/2 "2011-04-18T20:26:39Z")

</div>

On Mon, Apr 18, 2011 at 05:26:25PM +0000, Egill R. Erlendsson |  
Grapewire wrote:

> screenshot of the KVM:  
> [http://i55.tinypic.com/dfkuc2.png](http://i55.tinypic.com/dfkuc2.png)
> 
> This does not happen when using 0.8.54 (or any other 0.8.x version I’ve used  
> before).
> 
> Not sure if this is an Nginx issue, kernel issue, hardware issue, but I  
> thought this would be the best place to start.  
> Has anyone else experienced something similar?

This is certainly a kernel issue, because userland application  
should not be able to kill the kernel. It’s strange that panic occurs in  
ipv6 connect() becuase nginx can do only ipv4 connect().

–  
Igor S.

---

<div class="post-metadata">

**Author:** ![Egill\_RSErlendsson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/87869e/32.png) [@Egill\_RSErlendsson](https://www.ruby-forum.com/u/Egill_RSErlendsson)\
**Post date:** [April 18, 2011, 8:43pm UTC](https://www.ruby-forum.com/t/nginx-1-0-ipv6-kills-server-when-accessed-over-ipv6/205922/3 "2011-04-18T20:43:19Z")

</div>

Hello!

On Mon, Apr 18, 2011 at 05:26:25PM +0000, Egill R. Erlendsson |  
Grapewire wrote:

> screenshot of the KVM:  
> [http://i55.tinypic.com/dfkuc2.png](http://i55.tinypic.com/dfkuc2.png)
> 
> This does not happen when using 0.8.54 (or any other 0.8.x version I’ve used  
> before).
> 
> Not sure if this is an Nginx issue, kernel issue, hardware issue, but I  
> thought this would be the best place to start.  
> Has anyone else experienced something similar?

Obviously “server just hangs” means this isn’t nginx issue. Most  
likely it’s kernel problem, though it may be triggered by  
something nginx does (in recent versions).

I suspect the following changes in nginx may be problematic:

1. Use of accept4() syscall, as of 0.9.0+.

2. Listen backlog -1 on Linux, as of 0.9.5+.

Could you please test which exactly version causes problems (and  
which one is last working)?

Maxim D.

---

<div class="post-metadata">

**Author:** ![Egill\_RSErlendsson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/87869e/32.png) [@Egill\_RSErlendsson](https://www.ruby-forum.com/u/Egill_RSErlendsson)\
**Post date:** [April 19, 2011, 12:33am UTC](https://www.ruby-forum.com/t/nginx-1-0-ipv6-kills-server-when-accessed-over-ipv6/205922/4 "2011-04-19T00:33:09Z")

</div>

Ill be testing a 1.0.0 build on a centos kernel (with openvz) as soon as  
the  
Datacenter gets the IPv6 config right for me. Ill let you all know if  
that  
crashes.

---

<div class="post-metadata">

**Author:** ![Egill\_RSErlendsson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/87869e/32.png) [@Egill\_RSErlendsson](https://www.ruby-forum.com/u/Egill_RSErlendsson)\
**Post date:** [April 19, 2011, 6:09am UTC](https://www.ruby-forum.com/t/nginx-1-0-ipv6-kills-server-when-accessed-over-ipv6/205922/5 "2011-04-19T06:09:22Z")

</div>

On Mon, Apr 18, 2011 at 06:25:52PM -0400, egill wrote:

> Thanks for your time!

Try to set the backlog option for listening socket:

```
   listen 80 backlog=1024;

```

or  
listen [::]:80 backlog=1024;

–  
Igor S.

---

<div class="post-metadata">

**Author:** ![Egill\_RSErlendsson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/87869e/32.png) [@Egill\_RSErlendsson](https://www.ruby-forum.com/u/Egill_RSErlendsson)\
**Post date:** [April 19, 2011, 1:02pm UTC](https://www.ruby-forum.com/t/nginx-1-0-ipv6-kills-server-when-accessed-over-ipv6/205922/6 "2011-04-19T13:02:28Z")

</div>

## Igor S. Wrote:

> On Mon, Apr 18, 2011 at 06:25:52PM -0400, egill  
> wrote:

> Igor S.

I set the backlog for the IPv6 listen entry to 1024 and it works like a  
charm.

Excellent, thanks for your help!

Kind regards,  
Egill R.

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,192128,192297#msg-192297](http://forum.nginx.org/read.php?2,192128,192297#msg-192297)

---

<div class="post-metadata">

**Author:** ![Egill\_RSErlendsson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/87869e/32.png) [@Egill\_RSErlendsson](https://www.ruby-forum.com/u/Egill_RSErlendsson)\
**Post date:** [April 19, 2011, 2:30pm UTC](https://www.ruby-forum.com/t/nginx-1-0-ipv6-kills-server-when-accessed-over-ipv6/205922/7 "2011-04-19T14:30:51Z")

</div>

what does the function “backlog=1024” exactly do?

---

<div class="post-metadata">

**Author:** ![Egill\_RSErlendsson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/87869e/32.png) [@Egill\_RSErlendsson](https://www.ruby-forum.com/u/Egill_RSErlendsson)\
**Post date:** [April 19, 2011, 12:26am UTC](https://www.ruby-forum.com/t/nginx-1-0-ipv6-kills-server-when-accessed-over-ipv6/205922/8 "2011-04-19T00:26:22Z")

</div>

Hi again.

Thanks for the replies. I tested 0.9.4 and it works - 0.9.5 and newer  
all reproduce the same problem.

Maxim, it would be interesting to know if you have any further thoughts  
on that.

At least now I know what to look for and I guess I’ll be careful with  
0.9.5+ in the near future! 🙂

Thanks for your time!

Kind regards,  
Egill R.

Posted at Nginx Forum:

> **[Re: Nginx 1.0 + IPv6 kills server when accessed over IPv6](https://forum.nginx.org/read.php?2,192128,192207#msg-192207)**
>
> I just upgraded from 0.8.54 to 1.0 (I've also tried various versions of 0.9.x experiencing the same issue). Running 2.6.35-28-generic #50-Ubuntu SMP on a 64bit Ubuntu 10.10 As soon as I try to open a connection to an ipv6 enabled site via ipv6 - the...

---

<div class="post-metadata">

**Author:** ![Egill\_RSErlendsson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/87869e/32.png) [@Egill\_RSErlendsson](https://www.ruby-forum.com/u/Egill_RSErlendsson)\
**Post date:** [April 19, 2011, 2:34pm UTC](https://www.ruby-forum.com/t/nginx-1-0-ipv6-kills-server-when-accessed-over-ipv6/205922/9 "2011-04-19T14:34:34Z")

</div>

On Wed, Apr 20, 2011 at 12:30:36AM +1200, Ryan B wrote:

> what does the function “backlog=1024” exactly do?

man listen:

The backlog argument defines the maximum length to which the queue of  
pending  
connections for sockfd may grow. If a connection request arrives when  
the  
queue is full, the client may receive an error with an indication of  
ECONNREFUSED or, if the underlying protocol supports retransmission, the  
request may be ignored so that a later reattempt at connection succeeds.

Changes with nginx 0.9.5 21 Feb  
2011

```
*) Change: now nginx uses a default listen backlog value -1 on 

```

Linux.

–  
Igor S.
