This will be needed to use linux's splice() syscall.
int gid;
int nbproc;
int maxconn;
+ int maxpipes; /* max # of pipes */
int maxsock; /* max # of sockets */
int rlimit_nofile; /* default ulimit-n value : 0=unset */
int rlimit_memmax; /* default ulimit-d in megs value : 0=unset */
extern int pid; /* current process id */
extern int relative_pid; /* process id starting at 1 */
extern int actconn; /* # of active sessions */
+extern int usedpipes; /* # of used pipes */
extern int listeners;
extern char trash[BUFSIZE];
extern const int zero;
}
#endif /* SYSTEM_MAXCONN */
}
+ else if (!strcmp(args[0], "maxpipes")) {
+ if (global.maxpipes != 0) {
+ Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]);
+ return 0;
+ }
+ if (*(args[1]) == 0) {
+ Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]);
+ return -1;
+ }
+ global.maxpipes = atol(args[1]);
+ }
else if (!strcmp(args[0], "ulimit-n")) {
if (global.rlimit_nofile != 0) {
Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]);
int maxfd; /* # of the highest fd + 1 */
int totalconn; /* total # of terminated sessions */
int actconn; /* # of active sessions */
+int usedpipes; /* # of pipes in use (2 fds each) */
int cfg_polling_mechanism = 0; /* POLL_USE_{SELECT|POLL|EPOLL} */
* Initialize the previously static variables.
*/
- totalconn = actconn = maxfd = listeners = stopping = 0;
+ usedpipes = totalconn = actconn = maxfd = listeners = stopping = 0;
#ifdef HAPROXY_MEMMAX
global.maxconn = DEFAULT_MAXCONN;
global.maxsock += global.maxconn * 2; /* each connection needs two sockets */
+ global.maxsock += global.maxpipes * 2; /* each pipe needs two FDs */
if (global.tune.maxpollevents <= 0)
global.tune.maxpollevents = MAX_POLL_EVENTS;