LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-28-2010, 04:22 AM   #1
enid
Member
 
Registered: May 2009
Posts: 42

Rep: Reputation: 2
Bind high cpu usage problem


Hi all,
recently I'm facing this issue which is more or less than two weeks that I've noticed but didn't take any precautions.

So I have a bind server (version 9.3.4-P1.2) running on a Debian 4.0 server.

The named process keeps wasting high cpu usage, averagely more than 50% all the time. Before it consumed less than 20 %.

The server is updated with the latest packages (apt-get update), and I don't know if it is a bug.

Can you help solving this issue.

Thanks,

Enid
 
Old 04-28-2010, 07:56 AM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by enid View Post
Hi all,
recently I'm facing this issue which is more or less than two weeks that I've noticed but didn't take any precautions.

So I have a bind server (version 9.3.4-P1.2) running on a Debian 4.0 server.

The named process keeps wasting high cpu usage, averagely more than 50% all the time. Before it consumed less than 20 %.

The server is updated with the latest packages (apt-get update), and I don't know if it is a bug.

Can you help solving this issue.

Thanks,

Enid

how many zone files being served? how big are these zones??
What are the server specs??

run an strace on the pid
Code:
man strace
Is your bind server logging?? If so, does this give any clues??
 
Old 04-28-2010, 09:32 AM   #3
enid
Member
 
Registered: May 2009
Posts: 42

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by centosboy View Post
how many zone files being served? how big are these zones??
What are the server specs??

run an strace on the pid
Code:
man strace
Is your bind server logging?? If so, does this give any clues??

There are 340 zones being served, the output of "rndc status" is:
# rndc status
number of zones: 340
debug level: 0
xfers running: 1
xfers deferred: 0
soa queries in progress: 1
query logging is OFF
recursive clients: 347/10000
tcp clients: 0/100
server is up and running


What do you mean with how big are the zones? They have averagely 6-8 records (SOA,MX,A,NS,TXT,CNAME)

Server specs:
#uname -a
Linux <hostname> 2.6.18-6-amd64 #1 SMP Sat Feb 20 23:34:55 UTC 2010 x86_64 GNU/Linux

CPU: Intel(R) Xeon(R) CPU 5130 @ 2.00GHz
RAM: 2GB
Swap: 4GB
HDD: 1.3TB Raid5 HW

I'm not sure about the arguments given to strace but the output of the command:
~# strace -c -d -t -p <pid>

is

Process 9636 attached - interrupt to quit
[wait(0x137f) = 9636]
pid 9636 stopped, [SIGSTOP]

"it hangs here, CTRL+C"

cleanup: looking at pid 9636
Process 9636 detached
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
------ ----------- ----------- --------- --------- ----------------
100.00 0.000000 0 total


About logging it is not figuring in the named.conf and I give it
#rndc querylog to Toggle query logging.

and see the logs, but nothing special there , just a lot of resolving of records and no error that I can detect.



Thanks again,

Enid
 
Old 04-28-2010, 09:52 AM   #4
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by enid View Post
There are 340 zones being served, the output of "rndc status" is:
# rndc status
number of zones: 340
debug level: 0
xfers running: 1
xfers deferred: 0
soa queries in progress: 1
query logging is OFF
recursive clients: 347/10000
tcp clients: 0/100
server is up and running


What do you mean with how big are the zones? They have averagely 6-8 records (SOA,MX,A,NS,TXT,CNAME)

Server specs:
#uname -a
Linux <hostname> 2.6.18-6-amd64 #1 SMP Sat Feb 20 23:34:55 UTC 2010 x86_64 GNU/Linux

CPU: Intel(R) Xeon(R) CPU 5130 @ 2.00GHz
RAM: 2GB
Swap: 4GB
HDD: 1.3TB Raid5 HW

I'm not sure about the arguments given to strace but the output of the command:
~# strace -c -d -t -p <pid>

is

Process 9636 attached - interrupt to quit
[wait(0x137f) = 9636]
pid 9636 stopped, [SIGSTOP]

"it hangs here, CTRL+C"

cleanup: looking at pid 9636
Process 9636 detached
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
------ ----------- ----------- --------- --------- ----------------
100.00 0.000000 0 total


About logging it is not figuring in the named.conf and I give it
#rndc querylog to Toggle query logging.

and see the logs, but nothing special there , just a lot of resolving of records and no error that I can detect.



Thanks again,

Enid
run an strace against the pid..

Code:
strace -f -p pid -o output.txt
run for a few mins then check the output.txt file
lets see if bind is doing anything it shouldnt be...maybe leaking memory..?
 
Old 04-29-2010, 03:40 AM   #5
enid
Member
 
Registered: May 2009
Posts: 42

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by centosboy View Post
run an strace against the pid..

Code:
strace -f -p pid -o output.txt
run for a few mins then check the output.txt file
lets see if bind is doing anything it shouldnt be...maybe leaking memory..?
I ran the strace for about 1 minute and the output.txt file went around 280MB in size.

I cannot really understand very much its content for errors or something strange, also when I interrupted the strace, bind didn't resolve any more and the named process seemed stalled, I killed it and restart bind.

Where should I check for any errors on the output.txt?
 
Old 05-05-2010, 02:28 AM   #6
enid
Member
 
Registered: May 2009
Posts: 42

Original Poster
Rep: Reputation: 2
After monitoring for some time the named process, and after some killing and restarting, now the load average and the cpu/ram usage seems lower than before, at the range of 20-40% cpu and 35% ram.

Maybe it was a DoS attack originating from a range of ip.

I'll keep monitoring and investigating more.

Rgds
 
Old 01-08-2014, 02:47 PM   #7
boatbodger
LQ Newbie
 
Registered: Jan 2014
Posts: 2

Rep: Reputation: Disabled
I had a similar problem. Whilst I had already tried creating /var/named/dynamic to no avail, I had bind running as chroot and eventually realised I was creating the folder in the wrong place.

What I had to do (in Fedora 14) was:

cd /var/named/chroot/named
mkdir dynamic
chown -R named:named dynamic
service named restart

This reduced the CPU util on my machine from 99.7% to less than 1%, and means that name resolution is now far, far quicker.
 
Old 09-09-2020, 11:16 AM   #8
adarshcentos
LQ Newbie
 
Registered: Sep 2020
Posts: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by enid View Post
After monitoring for some time the named process, and after some killing and restarting, now the load average and the cpu/ram usage seems lower than before, at the range of 20-40% cpu and 35% ram.

Maybe it was a DoS attack originating from a range of ip.

I'll keep monitoring and investigating more.

Rgds
I am facing the same issue, in my dns server, sometimes it works fine and on some days the CPU goes high and no domains resolve, someone plz give the solution.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CPU usage too high! rock.k Linux - Newbie 4 03-01-2008 04:48 AM
sendmail problem. cpu usage very high! have log to see! singying304 Linux - Server 1 04-21-2007 05:48 AM
High CPU usage ?! Why? skate Linux - Software 1 04-11-2007 05:55 AM
High Cpu usage untak Debian 21 01-23-2007 06:21 AM
cpu usage high corbintechboy VectorLinux 2 07-27-2005 08:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration