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:

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

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:

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…

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 :slight_smile:

NginX worked before, it should work again…

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

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 :slight_smile:

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

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

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

Thanks for your time :stuck_out_tongue:

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

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/

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 :slight_smile:

“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
[email protected]
http://nginx.org/mailman/listinfo/nginx


Jim O.

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 :slight_smile:

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

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 :slight_smile:

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 :slight_smile:

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


nginx mailing list
[email protected]
http://nginx.org/mailman/listinfo/nginx


Jim O.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs