Solved

rm huge backup file freezes web server

Posted on 2014-12-10
4
226 Views
Last Modified: 2014-12-15
Hi experts,

I found a problem on an Ubuntu-server (ext3) when deleting huge backup-files (50GB).
While deleting with "rm -r" I  the webserver apache will freeze for 1 minute.
I think it is because if the I/O load.

On a forum I found that using "ionice" would help.
So I could try using following:

ionice -c2 -n7 rm -r /path/to/the/backup_file

Open in new window


Do you think it is fine to use this?
Do you have an idea how long the deletion process would take? Without ionice it takes abot 4 minutes to delete a file with 50GB.

The goal is deleting the huge file while the server is running and the website should not be influenced.
0
Comment
Question by:Systemadministration
  • 2
4 Comments
 
LVL 6

Expert Comment

by:Thomas Wheeler
ID: 40493208
Sounds like your need to figure out whats going on with your disk. What type of setup is this? Is it one drive, a raid or an iscsi mount? Deleting this file should not cause this result. Are there errors in the logs?
0
 

Author Comment

by:Systemadministration
ID: 40493212
This seems to be a known problem:
http://serverfault.com/questions/480526/deleting-very-large-file-without-webserver-freezing

My question is only about ionice.
0
 
LVL 12

Accepted Solution

by:
Phil Phillips earned 500 total points
ID: 40493222
A better strategy might be to either store the backups on another server, or on another disk array.  That way, if you have to do disk-intensive operations, it won't affect the files that apache is trying to access.

That said, ionice should be fine as a work-around.  Another option would be to try truncating the file (which could be faster than the rm command):

> /path/to/the/backup_file

Open in new window


If you *really* want to get a feel for how long it will take, I recommend (if possible) testing it out first on a similar (but non-production) instance.
0
 

Author Closing Comment

by:Systemadministration
ID: 40500010
Great!
Truncation the 56GB file only took a few seconds. After that tha space was free again and I could delete the truncated file without risk.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now