Solved

rm huge backup file freezes web server

Posted on 2014-12-10
4
231 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 14

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Fine Tune your automatic Updates for Ubuntu / Debian
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

752 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