diff options
| author | eunhhu <[email protected]> | 2026-10-01 04:16:49 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-10-01 04:16:49 +0100 |
| commit | d24881de03433c30ee619ee1eec3ae962ae3db19 (patch) | |
| tree | 8d51d332c8ea13d1e981797d77993c6e9ad4efad /core/test-module.c | |
| parent | a0840d6ebfcc6d992d60d119fb596cf76d54c7cc (diff) | |
| download | pure-d24881de03433c30ee619ee1eec3ae962ae3db19.tar.gz pure-d24881de03433c30ee619ee1eec3ae962ae3db19.zip | |
Move a connection to its app's home thread at its first request (017)
With several connection threads, a host of apps had each app's
connections spread over all of them: every thread's round handed each
owner a share, and every turn handed answers back to every thread. The
apps took a third more CPU a request than as processes, with five times
the voluntary switches, and when two apps were busy each waited a
kernel tick at its 99th percentile (4.1 ms, against 1.5 ms as two
processes).
Each app now has a home thread (its place in --apps, modulo the
threads). A connection whose first request names an app at home
elsewhere moves there once, its head read and no ticket taken yet: the
home thread adopts its descriptor and the bytes read, and reads the
request again. Each app's requests then meet its owner from one
thread, as from a process of its own. Two busy apps: 99th percentile
1.4 ms, the same 145k writes a second.
server_apps restarts its apps on three connection threads, asks each
app from fresh connections, and checks that some moved and all were
answered right.
Diffstat (limited to 'core/test-module.c')
0 files changed, 0 insertions, 0 deletions
