summaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-06-16 09:55:44 -0400
committerNick Mathewson <nickm@torproject.org>2013-06-18 10:15:16 -0400
commit2e1fe1fcf93c2a77805048bea5c535ca4456d583 (patch)
tree6a396bc09f558b9611282de2d54a7f7824696095 /src/or/config.c
parent2a95f3171681ee53c97ccba9d80f4454b462aaa7 (diff)
downloadtor-2e1fe1fcf93c2a77805048bea5c535ca4456d583.tar.gz
tor-2e1fe1fcf93c2a77805048bea5c535ca4456d583.zip
Implement a real OOM-killer for too-long circuit queues.
This implements "algorithm 1" from my discussion of bug #9072: on OOM, find the circuits with the longest queues, and kill them. It's also a fix for #9063 -- without the side-effects of bug #9072. The memory bounds aren't perfect here, and you need to be sure to allow some slack for the rest of Tor's usage. This isn't a perfect fix; the rest of the solutions I describe on codeable.
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 90a5dfbda1..d5c5689474 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -343,6 +343,7 @@ static config_var_t _option_vars[] = {
V(MaxAdvertisedBandwidth, MEMUNIT, "1 GB"),
V(MaxCircuitDirtiness, INTERVAL, "10 minutes"),
V(MaxClientCircuitsPending, UINT, "32"),
+ V(MaxMemInCellQueues, MEMUNIT, "8 GB"),
V(MaxOnionsPending, UINT, "100"),
OBSOLETE("MonthlyAccountingStart"),
V(MyFamily, STRING, NULL),
@@ -3668,6 +3669,12 @@ options_validate(or_options_t *old_options, or_options_t *options,
log_warn(LD_CONFIG, "EntryNodes is set, but UseEntryGuards is disabled. "
"EntryNodes will be ignored.");
+ if (options->MaxMemInCellQueues < (500 << 20)) {
+ log_warn(LD_CONFIG, "MaxMemInCellQueues must be at least 500 MB for now. "
+ "Ideally, have it as large as you can afford.");
+ options->MaxMemInCellQueues = (500 << 20);
+ }
+
options->_AllowInvalid = 0;
if (options->AllowInvalidNodes) {
SMARTLIST_FOREACH_BEGIN(options->AllowInvalidNodes, const char *, cp) {