|
From: <di...@us...> - 2010-11-21 19:09:19
|
Revision: 704
http://safekeep.svn.sourceforge.net/safekeep/?rev=704&view=rev
Author: dimi
Date: 2010-11-21 19:09:13 +0000 (Sun, 21 Nov 2010)
Log Message:
-----------
Add support for ionice(1)
Modified Paths:
--------------
safekeep/trunk/doc/safekeep.conf.txt
safekeep/trunk/safekeep
safekeep/trunk/safekeep.conf
Modified: safekeep/trunk/doc/safekeep.conf.txt
===================================================================
--- safekeep/trunk/doc/safekeep.conf.txt 2010-11-19 22:05:07 UTC (rev 703)
+++ safekeep/trunk/doc/safekeep.conf.txt 2010-11-21 19:09:13 UTC (rev 704)
@@ -64,6 +64,17 @@
the .backup file (see /backup/host/@nice).
NB: if you change this value, you will have to re-deploy the auth keys.
+ionice.adjustment::
+ The default IO nice level adjustment for safekeep.
+ It can be either 'none', 'idle', or an integer between 0-7
+ (with 0 being higher priority). See ionice(1) for more information.
+ This is currently being used only on the server side, where
+ IO load tends to be a problem.
+ NB: this depends on the availability of 'ionice(1)' on the
+ system where the server is running. If ionice cannot be found,
+ this setting is ignored.
+ If no level is specified, it defaults to 'idle'.
+
bandwidth.overall::
This is the default bandwidth limit for both upload and
download for all the clients. It is an integer number of KB/s
Modified: safekeep/trunk/safekeep
===================================================================
--- safekeep/trunk/safekeep 2010-11-19 22:05:07 UTC (rev 703)
+++ safekeep/trunk/safekeep 2010-11-21 19:09:13 UTC (rev 704)
@@ -867,12 +867,18 @@
else:
log(line[:-1])
-def do_server_rdiff(cfg, bdir, nice, force):
+def do_server_rdiff(cfg, bdir, nice, ionice, force):
args = []
if nice:
args.extend(['nice', '-n' + str(nice)])
+ if ionice and ionice != 'none' and try_to_run('ionice'):
+ if ionice == 'idle':
+ args.extend(['ionice', '-c3', '-t'])
+ else:
+ args.extend(['ionice', '-c2', '-n' + ionice, '-t'])
+
args.extend(['rdiff-backup'])
if cfg['host']:
@@ -968,7 +974,7 @@
elif server_minor > client_minor:
warn('Protocol mismatch: %s <> %s' % (PROTOCOL, client_protocol))
-def do_server(cfgs, ids, nice, force, cleanup):
+def do_server(cfgs, ids, nice, ionice, force, cleanup):
debug("Do server main loop")
for cfg in cfgs.itervalues():
id = cfg['id']
@@ -1038,7 +1044,7 @@
else:
backup_marker = None
- do_server_rdiff(cfg, bdir, nice, force)
+ do_server_rdiff(cfg, bdir, nice, ionice, force)
errs = 0
if os.path.isdir(rdiff_logdir):
@@ -1441,6 +1447,9 @@
if nice_def is None: nice_def = 10
nice_srv = get_int('nice.adjustment.server') or nice_def
nice_cln = get_int('nice.adjustment.client') or nice_def
+ ionice_def = get_int('ionice.adjustment')
+ if ionice_def is None: ionice_def = 'idle'
+ if ionice_def is '': ionice_def = 'none'
global default_bandwidth
default_bandwidth['overall'] = get_int('bandwidth.limit') or 0
@@ -1489,7 +1498,7 @@
if mode is 'server':
is_client = False
verbosity_level = 1 + verbosity
- do_server(cfgs, args, nice_srv, force, cleanup)
+ do_server(cfgs, args, nice_srv, ionice_def, force, cleanup)
elif mode is 'list':
if list_type is None:
list_type = 'increments'
Modified: safekeep/trunk/safekeep.conf
===================================================================
--- safekeep/trunk/safekeep.conf 2010-11-19 22:05:07 UTC (rev 703)
+++ safekeep/trunk/safekeep.conf 2010-11-21 19:09:13 UTC (rev 704)
@@ -17,6 +17,10 @@
# to disable nice, set it to 0
# nice.adjustment = 10
+# Default io niceness level used on the server side.
+# Set this to 'none' to disable ionice(1)-ness
+# ionice.adjustment = idle
+
# A default bandwidth limit for both download/upload
# bandwidth.limit=100
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|