rm -rf stalls server

Artem Kuchin artem at artem.ru
Fri Mar 27 07:37:11 UTC 2015


26.03.2015 23:25, Mehmet Erol Sanliturk пишет:
>
>
> On Thu, Mar 26, 2015 at 10:46 AM, Artem Kuchin <artem at artem.ru 
> <mailto:artem at artem.ru>> wrote:
>
>     So, i do
>     rm -rf  tree_root
>
>     After i do it in 5 minutes process count goes over 1000, mysql is
>     flooded with
>     request it cannot complete. I can barely type anything. Top shown
>     tons of processes
>     in 'ufs' status.
>     So, I ctrl-C  rm command
>     and kill -9 apache, otherwise it will take like 20 minutes to
>     resume normal operations.
>
>
>
>
> I am using  a script to delete .BAK files from many directories with  
> lines like
>
> rm path/*.BAK
> find path -name '*.BAK'  -exec rm -f '{}' +
>
>
> I think , it will not load your CPU continuously with a single 
> execution for all of the directories .
>
>
Well, it is not about CPU load. Disk system is overloaded.
I probably missed one important point
What if user starts tarring or rmrfing something and stalls server? Is 
there system way to lower io priority or limit io ops per user?
Basically, if user does rm -rf on huge tree it is an equivalent of a 
fork bomb.

Artem





More information about the freebsd-questions mailing list