cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with find command

welshowen
Occasional Advisor

Problems with find command

Experiencing some strange behaviour when running find commands on an RX2660, HP-UX 11.31

As soon as the find command is initiated, e.g. 'find / -name cache.cpf'

there is what seems like a massive perfomance hit. Any new logons just hang around, and won't respond until the find command is killed off, which in itself takes some time.

We don't have this problem on our old D-class servers, so I'm surprised that there appears to be a problem on the newer hardware.

Is there a known problem with this command?
3 REPLIES
James R. Ferguson
Acclaimed Contributor

Re: Problems with find command

Hi:

> Is there a known problem with this command?

Well, yes, insofar as you are causing 'find' to search _every_ directory on your server. If you have a large number of directories and files therein then this is going to take quite a while. You should restrict your search to one or more "logical" places; for instance:

# find /opt /cachedb -xdev -type f -name cache.cpf

The addition of '-xdev' prevents crossing mountpoints and '-f' limits matches to files.

If you have a DVD or CD mounted or an NFS mount you may also see slower response. Another way to eliminate searching these mountpoints is to limit 'find()' to a specific filesystem type, for example:

# find /opt /cachedb -fsonly JFS ...

See the 'find' manpages for more information.

Regards!

...JRF...
welshowen
Occasional Advisor

Re: Problems with find command

I appreciate it's not the most efficient way to run the command, searching root, but as I mentioned, it's never had this sort of impact before.

Will take your advice on board though, thanks.
T G Manikandan
Honored Contributor

Re: Problems with find command

Does your old D class run the same hpux version.

the command you run is very intensive, searching from root.


there were some inconsistencies with the find command, please check this patch PHCO_36666,worth updating if not present already.