Operating System - HP-UX
1823986 Members
4166 Online
109667 Solutions
New Discussion юеВ

Slow response to localhost ping

 
SOLVED
Go to solution
Steven E. Protter
Exalted Contributor

Slow response to localhost ping

I type ping localhost

I get a delay of over 30 seconds before it fails over to FILES and the ping responds.

Believe it or not, Oracle 10G is being disrupted by this because it times out starting the httpd server.

I'm attaching my nsswitch.conf file.

nslookup localhost

Gets an instantaneous response.

Is there a way I can get the switch to FILES to happen more quickly. If there is no response from the DNS server I need not to wait 30 seconds.

If this is controlled at the DNS server, let me know and I'll talk to my Microsoft people. If however I can control this with configuration changes to hp-ux, I'd like to know how.

BIND 9.2 is installed.

Found this thread.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=213818
Was not very helpful.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
15 REPLIES 15
Pete Randall
Outstanding Contributor

Re: Slow response to localhost ping

Steve,

First off, I'd search hosts first. It's instantaneous and all your local systems should be there for instant resolution. Then you go to dns if need be. Like this:

hosts: files[NOTFOUND=continue UNAVAIL=continue] dns [NOTFOUND=continue UNAVAIL=continue TRYAGAIN=return] nis


Pete

Pete
Gary L. Paveza, Jr.
Trusted Contributor

Re: Slow response to localhost ping

Just an opinion, but I would change your nsswitch to use files first, then DNS. The reason being that you can override DNS with the hosts file (I use this to redirect machine-to-machine traffic over a different network than machine-to-users).

Any special reason you're doing DNS before files?

When we had requested that localhost be put into the DNS server, our admin went nuts - saying that it shouldn't be there.
Patrick Wallek
Honored Contributor

Re: Slow response to localhost ping

I agree 100%. Go with files first and then DNS. If you must use DNS first, you could try adding a localhost entry to DNS with the 127.0.0.1 IP and see if that helps.
Steven E. Protter
Exalted Contributor

Re: Slow response to localhost ping

I was afraid you'd suggest going files first.

In the past that has caused significant delays in resolving the ip addresses of remote windows printers which my print spooler must service.

I'll give it a try, run some tests and see if this is acceptable.

If there is another trick I can use to reduce "failover" time I'd like to hear it.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
harry d brown jr
Honored Contributor

Re: Slow response to localhost ping


One, make sure you are using bind 9.2.+

second, your DNS server as Patrick pointed out, does not have localhost defined. This is a sticky point. Purists will say it shouldn't be there and others say it should. The Internet root servers have it defined!!!

Anyways, I built a DNS caching server that is at least 16 times faster than using files - once the entry is cached.

You have to define localhost as a zone. I included loopback and loghost, thus covering any platform (mostly solaris). This usually works on hp-ux, linux, solaris and aix. With aix and any other system that is IP6 enabled, this probably will NOT work.

attached is a text file with configurations. ENJOY!

live free or die
harry d brown jr

Live Free or Die
Gary L. Paveza, Jr.
Trusted Contributor

Re: Slow response to localhost ping

If you're worried about your printers, then why not put them in your hosts file? I know it can be a pain to keep up with the entries, but I find that having a host file which contains commonly used addresses (I even put companies who we ftp to) helps a lot. One thing - if you have a lot of servers, it really helps if you can standardize your file. I have to keep 3 different ones, but that beats having dozens.
Steven E. Protter
Exalted Contributor

Re: Slow response to localhost ping

The files first scenario immediately broke oracle ias 10G.

We are cycling the application and re-testing.

We are on the very lastest 9.2 BIND release.

Setting up our own DNS database is problematic.

1) Management doesn't want it, even if it solves a problem. He perceives complexity and maintenance issues and is worried what happens if I get hit by a bus.

2) Caching the Microsoft DNS servers causes the same issue as item 1, plus we need admin access to download the DNS database.

Though it may not be the best idea, we are going to see how much FILES first actually breaks.

I'll get back to everyone and assign points before Merijn's cron job runs stats.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
harry d brown jr
Honored Contributor
Solution

Re: Slow response to localhost ping


<==Setting up our own DNS database is problematic.

DNS Caching is NOT the same as being a DNS Server. The local db.zone files are just to locally answer localhost, loghost and loopbak - NOTHING ELSE.

The rest of the CACHE is EMPTY, until a query occurs. At that time it goes to DNS, gets the info and CACHES it in memory. It WILL respect the TTL (Time-To-Live). When the TTL expires the Cached entry is automatically deleted. It will not look it up again until a process requests that ip/name again.

I forgot to add these files:

/etc/nsswitch.conf

hosts: dns[NOTFOUND=continue UNAVAIL=continue FOUND=return] files[NOTFOUND=continue UNAVAIL=continue FOUND=return] files


/etc/resolv.conf
domain YOURDOMAINNAME.com
options ndots:2


We converted over 300 HP-ux servers to DNS Caching and it is ROCK SOLID.

If you need to clear the cache, you simply issue:

rndc flush

live free or die
harry d brown jr
Live Free or Die
TwoProc
Honored Contributor

Re: Slow response to localhost ping

I've run into the same problem before on a bunch of Linux servers. The solution that I found (and had mental trouble getting over) was to a) put files first in nsswitch.conf, and then b) put the hostname as 127.0.0.1 in the hosts file - this solved all of my problems with getting a raft of Oracle services to agree to come up when I wanted them to. Although my solution had to deal with having the services respond to both actual and virtual IP's (might be different than what you're dealing with). The end solution was to map them both to the loopback address in the hosts file. I tried it as a lark out of desperation - and oddly enough - it worked.

Good Luck.
We are the people our parents warned us about --Jimmy Buffett
harry d brown jr
Honored Contributor

Re: Slow response to localhost ping

Again, I have this configuration on Hp-ux, Linux, AIX, Solaris Sparc and Solaris x86.

live free or die
harry d brown jr
Live Free or Die
Steven E. Protter
Exalted Contributor

Re: Slow response to localhost ping

This entire thread is a red herring.

Seems oracle support was demanding my dba make a web page work both with ip address and hostname.

http://tzfat:7781

http://127.0.0.1:7781

Of course they didn't bother to tell my DBA that he needed to run it on a browser running off the server. He was running it in IE 6 from his desktop, which of course got no answer since localhost is not defined in our windows configuration.

It's not the dba's fault. This is one of the reasons they keep me around in spite of my attitude. :-)

We have no run with files first in nsswitch.conf and dns first.

Each configuration generates different oracle errors. When we hard code 127.0.0.1 into the oracle configuration files the product works, but blows the testing user out at randome periods of between 2 and 120 minutes.

So guess what, Oracle is broken, not the system. Not the first time, not the last.

I'm going to give every helpful response solution level points and thank you for your efforts.

I'd actually like to find out how to deal with that delay situation in a way not yet proposed in this thread, so I'm leaving it open.

Thanks. They always seem to have these probems when I have 15 things to do. Have to batton down the hatches prior to making an unplanned trip to Israel.


SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bill Hassell
Honored Contributor

Re: Slow response to localhost ping

The magic number in DNS delays is 30 seconds. This is the length of time that the resolver waits for a response from a DNS server. If all the servers (in resolv.conf) refuse to talk to your system, it will take 90 seconds before trying the next choice in nsswitch.conf. Using FILES first should not be a problem except in the Oracle strangeness you've seen. When I see 30 second delays, I immediately test each individual DNS server in resolv.conf using nslookup DNS_server. By specifying the DNS server, nslookup bypasses FILES and first tries the specified server. If it fails, it's time to go after the DNSadmins. 127.0.0.1 and other localhost entries are always problematic for DNS servers, thus the reason to use FILES first then DNS.


Bill Hassell, sysadmin
Steven E. Protter
Exalted Contributor

Re: Slow response to localhost ping

Bill,

Thanks.

You know my DNS admins are untouchable right?

I'm in a box, but we seem to have oracle stablized, if in a configuration that Oracle support does not support.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Florian Heigl (new acc)
Honored Contributor

Re: Slow response to localhost ping

SEP: Usually Windows ADS admins have never read a book on DNS administrator (let alone X.500 :)) and just don't add a reverse entry for localhost. Out of 4 AD setups I saw, 4 didn't do it properly.

Tell them how to do the mouse clicks, if needed I'll provide screenshots :)

Also, You can and should set the timeouts in /etc/resolv.conf
the parameters are 'retry' and 'retrans' (takes ms as metric)
HP-UX 11.00 needed patches for that, 11.11 should do it out the box.

I'd set the order in /etc/nsswitch.conf to first lookup to /etc/hosts (only containing localhost and hostname entries), set the timeouts well below oracle's and beat the DNS admins to fix their stuff.
yesterday I stood at the edge. Today I'm one step ahead.
Florian Heigl (new acc)
Honored Contributor

Re: Slow response to localhost ping

Please have a look at the following document - it's about changing the retry the magic retry and retrans parameters.


http://docs.hp.com/en/B2355-90775/ch02s08.html

usually they're only used for faster switching when a DNS server completely fails, but they should do the trick.
unfortunately bind9 doesn't provide a max-query-timeout for a forward dns resolver, BUT
You could also put the localhost.your.domain.com zone in Your bind config on the oracle without causing any influences to the outside network.
yesterday I stood at the edge. Today I'm one step ahead.