LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Server hangs when given find command (https://www.linuxquestions.org/questions/linux-server-73/server-hangs-when-given-find-command-851293/)

stg_in2009 12-19-2010 11:23 PM

Server hangs when given find command
 
Hi All,

I am ClearCase Admin, new to Linux administration and our development environment is in linux servers.
I have found that our development server which is RHEL 3 (also ClearCase client) hangs when user gives find command.
Command is as follows:
<normal user>$ cd /
<normal user>$ find . -name "<filename>"

After some time of execution of the find command the server hangs. We have to hard-boot the server.
Is this the normal behaviour of the Servers? This server which I am talking about is highly used.
Sometimes 120 or more terminals will be opened and few compilation will be happening in the server. And same single user some times opens multiple terminals and works simulataneously.
We have been monitoring the server and found out that during the workdays CPU usage % goes very high.

I was wondering if it is normal behaviour for Linux servers getting hanged when running find command as above.
Kindly put your valuable inputs.

Thanks

STG

chickenjoy 12-20-2010 02:38 AM

Quote:

I was wondering if it is normal behaviour for Linux servers getting hanged when running find command as above.
Well to answer your question; no this is not normal. I had ran several find commands on a range of servers and none caused the servers to hang or crash.

Maybe its time to move to a more powerful server if you monitor that the cpu usage rises above 85% very often. This does not mean that your server is to blame since (I assume) that a few months ago it doesn't. It just implies that either more users are accessing the server or the same number of users are issuing more CPU and Disk intensive tasks on the server.

stg_in2009 12-21-2010 12:22 AM

Thank you so much for the reply.
I have one clarification. Is it possible to control the CPU usage? I mean if it reaches 85% or 90% then server should not allocate resources to other incoming request but to put them on wait mode. When the CPU usage % reaches down (say below 85%) let the queue calls / requests get the allocation to execute which is in wait mode.
Just wanted to know some work around for this as shifting to new server would take time.
Thank you once again

Regards

STG

Reuti 12-21-2010 05:55 AM

As a first measure you could start find by using nice:

Code:

$ nice -n 19 find / -name filename
But why it crashes the system needs further investigation for sure. When you want to search across the whole file system, maybe you want to install locate, which will make the find in a cronjob and creates a database which will give the result faster when you issue the command.


All times are GMT -5. The time now is 01:35 AM.