MEDIUM: tasks: implement 3 different tasklet classes with their own queues
authorWilly Tarreau <w@1wt.eu>
Thu, 30 Jan 2020 17:37:28 +0000 (18:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 30 Jan 2020 17:59:33 +0000 (18:59 +0100)
commita62917b8908f41c4733f5c61412ec7619144cc94
treed15fd850cefa66b5c0f71a8ac29baa37249a37bf
parent4ffa0b526a52a026fbabfa72f1b393ece1889dc2
MEDIUM: tasks: implement 3 different tasklet classes with their own queues

We used to mix high latency tasks and low latency tasklets in the same
list, and to even refill bulk tasklets there, causing some unfairness
in certain situations (e.g. poll-less transfers between many connections
saturating the machine with similarly-sized in and out network interfaces).

This patch changes the mechanism to split the load into 3 lists depending
on the task/tasklet's desired classes :
  - URGENT: this is mainly for tasklets used as deferred callbacks
  - NORMAL: this is for regular tasks
  - BULK: this is for bulk tasks/tasklets

Arbitrary ratios of max_processed are picked from each of these lists in
turn, with the ability to complete in one list from what was not picked
in the previous one. After some quick tests, the following setup gave
apparently good results both for raw TCP with splicing and for H2-to-H1
request rate:

  - 0 to 75% for urgent
  - 12 to 50% for normal
  - 12 to what remains for bulk

Bulk is not used yet.
include/proto/task.h
include/types/task.h
src/debug.c
src/task.c