- tune.rcvbuf.client
- tune.rcvbuf.server
- tune.recv_enough
+ - tune.runqueue-depth
- tune.sndbuf.client
- tune.sndbuf.server
- tune.ssl.cachesize
may be changed by this setting to better deal with workloads involving lots
of short messages such as telnet or SSH sessions.
+tune.runqueue-depth <number>
+ Sets the maxinum amount of task that can be processed at once when running
+ tasks. The default value is 200. Increasing it may incur latency when
+ dealing with I/Os, making it too small can incur extra overhead.
+
tune.sndbuf.client <number>
tune.sndbuf.server <number>
Forces the kernel socket send buffer size on the client or the server side to
#define MAX_POLL_EVENTS 200
#endif
+// the max number of tasks to run at once
+#ifndef RUNQUEUE_DEPTH
+#define RUNQUEUE_DEPTH 200
+#endif
+
// cookie delimitor in "prefix" mode. This character is inserted between the
// persistence cookie and the original value. The '~' is allowed by RFC6265,
// and should not be too common in server names.
int maxpollevents; /* max number of poll events at once */
int maxaccept; /* max number of consecutive accept() */
int options; /* various tuning options */
+ int runqueue_depth;/* max number of tasks to run at once */
int recv_enough; /* how many input bytes at once are "enough" */
int bufsize; /* buffer size in bytes, defaults to BUFSIZE */
int maxrewrite; /* buffer max rewrite size in bytes, defaults to MAXREWRITE */
goto out;
global.mode |= MODE_QUIET;
}
+ else if (!strcmp(args[0], "tune.runqueue-depth")) {
+ if (alertif_too_many_args(1, file, linenum, args, &err_code))
+ goto out;
+ if (global.tune.runqueue_depth != 0) {
+ ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]);
+ err_code |= ERR_ALERT;
+ goto out;
+ }
+ if (*(args[1]) == 0) {
+ ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]);
+ err_code |= ERR_ALERT | ERR_FATAL;
+ goto out;
+ }
+ global.tune.runqueue_depth = atol(args[1]);
+
+ }
else if (!strcmp(args[0], "tune.maxpollevents")) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (global.tune.maxpollevents <= 0)
global.tune.maxpollevents = MAX_POLL_EVENTS;
+ if (global.tune.runqueue_depth <= 0)
+ global.tune.runqueue_depth = RUNQUEUE_DEPTH;
+
if (global.tune.recv_enough == 0)
global.tune.recv_enough = MIN_RECV_AT_ONCE_ENOUGH;
tasks_run_queue_cur = tasks_run_queue; /* keep a copy for reporting */
nb_tasks_cur = nb_tasks;
- max_processed = 200;
+ max_processed = global.tune.runqueue_depth;
if (likely(global.nbthread > 1)) {
HA_SPIN_LOCK(TASK_RQ_LOCK, &rq_lock);
* get too much in the task list, but put a bit more than
* the max that will be run, to give a bit more fairness
*/
- while (max_processed + 20 > task_list_size[tid]) {
+ while (max_processed + (max_processed / 10) > task_list_size[tid]) {
/* Note: this loop is one of the fastest code path in
* the whole program. It should not be re-arranged
* without a good reason.