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
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