From 83e8da1827f5b9bf35ec15834f7ece78eb7151a8 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 30 Sep 2012 23:51:14 -0400 Subject: [PATCH] A resource constraint changes if we have green threads. Adapt. --- irkerd | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/irkerd b/irkerd index 4e2f9ba..2e37bd1 100755 --- a/irkerd +++ b/irkerd @@ -35,7 +35,6 @@ UNSEEN_TTL = 60 # Time to live, seconds since first request CHANNEL_MAX = 18 # Max channels open per socket (default) ANTI_FLOOD_DELAY = 0.125 # Anti-flood delay after transmissions, seconds ANTI_BUZZ_DELAY = 0.09 # Anti-buzz delay after queue-empty check -CONNECTION_MAX = 200 # Avoid pushing per-process thread or fd limits # No user-serviceable parts below this line @@ -46,7 +45,16 @@ CONNECTION_MAX = 200 # Avoid pushing per-process thread or fd limits try: import eventlet; eventlet.monkey_patch() green_threads = True + # With greenlets we don't worry about thread exhaustion, only the + # file descriptor limit (typically 1024 on modern Unixes). Thus we + # can handle a lot more concurrent sessions and generare less + # join/leave spam under heavy load. + CONNECTION_MAX = 1000 except ImportError: + # Threads are more expensive if we have to use OS-level ones + # rather than greenlets. We need to avoid pushing thread limits + # as well as fd limits. See security.txt for discussion. + CONNECTION_MAX = 200 green_threads = False import sys, json, getopt, urlparse, time, random -- 2.26.2