# File AIO and multiple nginx instances

**URL:** <https://www.ruby-forum.com/t/file-aio-and-multiple-nginx-instances/207090>\
**Category:** NGINX\
**Created:** [May 18, 2011, 6:09am UTC](https://www.ruby-forum.com/t/file-aio-and-multiple-nginx-instances/207090 "2011-05-18T06:09:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [May 18, 2011, 6:09am UTC](https://www.ruby-forum.com/t/file-aio-and-multiple-nginx-instances/207090/1 "2011-05-18T06:09:54Z")

</div>

Hello.

I need to run two nginx instances on one server (not two workers, but  
two master processes with their own number of workers each). The problem  
is that when nginx is compiled with aio support I can start only one  
instance. When I try to start the second one, only master process starts  
and these lines appear in error log:

[emerg] 12789#0: io\_setup() failed (1: Operation not permitted)  
…  
[alert] 12715#0: worker process 12789 exited with fatal code 2 and can  
not be respawn  
…

This happens even if aio directive isn’t used in configuration.

My system is CentOS 5.5 with kernel 2.6.18-194.32.1.el5, I’ve tried  
nginx 1.0.0 and nginx 1.0.2

So, is it expected behavior (I don’t know nginx and/or aio internals),  
or is it a bug in nginx or aio, and is there a way to start two nginx  
instances, both with aio support?

Posted at Nginx Forum:

> **[File AIO and multiple nginx instances](https://forum.nginx.org/read.php?2,198945,198945#msg-198945)**
>
> Hello. I need to run two nginx instances on one server (not two workers, but two master processes with their own number of workers each). The problem is that when nginx is compiled with aio support I can start only one instance. When I try to start...

---

<div class="post-metadata">

**Author:** ![arti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e5b9ba/32.png) [@arti](https://www.ruby-forum.com/u/arti)\
**Post date:** [May 18, 2011, 9:34am UTC](https://www.ruby-forum.com/t/file-aio-and-multiple-nginx-instances/207090/2 "2011-05-18T09:34:13Z")

</div>

On Wed, May 18, 2011 at 12:09:34AM -0400, arti wrote:

> [alert] 12715#0: worker process 12789 exited with fatal code 2 and can  
> instances, both with aio support?  
> It’s strange, but io\_setup(2) man does not even mention EPERM:  
> [io\_setup(2) - Linux manual page](http://www.kernel.org/doc/man-pages/online/pages/man2/io_setup.2.html)

–  
Igor S.

---

<div class="post-metadata">

**Author:** ![arti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e5b9ba/32.png) [@arti](https://www.ruby-forum.com/u/arti)\
**Post date:** [May 20, 2011, 8:55am UTC](https://www.ruby-forum.com/t/file-aio-and-multiple-nginx-instances/207090/3 "2011-05-20T08:55:13Z")

</div>

So, is it a problem of CentOS or Nginx?

Posted at Nginx Forum:

> **[Re: File AIO and multiple nginx instances](https://forum.nginx.org/read.php?2,198945,199437#msg-199437)**
>
> Hello. I need to run two nginx instances on one server (not two workers, but two master processes with their own number of workers each). The problem is that when nginx is compiled with aio support I can start only one instance. When I try to start...

---

<div class="post-metadata">

**Author:** ![arti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e5b9ba/32.png) [@arti](https://www.ruby-forum.com/u/arti)\
**Post date:** [May 20, 2011, 8:57am UTC](https://www.ruby-forum.com/t/file-aio-and-multiple-nginx-instances/207090/4 "2011-05-20T08:57:41Z")

</div>

On Fri, May 20, 2011 at 02:54:31AM -0400, arti wrote:

> So, is it a problem of CentOS or Nginx?

I believe this is a CentOS issue, and man page does not allow even  
to understand what is the issue.

–  
Igor S.

---

<div class="post-metadata">

**Author:** ![arti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e5b9ba/32.png) [@arti](https://www.ruby-forum.com/u/arti)\
**Post date:** [May 20, 2011, 9:00am UTC](https://www.ruby-forum.com/t/file-aio-and-multiple-nginx-instances/207090/5 "2011-05-20T09:00:09Z")

</div>

Ok, thanks

Posted at Nginx Forum:

> **[Re: File AIO and multiple nginx instances](https://forum.nginx.org/read.php?2,198945,199439#msg-199439)**
>
> Hello. I need to run two nginx instances on one server (not two workers, but two master processes with their own number of workers each). The problem is that when nginx is compiled with aio support I can start only one instance. When I try to start...
