Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 2nd July 2013, 00:54
Erjen Erjen is offline
Junior Member
 
Join Date: Feb 2013
Posts: 19
Thanks: 9
Thanked 1 Time in 1 Post
Default Very slow performance during backup

Hi,

I noticed it before, and now my server is really slow again during backup.
Every night, when the backup has started, as the command ps aux shows, it uses all of my CPU resources:
root 28054 4.1 0.0 18372 1284 ? D 00:32 0:24 tar pczf /var/backup/web14/web14_2013-07-01_22-32.tar.gz --exclude=backup* --directory /var/www/clients/client3/web14 .
root 28055 86.0 0.0 4092 772 ? S 00:32 8:25 gzip

The virtual server has eight cores with 8 GB memory and I am hosting about 30 not very busy websites. And during the backups the websites are really hardly visible.

Is there something I can do so the performance will not be influenced during the night backup? Maybe I can set the backup to very low priority?

Thanks!
Reply With Quote
Sponsored Links
  #2  
Old 2nd July 2013, 01:23
rosehosting rosehosting is offline
Member
 
Join Date: Jun 2012
Posts: 39
Thanks: 0
Thanked 7 Times in 6 Posts
Default

you have to find if your CPU or the I/O is the issue. you can monitor your server with top and watch the columns '0.0%us' and '0.0%wa'.

then if possible, you can try lowering the cpu or io priority of the backup process and see if that will help you.

in general tar, especially when passing the compression to gzip is known to be causing high cpu spikes.

re-nicing the proccess on cpu and io may help sometimes.

check 'ionice' and 'nice'
__________________
---=== RoseHosting.com Admin ===---
Linux Cloud Hosting - http://www.linuxcloudvps.com
Linux VPS Hosting - http://www.rosehosting.com/linux-vps-hosting.html
SSD Virtual Servers - http://www.virtual-server.org
Reply With Quote
The Following User Says Thank You to rosehosting For This Useful Post:
Erjen (2nd July 2013)
  #3  
Old 2nd July 2013, 16:31
Erjen Erjen is offline
Junior Member
 
Join Date: Feb 2013
Posts: 19
Thanks: 9
Thanked 1 Time in 1 Post
Default

Hi rosehosting,

Thanks for your answer! I will try this when the backup is going on again.
Reply With Quote
  #4  
Old 7th August 2013, 01:55
Erjen Erjen is offline
Junior Member
 
Join Date: Feb 2013
Posts: 19
Thanks: 9
Thanked 1 Time in 1 Post
Default

Hi,

I monitored a couple of days my servers and these are my findings:
My server keeps slow in the backup session which runs from 12 am to approximately 1 am.
Monitoring my server with "top", Gzip gives a CPU-usage of about 40% and tar about 10%. The CPU-usage does not pass the 75%.
The command "nice" gives "0" and the command ionice gives "none: prio 4".

So what do I need to do now? I really need a solution.

Thanks again!
Reply With Quote
  #5  
Old 7th August 2013, 07:56
florian030 florian030 is offline
Senior Member
 
Join Date: Oct 2012
Posts: 187
Thanks: 7
Thanked 47 Times in 41 Posts
Default

You should add something like ionice -c2 to exec('tar pczf ' in the source.
__________________
regards
Florian

blog.schaal-24.de
Reply With Quote
The Following User Says Thank You to florian030 For This Useful Post:
Erjen (7th August 2013)
  #6  
Old 7th August 2013, 09:23
Erjen Erjen is offline
Junior Member
 
Join Date: Feb 2013
Posts: 19
Thanks: 9
Thanked 1 Time in 1 Post
Default

Thanks Florian, I will try that and I will let you know!
Reply With Quote
  #7  
Old 7th August 2013, 09:28
florian030 florian030 is offline
Senior Member
 
Join Date: Oct 2012
Posts: 187
Thanks: 7
Thanked 47 Times in 41 Posts
Default

exec('ionice -c2 tar pczf .... in cron_daily.php should work.
__________________
regards
Florian

blog.schaal-24.de
Reply With Quote
The Following User Says Thank You to florian030 For This Useful Post:
Erjen (7th August 2013)
  #8  
Old 7th August 2013, 21:21
Erjen Erjen is offline
Junior Member
 
Join Date: Feb 2013
Posts: 19
Thanks: 9
Thanked 1 Time in 1 Post
Default

Hi Florian,

Does it matter where exactly I put that line in the cron_daily.php? Because that file is rather big..

Thanks again
Reply With Quote
  #9  
Old 8th August 2013, 09:04
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 756
Thanks: 15
Thanked 215 Times in 166 Posts
Default

Hi,

yes it does indeed matter
You should search for the line that executes the tar command and change this line to use the ionice command.

In my installation this is line 1135.
__________________
Marius Cramer

pixcept KG
Reply With Quote
The Following User Says Thank You to Croydon For This Useful Post:
Erjen (8th August 2013)
  #10  
Old 8th August 2013, 09:24
Erjen Erjen is offline
Junior Member
 
Join Date: Feb 2013
Posts: 19
Thanks: 9
Thanked 1 Time in 1 Post
 
Default

Hi Croydon,

Thanks for your reply!
Just to be sure:
You are in the file /usr/local/ispconfig/server/cron_daily.php?
Because that file has only 954 in my case.

And these lines of codes I can find according the tar backup:
PHP Code:
//* Create a tar.gz backup as root user
                    
$web_backup_file 'web'.$web_id.'_'.date('Y-m-d_H-i').'.tar.gz';
                    
exec('tar pczf '.escapeshellarg($web_backup_dir.'/'.$web_backup_file).' --exclude=backup\* --directory '.escapeshellarg($web_path).' .'); 
So the code
PHP Code:
exec(tar pczf 
Should be changed with:
PHP Code:
exec(ionice -c2 tar pczf 
?

Thanks!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Online Backup : What do you use and how do you setup it ? XZed Technical 5 4th January 2010 18:02
Looking for an automatic backup for ISPConfig unsichtbare Installation/Configuration 1 2nd May 2008 14:33
[SHELL Script] - Backup WEB & DATABASES vaio1 Tips/Tricks/Mods 0 5th September 2007 14:48
Slow network performance reading data JoeySpace Installation/Configuration 2 10th April 2007 17:42
Setting up a backup mail server setup with two installations of ISPConfig zitch Tips/Tricks/Mods 7 30th December 2006 10:07


All times are GMT +2. The time now is 13:32.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.