summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-05-15 23:17:24 +0000
committerben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-05-15 23:17:24 +0000
commitc3beb4a2425f1ca142f1c773ca8205399b48c993 (patch)
tree11631cdfa3528e8c19b4a43a3eaf2d25c7716d1d
parent036ee5fc7e9a99ceb9e5f8661b76c092bb052e53 (diff)
downloadrdiff-backup-c3beb4a2425f1ca142f1c773ca8205399b48c993.tar.gz
Enabled ssh compression by default, increased conn_bufsize.
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@88 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/CHANGELOG4
-rw-r--r--rdiff-backup/rdiff-backup.16
-rw-r--r--rdiff-backup/rdiff_backup/rpath.py10
-rw-r--r--rdiff-backup/src/globals.py5
-rwxr-xr-xrdiff-backup/src/main.py7
-rw-r--r--rdiff-backup/src/rpath.py10
-rw-r--r--rdiff-backup/src/setconnections.py8
7 files changed, 35 insertions, 15 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index 8c2f880..a25c943 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -1,6 +1,10 @@
New in v0.7.5 (2002/06/01)
--------------------------
+After a bit of empirical testing, increased Globals.conn_bufsize and
+enabled ssh compression by default. This should speed up the
+"typical" remote session.
+
Fixed bug noticed by Dean Gaudet in processing of
--(include|exclude)-filelist[-stdin] options when source directory was
remote.
diff --git a/rdiff-backup/rdiff-backup.1 b/rdiff-backup/rdiff-backup.1
index 5392b9c..097ec73 100644
--- a/rdiff-backup/rdiff-backup.1
+++ b/rdiff-backup/rdiff-backup.1
@@ -245,6 +245,12 @@ number of seconds ago. Otherwise start a new backup. The default is
Enter server mode (not to be invoked directly, but instead used by
another rdiff-backup process on a remote computer).
.TP
+.B --ssh-no-compression
+When running ssh, do not use the -C option to enable compression.
+.B --ssh-no-compression
+is ignored if you specify a new schema using
+.B --remote-schema.
+.TP
.BI "--terminal-verbosity " [0-9]
Select which messages will be displayed to the terminal. If missing
the level defaults to the verbosity level.
diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py
index 5ed36f5..414268c 100644
--- a/rdiff-backup/rdiff_backup/rpath.py
+++ b/rdiff-backup/rdiff_backup/rpath.py
@@ -247,13 +247,13 @@ class RORPath(RPathStatic):
This object doesn't contain any information about the file,
but, when passed along, may show where the previous stages are
in their processing. It is the RORPath equivalent of fiber.
+ This placeholder size, in conjunction with the placeholder
+ threshold in Highlevel .. generate_dissimilar seem to yield an
+ OK tradeoff between unnecessary placeholders and lots of
+ memory usage, but I'm not sure exactly why.
"""
- self.data = {'placeholder':
- ("It is actually good for placeholders to use"
- "up a bit of memory, so the buffers get flushed"
- "more often when placeholders move through."
- "See the get_dissimilar docs for more info.")}
+ self.data = {'placeholder': " "*500}
def isplaceholder(self):
"""True if the object is a placeholder"""
diff --git a/rdiff-backup/src/globals.py b/rdiff-backup/src/globals.py
index 58c43d4..508d0ed 100644
--- a/rdiff-backup/src/globals.py
+++ b/rdiff-backup/src/globals.py
@@ -20,7 +20,7 @@ class Globals:
# This is used by the BufferedRead class to determine how many
# bytes to request from the underlying file per read(). Larger
# values may save on connection overhead and latency.
- conn_bufsize = 4096
+ conn_bufsize = 98304
# True if script is running as a server
server = None
@@ -139,6 +139,9 @@ class Globals:
"jpg|gif|png|jp2|mp3|ogg|avi|wmv|mpeg|mpg|rm|mov)$"
no_compression_regexp = None
+ # Determines whether or not ssh will be run with the -C switch
+ ssh_compression = 1
+
# On the reader and writer connections, the following will be
# replaced by the source and mirror Select objects respectively.
select_source, select_mirror = None, None
diff --git a/rdiff-backup/src/main.py b/rdiff-backup/src/main.py
index 72d93ce..a6c1ce0 100755
--- a/rdiff-backup/src/main.py
+++ b/rdiff-backup/src/main.py
@@ -36,8 +36,9 @@ class Main:
"parsable-output", "quoting-char=", "remote-cmd=",
"remote-schema=", "remove-older-than=",
"restore-as-of=", "resume", "resume-window=", "server",
- "terminal-verbosity=", "test-server", "verbosity",
- "version", "windows-mode", "windows-time-format"])
+ "ssh-no-compression", "terminal-verbosity=",
+ "test-server", "verbosity", "version", "windows-mode",
+ "windows-time-format"])
except getopt.error, e:
self.commandline_error("Bad commandline options: %s" % str(e))
@@ -100,6 +101,8 @@ class Main:
elif opt == '--resume-window':
Globals.set_integer('resume_window', arg)
elif opt == "-s" or opt == "--server": self.action = "server"
+ elif opt == "--ssh-no-compression":
+ Globals.set('ssh_compression', None)
elif opt == "--terminal-verbosity": Log.setterm_verbosity(arg)
elif opt == "--test-server": self.action = "test-server"
elif opt == "-V" or opt == "--version":
diff --git a/rdiff-backup/src/rpath.py b/rdiff-backup/src/rpath.py
index 5ed36f5..414268c 100644
--- a/rdiff-backup/src/rpath.py
+++ b/rdiff-backup/src/rpath.py
@@ -247,13 +247,13 @@ class RORPath(RPathStatic):
This object doesn't contain any information about the file,
but, when passed along, may show where the previous stages are
in their processing. It is the RORPath equivalent of fiber.
+ This placeholder size, in conjunction with the placeholder
+ threshold in Highlevel .. generate_dissimilar seem to yield an
+ OK tradeoff between unnecessary placeholders and lots of
+ memory usage, but I'm not sure exactly why.
"""
- self.data = {'placeholder':
- ("It is actually good for placeholders to use"
- "up a bit of memory, so the buffers get flushed"
- "more often when placeholders move through."
- "See the get_dissimilar docs for more info.")}
+ self.data = {'placeholder': " "*500}
def isplaceholder(self):
"""True if the object is a placeholder"""
diff --git a/rdiff-backup/src/setconnections.py b/rdiff-backup/src/setconnections.py
index 29665db..a32c68e 100644
--- a/rdiff-backup/src/setconnections.py
+++ b/rdiff-backup/src/setconnections.py
@@ -16,9 +16,10 @@ class SetConnections:
"""
# This is the schema that determines how rdiff-backup will open a
- # pipe to the remote system. If the file is given as A:B, %s will
+ # pipe to the remote system. If the file is given as A::B, %s will
# be substituted with A in the schema.
- __cmd_schema = 'ssh %s rdiff-backup --server'
+ __cmd_schema = 'ssh -C %s rdiff-backup --server'
+ __cmd_schema_no_compress = 'ssh %s rdiff-backup --server'
# This is a list of remote commands used to start the connections.
# The first is None because it is the local connection.
@@ -27,6 +28,9 @@ class SetConnections:
def InitRPs(cls, arglist, remote_schema = None, remote_cmd = None):
"""Map the given file descriptions into rpaths and return list"""
if remote_schema: cls.__cmd_schema = remote_schema
+ elif not Globals.ssh_compression:
+ cls.__cmd_schema = cls.__cmd_schema_no_compress
+
if not arglist: return []
desc_pairs = map(cls.parse_file_desc, arglist)