Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Solaris 9: nscd and nscd.conf - High cpu use.

868 views
Skip to first unread message

Ed

unread,
Feb 8, 2006, 2:00:34 PM2/8/06
to
I have a server that ncsd daemon run and it process causes a elevation
cpu's use, but the sum from cpu usage in top command isn't 100% and
percentage idle is 0%.

This problem happen in solaris 9 and nscd.conf is default file.

Let me know:
How configure nscd.conf to the better performance according to
statistics from output "nscd -g" command?

Thanx.
Ed.

Michael Tosch

unread,
Feb 8, 2006, 2:45:49 PM2/8/06
to

The purpose nscd is to decrease network usage and maybe even CPU usage.

nscd is not needed, but killing it might add CPU usage to system/kernel,
and lower the overall performance.

Find out if there is a process that continuesly queries a name service
which is cached by nscd.
Or maybe it is queried over the network - then snoop will find out.


--
Michael Tosch @ hp : com

Dexthor

unread,
Feb 8, 2006, 3:01:38 PM2/8/06
to
Can you post the output of your nscd -g ? Please take 2 snapshots with
5-10mins apart and compare which of the counters/modules are getting
used more. That can help you which process/service on the host is
causing this. Accordingly you could tune your box.

Top may not show you all the processes in one terminal display. If you
want to really do the CPU match try this:
ps -eafo pcu,pid,comm|awk 'BEGIN{cputot=0}{cputot+=$1}END {print "Total
CPU:",cputot}'

You may not see it adding up to 100% coz, I/O waits may not be
accounted into process's CPU utilization.

-Dexthor.

Darren Dunham

unread,
Feb 8, 2006, 3:29:07 PM2/8/06
to
Dexthor <gmol...@gmail.com> wrote:
> You may not see it adding up to 100% coz, I/O waits may not be
> accounted into process's CPU utilization.

Well, if you're trying to add up all the process percentages, the output
in 'top', 'ps' and default 'prstat' are all the same and probably won't
come close to 100% unless things haven't started, died, or changed the
amount of usage recently (which is almost never true).

Basically, the figures have a long time component in them. If a heavy
process exits, it takes all it's recent CPU with it in the figures, but
the remaining ones will be slow to react and the figures will not sum to
100 for a period of time.

'prstat -m' is more of an "instant" snapshot and has a better shot at
giving you a consistent image like that.

--
Darren Dunham ddu...@taos.com
Senior Technical Consultant TAOS http://www.taos.com/
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >

Dexthor

unread,
Feb 9, 2006, 12:24:21 PM2/9/06
to
Thanks for the nscd output. It looks like majority of the activity in
nscd is happening in the hosts module, so something that's running on
the box is doing DNS lookups.

Is this server running a WebServer or something like that ? If so, most
of these services have options to disable "DNS lookups" on each
request. This might be the best fix.

I dont see any issue with the 99.7% cache hit rate you have on your
hosts-cache though !! Thats pretty good.

Btw, what is your nsswitch.conf (hosts) entry look like ??

-Dexthor.

Gary Mills

unread,
Feb 9, 2006, 2:29:13 PM2/9/06
to

>Thanks for the nscd output. It looks like majority of the activity in
>nscd is happening in the hosts module, so something that's running on
>the box is doing DNS lookups.

If you have nameservers that do caching, you can disable caching in
nscd by setting:

enable-cache hosts no

in /etc/nscd.conf. We do it this way on all of our Solaris machines.
For large tables, you can also increase the hash size in nscd.

--
-Gary Mills- -Unix Support- -U of M Academic Computing and Networking-

Ed

unread,
Feb 9, 2006, 2:30:48 PM2/9/06
to
Hi Dexthor,
Thanks again for your answer.

Yes, this server is a WebServer.
The host entry in the nsswitch.conf as follows:

hosts: files dns


Thanks.
Ed.

Dexthor

unread,
Feb 9, 2006, 3:41:50 PM2/9/06
to
Can you check your WebServer if it has DNS Lookups Enabled ? If so,
does it have Local Name Caching facility within it ? If yes, set its
size to be high enough so that you wont have problems and depending on
nscd for resolutions.

Can you live without DNS lookups on the WebServer ??

-Dexthor.

bart.sm...@gmail.com

unread,
Feb 10, 2006, 1:24:49 AM2/10/06
to
Take a look at the cache size under use
and make sure that the suggested size
of the hosts table isn't less than 10 times less.

hosts cache:

Yes cache is enabled
212294 cache hits on positive entries
1539 cache hits on negative entries
79234 cache misses on positive entries
25929 cache misses on negative entries
67.0% cache hit rate
0 queries deferred
54 total entries
211 suggested size
3600 seconds time to live for positive entries
5 seconds time to live for negative entries
20 most active entries to be kept valid
Yes check /etc/{passwd, group, hosts, inet/ipnodes} file for
changes
No use possibly stale data rather than waiting for refresh

- Bart

0 new messages