Solved

rm huge backup file freezes web server

Posted on 2014-12-10
4
228 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 7

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 13

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

803 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