comparison options.h @ 448:9c61e7af0156

Rearrange the channel buffer sizes into three neat use-editable values in options.h. Increasing RECV_MAX_WINDOW gives big network performance increases - even with the present buffers (which haven't changed) it performs a lot better. Next step is to make the window size a cmdline option.
author Matt Johnston <matt@ucc.asn.au>
date Tue, 24 Jul 2007 15:40:23 +0000
parents 2cd2edfa11ee
children 3e6c536bc023
comparison
equal deleted inserted replaced
447:278805938dcf 448:9c61e7af0156
214 /* Whether to log commands executed by a client. This only logs the 214 /* Whether to log commands executed by a client. This only logs the
215 * (single) command sent to the server, not what a user did in a 215 * (single) command sent to the server, not what a user did in a
216 * shell/sftp session etc. */ 216 * shell/sftp session etc. */
217 /* #define LOG_COMMANDS */ 217 /* #define LOG_COMMANDS */
218 218
219 /* Window size limits. These tend to be a trade-off between memory
220 usage and network performance: */
221 /* Size of the network receive window. This amount of memory is allocated
222 as a per-channel receive buffer. Increasing this value can make a
223 significant difference to network performance. */
224 #define RECV_MAX_WINDOW 8192
225 /* Maximum size of a received SSH data packet - this _MUST_ be >= 32768
226 in order to interoperate with other implementations */
227 #define RECV_MAX_PAYLOAD_LEN 32768
228 /* Maximum size of a transmitted data packet - this can be any value,
229 though increasing it may not make a significant difference. */
230 #define TRANS_MAX_PAYLOAD_LEN 16384
231
232
219 /******************************************************************* 233 /*******************************************************************
220 * You shouldn't edit below here unless you know you need to. 234 * You shouldn't edit below here unless you know you need to.
221 *******************************************************************/ 235 *******************************************************************/
222 236
223 #ifndef DROPBEAR_VERSION 237 #ifndef DROPBEAR_VERSION
315 for algos) but seems valid */ 329 for algos) but seems valid */
316 330
317 #define MAX_PROPOSED_ALGO 20 331 #define MAX_PROPOSED_ALGO 20
318 332
319 /* size/count limits */ 333 /* size/count limits */
320
321 #define MAX_PACKET_LEN 35000
322 #define MIN_PACKET_LEN 16 334 #define MIN_PACKET_LEN 16
323 #define MAX_PAYLOAD_LEN 32768 335
324 336 #define RECV_MAX_PACKET_LEN (MAX(35000, ((RECV_MAX_PAYLOAD_LEN)+100)))
325 #define MAX_TRANS_PAYLOAD_LEN 32768 337
326 #define MAX_TRANS_PACKET_LEN (MAX_TRANS_PAYLOAD_LEN+50) 338 /* for channel code */
327 339 #define TRANS_MAX_WINDOW 500000000 /* 500MB is sufficient, stopping overflow */
328 #define MAX_TRANS_WINDOW 500000000 /* 500MB is sufficient, stopping overflow */ 340 #define TRANS_MAX_WIN_INCR 500000000 /* overflow prevention */
329 #define MAX_TRANS_WIN_INCR 500000000 /* overflow prevention */ 341
342 #define RECV_WINDOWEXTEND (RECV_MAX_WINDOW / 3) /* We send a "window extend" every
343 RECV_WINDOWEXTEND bytes */
344
345 #define MAX_CHANNELS 100 /* simple mem restriction, includes each tcp/x11
346 connection, so can't be _too_ small */
330 347
331 #define MAX_STRING_LEN 1400 /* ~= MAX_PROPOSED_ALGO * MAX_NAME_LEN, also 348 #define MAX_STRING_LEN 1400 /* ~= MAX_PROPOSED_ALGO * MAX_NAME_LEN, also
332 is the max length for a password etc */ 349 is the max length for a password etc */
333 350
334 /* For a 4096 bit DSS key, empirically determined */ 351 /* For a 4096 bit DSS key, empirically determined */