]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blob - docs/helper.rst
docs: convert all .txt docs to .rst thanks to Ravi Pinjala
[tahoe-lafs/tahoe-lafs.git] / docs / helper.rst
1 =======================
2 The Tahoe Upload Helper
3 =======================
4
5 1. `Overview`_
6 2. `Setting Up A Helper`_
7 3. `Using a Helper`_
8 4. `Other Helper Modes`_
9
10 Overview
11 ========
12
13 As described in the "SWARMING DOWNLOAD, TRICKLING UPLOAD" section of
14 architecture.txt, Tahoe uploads require more bandwidth than downloads: you
15 must push the redundant shares during upload, but you do not need to retrieve
16 them during download. With the default 3-of-10 encoding parameters, this
17 means that an upload will require about 3.3x the traffic as a download of the
18 same file.
19
20 Unfortunately, this "expansion penalty" occurs in the same upstream direction
21 that most consumer DSL lines are slow anyways. Typical ADSL lines get 8 times
22 as much download capacity as upload capacity. When the ADSL upstream penalty
23 is combined with the expansion penalty, the result is uploads that can take
24 up to 32 times longer than downloads.
25
26 The "Helper" is a service that can mitigate the expansion penalty by
27 arranging for the client node to send data to a central Helper node instead
28 of sending it directly to the storage servers. It sends ciphertext to the
29 Helper, so the security properties remain the same as with non-Helper
30 uploads. The Helper is responsible for applying the erasure encoding
31 algorithm and placing the resulting shares on the storage servers.
32
33 Of course, the helper cannot mitigate the ADSL upstream penalty.
34
35 The second benefit of using an upload helper is that clients who lose their
36 network connections while uploading a file (because of a network flap, or
37 because they shut down their laptop while an upload was in progress) can
38 resume their upload rather than needing to start again from scratch. The
39 helper holds the partially-uploaded ciphertext on disk, and when the client
40 tries to upload the same file a second time, it discovers that the partial
41 ciphertext is already present. The client then only needs to upload the
42 remaining ciphertext. This reduces the "interrupted upload penalty" to a
43 minimum.
44
45 This also serves to reduce the number of active connections between the
46 client and the outside world: most of their traffic flows over a single TCP
47 connection to the helper. This can improve TCP fairness, and should allow
48 other applications that are sharing the same uplink to compete more evenly
49 for the limited bandwidth.
50
51 Setting Up A Helper
52 ===================
53
54 Who should consider running a helper?
55
56 * Benevolent entities which wish to provide better upload speed for clients
57   that have slow uplinks
58 * Folks which have machines with upload bandwidth to spare.
59 * Server grid operators who want clients to connect to a small number of
60   helpers rather than a large number of storage servers (a "multi-tier"
61   architecture)
62
63 What sorts of machines are good candidates for running a helper?
64
65 * The Helper needs to have good bandwidth to the storage servers. In
66   particular, it needs to have at least 3.3x better upload bandwidth than
67   the client does, or the client might as well upload directly to the
68   storage servers. In a commercial grid, the helper should be in the same
69   colo (and preferably in the same rack) as the storage servers.
70 * The Helper will take on most of the CPU load involved in uploading a file.
71   So having a dedicated machine will give better results.
72 * The Helper buffers ciphertext on disk, so the host will need at least as
73   much free disk space as there will be simultaneous uploads. When an upload
74   is interrupted, that space will be used for a longer period of time.
75
76 To turn a Tahoe-LAFS node into a helper (i.e. to run a helper service in
77 addition to whatever else that node is doing), edit the tahoe.cfg file in your
78 node's base directory and set "enabled = true" in the section named
79 "[helper]".
80
81 Then restart the node. This will signal the node to create a Helper service
82 and listen for incoming requests. Once the node has started, there will be a
83 file named private/helper.furl which contains the contact information for the
84 helper: you will need to give this FURL to any clients that wish to use your
85 helper.
86
87 ::
88
89   cat $BASEDIR/private/helper.furl | mail -s "helper furl" friend@example.com
90
91 You can tell if your node is running a helper by looking at its web status
92 page. Assuming that you've set up the 'webport' to use port 3456, point your
93 browser at http://localhost:3456/ . The welcome page will say "Helper: 0
94 active uploads" or "Not running helper" as appropriate. The
95 http://localhost:3456/helper_status page will also provide details on what
96 the helper is currently doing.
97
98 The helper will store the ciphertext that is is fetching from clients in
99 $BASEDIR/helper/CHK_incoming/ . Once all the ciphertext has been fetched, it
100 will be moved to $BASEDIR/helper/CHK_encoding/ and erasure-coding will
101 commence. Once the file is fully encoded and the shares are pushed to the
102 storage servers, the ciphertext file will be deleted.
103
104 If a client disconnects while the ciphertext is being fetched, the partial
105 ciphertext will remain in CHK_incoming/ until they reconnect and finish
106 sending it. If a client disconnects while the ciphertext is being encoded,
107 the data will remain in CHK_encoding/ until they reconnect and encoding is
108 finished. For long-running and busy helpers, it may be a good idea to delete
109 files in these directories that have not been modified for a week or two.
110 Future versions of tahoe will try to self-manage these files a bit better.
111
112 Using a Helper
113 ==============
114
115 Who should consider using a Helper?
116
117 * clients with limited upstream bandwidth, such as a consumer ADSL line
118 * clients who believe that the helper will give them faster uploads than
119   they could achieve with a direct upload
120 * clients who experience problems with TCP connection fairness: if other
121   programs or machines in the same home are getting less than their fair
122   share of upload bandwidth. If the connection is being shared fairly, then
123   a Tahoe upload that is happening at the same time as a single FTP upload
124   should get half the bandwidth.
125 * clients who have been given the helper.furl by someone who is running a
126   Helper and is willing to let them use it
127
128 To take advantage of somebody else's Helper, take the helper.furl file that
129 they give you, and copy it into your node's base directory, then restart the
130 node:
131
132 ::
133
134   cat email >$BASEDIR/helper.furl
135   tahoe restart $BASEDIR
136
137 This will signal the client to try and connect to the helper. Subsequent
138 uploads will use the helper rather than using direct connections to the
139 storage server.
140
141 If the node has been configured to use a helper, that node's HTTP welcome
142 page (http://localhost:3456/) will say "Helper: $HELPERFURL" instead of
143 "Helper: None". If the helper is actually running and reachable, the next
144 line will say "Connected to helper?: yes" instead of "no".
145
146 The helper is optional. If a helper is connected when an upload begins, the
147 upload will use the helper. If there is no helper connection present when an
148 upload begins, that upload will connect directly to the storage servers. The
149 client will automatically attempt to reconnect to the helper if the
150 connection is lost, using the same exponential-backoff algorithm as all other
151 tahoe/foolscap connections.
152
153 The upload/download status page (http://localhost:3456/status) will announce
154 the using-helper-or-not state of each upload, in the "Helper?" column.
155
156 Other Helper Modes
157 ==================
158
159 The Tahoe Helper only currently helps with one kind of operation: uploading
160 immutable files. There are three other things it might be able to help with
161 in the future:
162
163 * downloading immutable files
164 * uploading mutable files (such as directories)
165 * downloading mutable files (like directories)
166
167 Since mutable files are currently limited in size, the ADSL upstream penalty
168 is not so severe for them. There is no ADSL penalty to downloads, but there
169 may still be benefit to extending the helper interface to assist with them:
170 fewer connections to the storage servers, and better TCP fairness.
171
172 A future version of the Tahoe helper might provide assistance with these
173 other modes. If it were to help with all four modes, then the clients would
174 not need direct connections to the storage servers at all: clients would
175 connect to helpers, and helpers would connect to servers. For a large grid
176 with tens of thousands of clients, this might make the grid more scalable.