# 100% CPU Usage (on all 8 cores)

**URL:** <https://www.ruby-forum.com/t/100-cpu-usage-on-all-8-cores/204702>\
**Category:** NGINX\
**Created:** [March 19, 2011, 12:32am UTC](https://www.ruby-forum.com/t/100-cpu-usage-on-all-8-cores/204702 "2011-03-19T00:32:18Z")\
**Posts on this page:** 9\
**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:** [March 19, 2011, 12:32am UTC](https://www.ruby-forum.com/t/100-cpu-usage-on-all-8-cores/204702/1 "2011-03-19T00:32:18Z")

</div>

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:  
 ![](http://i51.tinypic.com/34zaphe.jpg)

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:

> **[100% CPU Usage (on all 8 cores)](https://forum.nginx.org/read.php?2,183858,183858#msg-183858)**
>
> 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...

---

<div class="post-metadata">

**Author:** ![kthxbai2u](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/c5a1d2/32.png) [@kthxbai2u](https://www.ruby-forum.com/u/kthxbai2u)\
**Post date:** [March 19, 2011, 5:04am UTC](https://www.ruby-forum.com/t/100-cpu-usage-on-all-8-cores/204702/2 "2011-03-19T05:04:04Z")

</div>

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:  
> ![](http://i51.tinypic.com/34zaphe.jpg)
> 
> The server actually went offline and needed a reboot because of this…

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

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..

---

<div class="post-metadata">

**Author:** ![kthxbai2u](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/c5a1d2/32.png) [@kthxbai2u](https://www.ruby-forum.com/u/kthxbai2u)\
**Post date:** [March 19, 2011, 7:29pm UTC](https://www.ruby-forum.com/t/100-cpu-usage-on-all-8-cores/204702/3 "2011-03-19T19:29:55Z")

</div>

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

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](http://forum.nginx.org/read.php?2,183858,183994#msg-183994)

---

<div class="post-metadata">

**Author:** ![kthxbai2u](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/c5a1d2/32.png) [@kthxbai2u](https://www.ruby-forum.com/u/kthxbai2u)\
**Post date:** [March 19, 2011, 8:19pm UTC](https://www.ruby-forum.com/t/100-cpu-usage-on-all-8-cores/204702/4 "2011-03-19T20:19:58Z")

</div>

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:

> **[Re: 100% CPU Usage (on all 8 cores)](https://forum.nginx.org/read.php?2,183858,184011#msg-184011)**
>
> 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...

---

<div class="post-metadata">

**Author:** ![kthxbai2u](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/c5a1d2/32.png) [@kthxbai2u](https://www.ruby-forum.com/u/kthxbai2u)\
**Post date:** [March 19, 2011, 7:31pm UTC](https://www.ruby-forum.com/t/100-cpu-usage-on-all-8-cores/204702/5 "2011-03-19T19:31:10Z")

</div>

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

Thanks for your time 😛

Posted at Nginx Forum:

> **[Re: 100% CPU Usage (on all 8 cores)](https://forum.nginx.org/read.php?2,183858,183995#msg-183995)**
>
> 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...

---

<div class="post-metadata">

**Author:** ![kthxbai2u](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/c5a1d2/32.png) [@kthxbai2u](https://www.ruby-forum.com/u/kthxbai2u)\
**Post date:** [March 19, 2011, 9:47pm UTC](https://www.ruby-forum.com/t/100-cpu-usage-on-all-8-cores/204702/6 "2011-03-19T21:47:04Z")

</div>

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/](http://www.arnold.se/chris/)

---

<div class="post-metadata">

**Author:** ![kthxbai2u](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/c5a1d2/32.png) [@kthxbai2u](https://www.ruby-forum.com/u/kthxbai2u)\
**Post date:** [March 19, 2011, 9:37pm UTC](https://www.ruby-forum.com/t/100-cpu-usage-on-all-8-cores/204702/7 "2011-03-19T21:37:02Z")

</div>

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

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

> > Congratulations It's really difficult to get 100% efficiency for modern code - this is truly scalable
> 
> 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.

> > isn’t normally exposed.  
> > 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](http://forum.nginx.org/read.php?2,183858,183994#msg-183994)
> 
> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://nginx.org/mailman/listinfo/nginx)

–  
Jim O.

---

<div class="post-metadata">

**Author:** ![kthxbai2u](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/c5a1d2/32.png) [@kthxbai2u](https://www.ruby-forum.com/u/kthxbai2u)\
**Post date:** [March 20, 2011, 12:36am UTC](https://www.ruby-forum.com/t/100-cpu-usage-on-all-8-cores/204702/8 "2011-03-20T00:36:01Z")

</div>

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:

> **[Re: 100% CPU Usage (on all 8 cores)](https://forum.nginx.org/read.php?2,183858,184052#msg-184052)**
>
> 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...

---

<div class="post-metadata">

**Author:** ![kthxbai2u](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/c5a1d2/32.png) [@kthxbai2u](https://www.ruby-forum.com/u/kthxbai2u)\
**Post date:** [March 19, 2011, 9:52pm UTC](https://www.ruby-forum.com/t/100-cpu-usage-on-all-8-cores/204702/9 "2011-03-19T21:52:06Z")

</div>

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](http://forum.nginx.org/read.php?2,183858,184011#msg-184011)
> 
> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://nginx.org/mailman/listinfo/nginx)

–  
Jim O.
