Permalink
Browse files

Added support for --backlog and --minThreads

  • Loading branch information...
1 parent 1f61e26 commit ba3558fc9fcb6d0b30fa5ffcc21e3ad5d84848d8 @bassamtabbara bassamtabbara committed Aug 23, 2011
Showing with 32 additions and 0 deletions.
  1. +9 −0 man/mod_mono.8.in
  2. +23 −0 src/mod_mono.c
View
9 man/mod_mono.8.in
@@ -45,6 +45,15 @@ exclusive with MonoUnixSocket. When this options is specified,
mod-mono-server and mod_mono will use a TCP socket for communication.
Default value: none
.TP
+.I "MonoListenBacklog" N
+The backlog of connections to set on the listener socket in mod-mono-server.
+By default the value is set to 500.
+.TP
+.I "MonoMinThreads" N
+The minimum number of threads the threadpool allocates in mod-mono-server.
+Increase this value to better handle the sudden arrival of connections.
+The default value is determined by the mono runtime.
+.TP
.I "MonoListenAddress"
IP address where mod-mono-server should listen/is listening on. Can only be
used when MonoListenPort is specified.
View
23 src/mod_mono.c
@@ -121,6 +121,8 @@ typedef struct xsp_data {
char *appconfig_dir;
char *listen_port;
char *listen_address;
+ char *listen_backlog;
+ char *minthreads;
char *max_cpu_time;
char *max_memory;
char *debug;
@@ -600,6 +602,8 @@ add_xsp_server (apr_pool_t *pool, const char *alias, module_cfg *config, int is_
server->listen_port = NULL;
server->listen_address = NULL;
+ server->listen_backlog = NULL;
+ server->minthreads = NULL;
server->max_cpu_time = NULL;
server->max_memory = NULL;
server->debug = NULL;
@@ -1565,6 +1569,7 @@ fork_mod_mono_server (apr_pool_t *pool, xsp_data *config)
return;
}
+
if (config->max_memory != NULL)
max_memory = (int)string_to_long (config->max_memory, "MonoMaxMemory", -1);
@@ -1715,6 +1720,16 @@ fork_mod_mono_server (apr_pool_t *pool, xsp_data *config)
argv [argi++] = fn;
}
+ if (config->listen_backlog != NULL) {
+ argv [argi++] = "--backlog";
+ argv [argi++] = config->listen_backlog;
+ }
+
+ if (config->minthreads != NULL) {
+ argv [argi++] = "--minThreads";
+ argv [argi++] = config->minthreads;
+ }
+
if (config->applications != NULL) {
argv [argi++] = "--applications";
argv [argi++] = config->applications;
@@ -2929,6 +2944,14 @@ static const command_rec mono_cmds [] = {
"only be used when MonoListenPort is specified."
"Default: \"127.0.0.1\""
),
+ MAKE_CMD12 (MonoListenBacklog, listen_backlog,
+ "The socket listen backlog to set on mod-mono-server."
+ "Default: 500"
+ ),
+ MAKE_CMD12 (MonoMinThreads, minthreads,
+ "The minimum number of threads the thread pool allocates in mod-mono-server."
+ "Default: (mono runtime default)"
+ ),
MAKE_CMD12 (MonoRunXSP, run_xsp,
"It can be False or True. If it is True, asks the module to "

0 comments on commit ba3558f

Please sign in to comment.