LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-04-2007, 06:29 AM   #1
walidaly
Member
 
Registered: Mar 2007
Posts: 64

Rep: Reputation: 15
Exclamation rm -rf 4GB_DIR kills server


my cache folder becomes 4GB over night and I need to clean it, I do
Code:
mv cachedir cachedir.old
then try to remove it
Code:
rm -rf cachedir.old
I get the load to jump and server stop responding till it cleans the files
also tried
Code:
find cache.old -type f | xargs -r rm
same result
the rm -d doesn't work on CENTOS 4 (RHEL5)
files are compressed .gz
 
Old 11-04-2007, 10:19 AM   #2
heson
LQ Newbie
 
Registered: Nov 2007
Posts: 6

Rep: Reputation: 0
I would try:
Code:
nice find cachedir.old -type f -exec ionice -c3 rm -f {} \;
maybe with some extra ionice and nice to make it even slower.
 
Old 11-06-2007, 05:12 AM   #3
walidaly
Member
 
Registered: Mar 2007
Posts: 64

Original Poster
Rep: Reputation: 15
nice didn't do much for me, I dont have ionice either...my kernel is 2.6.9 maybe that's the issue?
I even tried using sleep like
Code:
for i in $(ls); do sleep 0.1s;rm -vf ${i}; done
I tried a workaround which calm rm down a little
Code:
renice -20 -u www
renice 20 -u root
not sure if it's the write solution though but all important services run under other users
 
Old 11-06-2007, 05:15 AM   #4
walidaly
Member
 
Registered: Mar 2007
Posts: 64

Original Poster
Rep: Reputation: 15
the load still high, not as b4 but I want it to stay under 1%
here stats using top
Code:
PID   USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
19121 root      34  19  4460  440  372 D    1  0.0   0:05.08 rm
18899 www        0 -20 68012  15m  13m S    1  0.4   0:02.59 php-cgi
18907 www        0 -20 67864  17m  15m S    1  0.4   0:05.47 php-cgi
18493 www        0 -20 67300 5076 3228 S    1  0.1   0:00.03 php-cgi
18515 www        0 -20 67640 4976 3352 S    1  0.1   0:00.03 php-cgi
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ctrl+backspace kills the X server crisostomo_enrico Solaris / OpenSolaris 12 09-22-2007 01:17 PM
CTR-ALT-F1 kills X server arc2v Linux - General 3 05-24-2006 07:04 AM
Bind (DNS server named) starts and kills? again tiuz Slackware 4 04-15-2006 05:50 PM
SHIFT-Backspace Kills X-Server larki Linux - Newbie 2 03-04-2006 11:28 AM
Any software install with YAST kills X server 1kyle SUSE / openSUSE 3 11-10-2005 01:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration