diff --git a/src/server/server-config.c b/src/server/server-config.c index b13ffa35185b3ba87d87b7a09b159349b8c0a963..01b3c5e8f69e6ee0861c4f333c45516d2a218597 100644 --- a/src/server/server-config.c +++ b/src/server/server-config.c @@ -5,7 +5,10 @@ * to recompile the entire server. */ -static char *rcsid = "$Id: server-config.c,v 0.8 1991/08/28 02:36:37 ceder Exp $"; +#include <config.h> +#include <m-config.h> + +static char *rcsid = "$Id: server-config.c,v 0.9 1991/08/30 01:32:18 ceder Exp $"; @@ -84,17 +87,25 @@ const int CACHE_TEXT_STATS = 10; /* * MAX_NO_OF_CONNECTIONS must be small enough. Each connection takes one * file descriptor, and it is important that there are a few descriptors - * left so that it is possible to save the data base. lyskomd will crash + * left so that it is possible to save the data base. lyskomd might crash * if this number is too big and that many connectionattempts are made * simultaneously. + * + * The following descriptors are open by LysKOM: + * stdin, stdout, stderr (stdin and stdout could probably be closed. + * The log() function prints to stderr.) + * TEXTFILE_NAME (always open) + * DATAFILE_NAME (often open) + * STATISTIC_NAME (open after a SIGUSR1) + * Thus, the max number of connections is the number of available file + * descriptors minus six. This has not been fully tested for a long + * while, so we subtract eight just to be on the safe side. That still + * gives 56 simultaneous users on a sun4, and that is enough for the + * time beeing. (If you need more connections you can ran a mux. Send + * mail to kom@lysator.liu.se for more info.) */ -#ifdef __sequent__ -const int MAX_NO_OF_CONNECTIONS = 12; -#else -const int MAX_NO_OF_CONNECTIONS = 50; /* the maximum number of persons - * that can use Kom simultaneously */ -#endif +const int MAX_NO_OF_CONNECTIONS = (MAX_OPEN_FD - 8); const int MARK_AS_READ_CHUNK = 128; /* You can't mark more than this many