Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
e579c90
Add Paozhu
hggq Nov 7, 2026
6dbdfc8
Add Poazhu
hggq Nov 7, 2026
15e347b
Add Paozhu http1 post chunked
hggq Nov 8, 2026
da7f6c3
Add paozhu
hggq Nov 8, 2026
e4a3cc0
Merge branch 'MDA2AV:main' into main
hggq Nov 8, 2026
5be39ce
Add Paozhu
hggq Nov 9, 2026
08b8f6f
Add Paozhu
hggq Nov 9, 2026
5cd63b2
Add paozhu
hggq Nov 9, 2026
1187d4f
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 9, 2026
a44b4ac
Merge branch 'MDA2AV:main' into main
hggq Nov 10, 2026
7053697
Edit mulit ioc
hggq Nov 10, 2026
6d4303c
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 10, 2026
efd9951
Add paozhu
hggq Nov 10, 2026
737060a
Add paozhu
hggq Nov 10, 2026
2ec885f
Add paozhu
hggq Nov 10, 2026
1e2e203
Add paozhu
hggq Nov 10, 2026
c7b539e
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 10, 2026
6602983
Add paozhu
hggq Nov 10, 2026
50f6d04
Add paozhu
hggq Nov 10, 2026
e7a8d4b
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 10, 2026
a1df593
Add paozhu
hggq Nov 11, 2026
81cefee
Add paozhu
hggq Nov 11, 2026
a4ddde4
Add paozhu
hggq Nov 11, 2026
fcb0655
Add paozhu
hggq Nov 11, 2026
fa07f5e
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 11, 2026
5075d16
Add paozhu
hggq Nov 11, 2026
61508df
Add paozhu
hggq Nov 11, 2026
1e9fb1d
Add paozhu
hggq Nov 11, 2026
1714fd6
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 11, 2026
d2357dc
Add paozhu
hggq Nov 11, 2026
287cdcc
Add paozhu
hggq Nov 11, 2026
27c58e9
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 11, 2026
9222b6c
Add paozhu
hggq Nov 11, 2026
eece81e
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 11, 2026
1821391
Add paozhu
hggq Nov 11, 2026
9a85c3a
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 11, 2026
2332d83
Fix h2 orm
hggq Nov 12, 2026
4b6ea10
Fix paozhu
hggq Nov 12, 2026
99c4b28
Fix orm init 55
hggq Nov 12, 2026
2d8b43b
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 12, 2026
70d115a
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 12, 2026
77c98ae
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 12, 2026
5dc1f75
Fix orm threads pool to 64
hggq Nov 12, 2026
3a62390
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 12, 2026
6f56f5c
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 12, 2026
3d87d9b
Add cache httppeer
hggq Nov 12, 2026
b267014
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 12, 2026
f8ab29e
Fix http2 send ring to 32 slot
hggq Nov 13, 2026
bd78573
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 13, 2026
4fe99b0
Fix minpool init
hggq Nov 13, 2026
5734d11
Fin minpool init
hggq Nov 13, 2026
bdbe109
Edit db.cpp
hggq Nov 13, 2026
68e71ac
Fix db.cpp
hggq Nov 13, 2026
4971231
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 13, 2026
81eada4
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 13, 2026
470e75a
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 13, 2026
aad6611
Add paozhu thread pool to 128
hggq Nov 14, 2026
8c0e89e
Add paozhu
hggq Nov 14, 2026
70c4ea0
Fix paozhu
hggq Nov 14, 2026
405eae5
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 14, 2026
9ed7810
Merge branch 'MDA2AV:main' into main
hggq Nov 14, 2026
22cfc37
Merge branch 'MDA2AV:main' into main
hggq Nov 14, 2026
0c734b8
Add websocket
hggq Nov 14, 2026
1e33515
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 14, 2026
d4c2742
Merge branch 'MDA2AV:main' into main
hggq Nov 15, 2026
81fe8fb
Fix br level
hggq Nov 15, 2026
2cca5ed
Fix orm conn
hggq Nov 15, 2026
91a71be
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 15, 2026
e3bd1e0
Merge branch 'MDA2AV:main' into main
hggq Nov 15, 2026
f39b2cc
Add 8gbit, static to cache
hggq Nov 15, 2026
4bf90af
Merge branch 'main' into main
hggq Nov 15, 2026
2345926
Merge branch 'MDA2AV:main' into main
hggq Nov 15, 2026
ce41ce5
Add sleep 3s
hggq Nov 15, 2026
ce87853
Add sleep 3s
hggq Nov 15, 2026
4a1bd27
Merge branch 'MDA2AV:main' into main
hggq Nov 15, 2026
98b3e06
Fix curl
hggq Nov 15, 2026
a73b1a0
Add static tls
hggq Nov 15, 2026
dd6f27f
Merge branch 'MDA2AV:main' into main
hggq Nov 16, 2026
a135781
Reset /static/:filename
hggq Nov 16, 2026
250fa32
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 16, 2026
4331a97
Fix compress
hggq Nov 16, 2026
890da32
Merge branch 'MDA2AV:main' into main
hggq Nov 16, 2026
f22b7e8
Merge branch 'MDA2AV:main' into main
hggq Nov 16, 2026
1a489d6
Merge branch 'main' into main
hggq Nov 16, 2026
e13a89f
Fix static file to dynamic
hggq Nov 16, 2026
8179862
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 16, 2026
d1cf7ec
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 16, 2026
9ef28cd
Merge branch 'MDA2AV:main' into main
hggq Nov 17, 2026
2cfa5a8
Fix latency-500k-8cpu
hggq Nov 17, 2026
fa2c6ad
Fix sqlite
hggq Nov 17, 2026
b833fa2
Fix sql
hggq Nov 17, 2026
49fe4f9
Use framework fun
hggq Nov 17, 2026
94664e5
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 17, 2026
44da3a0
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 17, 2026
3a42739
Fix threads
hggq Nov 17, 2026
c0362e6
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 17, 2026
3940d00
Fix orm pool get back
hggq Nov 17, 2026
d509c0c
Fix head body to asio::const_buffer
hggq Nov 17, 2026
b146c12
Fix ORM cache to 8k
hggq Nov 17, 2026
ea4eaae
Fix ORM cache_data to 8k
hggq Nov 17, 2026
3f5ce80
Fix msvc ci
hggq Nov 17, 2026
603f0de
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 17, 2026
5a0667b
Fix on stat to cache static files
hggq Nov 18, 2026
ac141bc
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 18, 2026
76a8878
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 18, 2026
6a55605
Fix static static-h2 64X4 threads
hggq Nov 18, 2026
2a59c20
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 18, 2026
673dfda
Fix threads
hggq Nov 18, 2026
15f1381
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 18, 2026
e626f68
Fix ring send
hggq Nov 18, 2026
6add11b
Benchmark results: paozhu [skip ci]
github-actions[bot] Nov 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frameworks/paozhu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \

# Pinned so mini_project.sh, the controller generator and the CMake entry point
# stay in sync with the scaffold this entry was written against.
ARG PAOZHU_REF=6b0945334a9b5c34f3cf1f9718c6797c07564380
ARG PAOZHU_REF=8cba6912bb1864c68489d5be94938c2d52e88c5d
WORKDIR /paozhu
# Prefer a source archive shipped in the build context (offline / slow-GitHub
# environments); otherwise fetch the pinned revision from codeload. The direct
Expand Down
2 changes: 1 addition & 1 deletion frameworks/paozhu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Registered through paozhu annotations; path parameters must be the final segment
- `usehtmlcache` is intentionally absent from both conf files; a present key enables the disk pre-check for dotted URLs. Because the key is absent the pre-check never runs, so it never competes with `/static/:filename` either way, and `BENCHMARK` compiling that pre-check out is a no-op for this entry.
- Static compression is served by `arena_static` itself, not the framework: it honours `Accept-Encoding` (`peer->state.br` / `state.gzip`, q=0 rejected upstream), prefers brotli then gzip, and reads the matching `.br` / `.gz` twin from `/data/static` per request — no resident body cache, so the validation suite's mid-run file replacement stays visible. The precompressed body is sent with `peer->compress = 2` (br) / `1` (gzip), which tells the send layer to skip auto compression and only emit `Content-Encoding` + `Vary`; without an accepted coding or a twin it serves the identity file (`compress = 0`). Binary assets (woff2/webp) ship no twin and stay identity. The framework's own static compress cache is therefore unused: `static_file_compress_cache = 0` in both conf files, and the entrypoint no longer pre-warms it.
- The two processes use separate `temppath` / `logpath` directories so they never race on scratch files.
- `cothreadnum` in both conf files is a floor, not the worker count: upstream computes `max(cothreadnum, hardware_concurrency() + 4)`. Under the profile cpuset (`0-31,64-95`, 64 CPUs) each process runs about 68 io threads, not 8, and the second process contributes a second set that stays idle while the other port is being profiled.
- `cothreadnum` is an optional CAP on the io-thread count, not a floor: upstream sets `total_count = std::thread::hardware_concurrency()` and lowers it to `cothreadnum` only when that is smaller (floor 4), then runs one `io_context` per count with `per_ioc_thread_num` run threads each. `hardware_concurrency()` reports the host's online CPUs and ignores the container cpuset, so the shipped `cothreadnum = 128` would leave ~host-core-count io threads per instance — on `latency-500k-8cpu` (cpuset `0-3,64-67`, 8 logical CPUs) that oversubscription cost both throughput and tail latency. `entrypoint.sh` therefore renders `cothreadnum = $(nproc)` into both confs before startup (`nproc` counts via `sched_getaffinity`, i.e. the cpuset: 8 on that profile, 32 on the big ones). The second instance gets the same count and stays mostly idle while the other port is being profiled.
- `PAOZHU_REF` selects the upstream revision. The Dockerfile uses a direct `codeload.github.com` tarball URL: `github.com/.../archive/...` 302-redirects to codeload and that hop is blocked on some networks.
- On slow or offline networks, ship a source archive in the build context instead of downloading it: `git -C /Users/hzq/paozhu archive --format=tar.gz --prefix=paozhu-<sha>/ -o frameworks/paozhu/vendor/paozhu-src.tar.gz HEAD`. The Dockerfile prefers `vendor/paozhu-src.tar.gz` when present. The archive is ~36 MB and is deliberately not checked in.
- `APT_MIRROR` is an optional build arg for networks where `deb.debian.org` is slow, e.g. `--build-arg APT_MIRROR=mirrors.aliyun.com`; empty keeps the distro default.
Expand Down
122 changes: 76 additions & 46 deletions frameworks/paozhu/cost_define.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,30 @@
// header_table_size bounds its decoder, not ours.
#define CONST_HTTP2_DYNAMIC_TABLE_MAX_SIZE 4096

// 编码器动态表的本地上限(响应头方向)。对端 SETTINGS_HEADER_TABLE_SIZE 可以广告到
// 2^32-1,RFC 7541 §4.2 允许编码器选用不超过该值的任意上限——本端取 min(对端值, 此 cap),
// 防止对端用一个巨型广告值把每连接的编码表撑成无界内存。与上面的解码侧上限是两套账。
// Local ceiling of the HPACK encoder table. RFC 7541 §4.2 lets the encoder pick any size up
// to the peer-advertised value; we clamp to this cap so a huge SETTINGS advertisement cannot
// grow per-connection encoder memory without bound. Separate from the decoder ceiling above.
#define CONST_HTTP2_ENCODER_TABLE_CAP 4096

// HPACK encoder dynamic table switch for response headers. Define to enable Indexed representation;
// comment out to fall back to Literal without Indexing (0000xxxx).
#define PAOZHU_HPACK_ENCODER_DYNAMIC_TABLE 1

// Connection-level error COMPRESSION_ERROR (RFC 9113 §7 / RFC 7541). GOAWAY with this code
// on unrecoverable HEADERS write failure — the connection state cannot be trusted.
// 连接级错误码 COMPRESSION_ERROR(RFC 9113 §7 / RFC 7541):HEADERS 写失败后 GOAWAY 带此码断连。
#define CONST_HTTP2_ERROR_COMPRESSION 0x09

// 连接级错误码 INTERNAL_ERROR(RFC 9113 §7):handler 抛出未预期异常时的兜底 GOAWAY。
// 异常点不确定(可能在头编码前/后),不能断言是压缩失步,用 INTERNAL_ERROR 而非 0x09;
// 也不用 NO_ERROR(0)——那会让客户端把一次服务端故障当成正常收尾。
// Connection-level INTERNAL_ERROR (RFC 9113 §7): fallback GOAWAY for unexpected handler
// exceptions. The throw site is unknown, so neither NO_ERROR nor COMPRESSION_ERROR is honest.
#define CONST_HTTP2_ERROR_INTERNAL 0x02

// HTTP/2 协议允许的最大窗口值(2^31-1)。SETTINGS_INITIAL_WINDOW_SIZE 与
// WINDOW_UPDATE 累加超过该值必须按 RFC 9113 §6.9.1 报 FLOW_CONTROL_ERROR。
// HTTP/2 protocol maximum window value (2^31-1). Accumulated SETTINGS_INITIAL_WINDOW_SIZE + WINDOW_UPDATE over this ⇒ FLOW_CONTROL_ERROR per RFC 9113 §6.9.1.
Expand Down Expand Up @@ -263,11 +287,54 @@ constexpr bool http2_wu_stream_id_ok(unsigned long long sid, unsigned long long

#define CONST_HTTP2_SEND_FRAME_BUF 15360

// 一条流连续多久没有任何字节真正推进,就放弃它(RST_STREAM,不断连接)。
// 量的是「多久没推进」而不是「等了多久」:慢客户端只要一直在收,
// 等得再久也不该撤流;只有彻底没进展才该撤。
// Stream abandoned (RST_STREAM, no GOAWAY) when no bytes actually advance for N seconds. Measures "time without progress", not "time waited" — slow clients that keep receiving are fine.
#define CONST_HTTP2_SEND_NO_PROGRESS_TIMEOUT 120
// 内联/文件发送每轮入内容环的 DATA 帧数上限:一次窗口预留按字节记账,切成至多这么多帧
// 逐帧入环(仍按对端 MAX_FRAME_SIZE 切帧)。与下面的补喂闸配套:闸 24 + 批 6 = 30 ≤ 31
// 可用槽,一批开始喂入后不会因本批而卡满。
#define CONST_HTTP2_SEND_BATCH_FRAMES 6

// 内容环补喂闸:积压槽数达到本值就就地等(20ms 一拍自醒),给在途批次与控制帧留槽。
#define CONST_HTTP2_CONTENT_RING_FEED_GATE 24

// 环满等待:基础拍长(微秒)+ 自适应边界。
// 起始从 BASE 起步,剩余槽 < FAST_SLOTS 持续减半加速(消费还在忙,快点查空槽);
// 剩余槽 > SLOW_SLOTS 持续翻倍减速(消费刚排空,慢点查省 CPU)。
// 持续朝同一方向推就持续指数退避,直到 MIN / MAX 封顶。
// Base ring-full wait (μs) + adaptive bounds. Start from BASE; keep halving when remaining <
// FAST_SLOTS (consumer still busy, poll sooner); keep doubling when remaining > SLOW_SLOTS
// (consumer just drained, poll slower to save CPU).
#define CONST_HTTP2_RING_FULL_WAIT_BASE 1000
#define CONST_HTTP2_RING_FULL_WAIT_MIN 100 // 100μs
#define CONST_HTTP2_RING_FULL_WAIT_MAX 200000 // 200ms
#define CONST_HTTP2_RING_FULL_WAIT_FAST 3 // remaining < 3 → 加速
#define CONST_HTTP2_RING_FULL_WAIT_SLOW 18 // remaining > 18 → 减速

// 根据当前间隔 + 剩余槽数,算出下一次等待间隔(微秒)。
// Compute next wait interval (μs) from current value + remaining ring slots.
constexpr unsigned int http2_ring_wait_adjust_us(unsigned int current_us, unsigned char remaining_slots)
{
if (remaining_slots < CONST_HTTP2_RING_FULL_WAIT_FAST)
{
if (current_us > CONST_HTTP2_RING_FULL_WAIT_MIN)
current_us /= 2;
if (current_us < CONST_HTTP2_RING_FULL_WAIT_MIN)
current_us = CONST_HTTP2_RING_FULL_WAIT_MIN;
}
else if (remaining_slots > CONST_HTTP2_RING_FULL_WAIT_SLOW)
{
if (current_us < CONST_HTTP2_RING_FULL_WAIT_MAX)
current_us *= 2;
if (current_us > CONST_HTTP2_RING_FULL_WAIT_MAX)
current_us = CONST_HTTP2_RING_FULL_WAIT_MAX;
}
return current_us;
}

// h1 文件直发单块尺寸(fread + 一次写)。原 4096 让 100KB 文件付 26 次写 syscall;
// 64KB 块降到 2~3 次。心跳必须每块刷:64KB 在 6.2KB/s 慢客户端下约 10s 一块,
// 对 httpwatch 的 now-60s idle 阈值留足余量(旧 %16 拍在 64KB 块下会变成 1MB 一刷)。
// 池化 content 缓冲常驻容量随之涨到 64KB/对象,回池 clear() 不释放,属有意保留的热容量。
#define CONST_HTTP1_FILE_CHUNK_BYTES 65536

// 每连接 HTTP/2 发送环的槽数。三条硬约束:
// 1. 必须是 2 的幂 —— 下标推进用 & (capacity_ - 1),非 2 的幂会算出错误的下一格;
// 2. 不能超过 255 —— head_/tail_ 是 unsigned char;
Expand All @@ -277,47 +344,10 @@ constexpr bool http2_wu_stream_id_ok(unsigned long long sid, unsigned long long
// MUST fit unsigned char (head_/tail_), and one slot stays empty for the full/empty test,
// so capacity-1 frames are queueable.
#define CONST_HTTP2_RING_QUEUE_CAPACITY 32
// 发送环积压到几个槽就让路。32 槽环有 31 个可排槽,目标是正好留 6 个给
// HEADERS/SETTINGS/RST/GOAWAY/WINDOW_UPDATE 这类控制帧收尾,所以阈值取 24:
// 判据是严格大于(has_size() > 24),积压 24 时仍放行一帧到 25,看到 25 就挂起,
// 稳态最大积压 25,31 − 25 = 6。取 25 会变成最大积压 26、只剩 5 格,反而不达标。
// 8 发送线程下的已知代价:闸门是"先读 has_size() 再 push",读和 push 之间有窗口,
// 8 个推者可能同时通过同一个 24 的检查;6 格空位对 8 个推者不够,最坏一轮会有
// 2 次 push 失败(计入 http2_ring_overflow_count,帧留在对象上由 standby_next
// 下一轮重投,不丢数据)。2 线程时 6 格足够(并发推者数 2 < 6)。
// 发送侧的挂起条件和回灌条件必须用同一个数,否则会出现「挂起来、回灌去」的空转循环。
// Send-ring backpressure slot threshold. 31 usable slots, exactly 6 reserved for control-frame
// tails, hence 24: the test is strictly greater, so a backlog of 24 still admits one more frame
// (to 25) and parking starts at 25; steady-state max is 25 and 31 - 25 = 6. Using 25 would make
// the max 26 and leave only 5. Known cost with 8 send threads: the gate reads has_size() before
// pushing, so up to 8 pushers may pass the same check; 6 free slots cannot absorb 8, so worst case
// 2 pushes fail per round (counted in http2_ring_overflow_count, retried via standby_next — no data
// loss). 2 threads: 6 slots are enough.
// Suspend and refill conditions MUST use the same value to avoid "hang → refill → hang" thrashing.
#define CONST_HTTP2_RING_BACKPRESSURE_SLOTS 24
// 一条流一轮之内除了首帧还能补喂几帧:每轮最多推 SEND_FEED_MAX + 1 = 6 帧(首帧 + 5 次补喂)。
// 首帧由闸门放行,每次补喂之前重取发送环积压,达到 CONST_HTTP2_RING_FEED_SLOTS 或
// 额度用完就停 —— 这个上限是「一条流不许在本轮独占发送线程」的界,不是吞吐旋钮:
// 环空着的时候多喂的帧,最终仍受窗口与传输约束。
// 要让本值真正生效,CONST_HTTP2_RING_FEED_SLOTS 必须 >= 本值 + 1,否则水位先到、一轮凑不满。
// Max extra frames per stream per round: SEND_FEED_MAX + 1 = 6 frames per round (first + 5 extras).
// For this cap to bind, CONST_HTTP2_RING_FEED_SLOTS must be >= SEND_FEED_MAX + 1, else the
// feed-watermark cuts the round short.
#define CONST_HTTP2_SEND_FEED_MAX 5
// 补喂允许的发送环积压水位:环里已排队帧数低于它才继续喂同一条流。取成与让路阈值同一个数
// (24),单条流可以一路喂到积压 24 才停;31 个可排槽里剩下的 7 个留给控制帧收尾。
// 必须 >= SEND_FEED_MAX + 1(6),否则水位先拦、一轮凑不满 6 帧。
// Feed-watermark: keep feeding the same stream while ring queued < this. Set equal to the
// backpressure threshold (24) so one stream may fill up to 24; the remaining 7 usable slots keep
// headroom for control-frame tails. Must be >= SEND_FEED_MAX + 1 (6), else rounds get cut short.
#define CONST_HTTP2_RING_FEED_SLOTS 24
// 发送线程最长能睡多久:等待新发送对象的条件变量带这个期限,醒来跑一次挂起表兜底扫描。
// 取 6 而不是 5,是为了与 httpwatch 主循环那根 5 秒错开 —— 两条周期任务若同刻醒来会
// 去抢同一批锁(idle 清理要持 socket_session_lists_mutex,兜底要持 send_data_mutex)。
// 没有这个期限,「所有发送对象都挂在表上」这个状态本身就让发送线程睡在无超时的 wait 上,
// 而挂在表上的对象恰恰只有这一趟扫描会去续期与撤流。
// Max send-thread sleep (seconds) — wake at least this often to run the parked-belt sweep (renews time_limit + issues RST for stuck streams). Chosen 6 (not 5) to de-phase from httpwatch's 5s cycle (avoids simultaneous lock contention). Without deadline: all sends parked ⇒ thread sleeps forever; belt never runs.
#define CONST_HTTP2_BELT_SWEEP_SECONDS 6

// 一次窗口停等的总预算:到期 RST(CANCEL) 撤流,连接保留。按次重算,不是整条响应的
// 预算;被 WU 叫醒后用剩余量重挂,小增量不续命。
#define CONST_HTTP2_WINDOW_STALL_TIMEOUT 10

// RST_STREAM 流错误码(RFC 9113 §7)。CANCEL 表示「流被撤销」,不表示对端违反协议;
// 本地背压/过载放弃发送时应使用它,而不是 PROTOCOL_ERROR(0x01)。
Expand Down
4 changes: 2 additions & 2 deletions frameworks/paozhu/src/conf/server-h1.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
[default]
threadmax = 1024
threadmin = 5
cothreadnum = 128 ; Use this value < number of CPU cores
cothreadnum = 0 ; 0 = auto (host cores)
per_ioc_thread_num = 1 ;
orm_ioc_num = 4 ;ORM io_context num;
orm_thread_pool_num = 128 ;0 use hardware_concurrency()
orm_thread_pool_num = 0 ;0 use hardware_concurrency()
http2_send_loop_num = 8 ;

httpport = 8082
Expand Down
4 changes: 2 additions & 2 deletions frameworks/paozhu/src/conf/server.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
[default]
threadmax = 1024
threadmin = 5
cothreadnum = 128 ; Use this value < number of CPU cores
cothreadnum = 0 ; 0 = auto (host cores)
per_ioc_thread_num = 1 ;
orm_ioc_num = 4 ;ORM io_context num;
orm_thread_pool_num = 128 ;0 use hardware_concurrency()
orm_thread_pool_num = 0 ;0 use hardware_concurrency()
http2_send_loop_num = 8 ;

httpport = 8080
Expand Down
Loading