Skip to content

Workerman faster json encode#247

Merged
MDA2AV merged 3 commits intoMDA2AV:mainfrom
joanhey:workerman-json
Mar 29, 2026
Merged

Workerman faster json encode#247
MDA2AV merged 3 commits intoMDA2AV:mainfrom
joanhey:workerman-json

Conversation

@joanhey
Copy link
Copy Markdown
Contributor

@joanhey joanhey commented Mar 29, 2026

No description provided.

@joanhey joanhey marked this pull request as draft March 29, 2026 12:11
Copy link
Copy Markdown
Collaborator

@BennyFranciscus BennyFranciscus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug on the db endpoint — the flags ended up as the second arg to $connection->send() instead of json_encode():

// Current (flags go to send(), not json_encode()):
return $connection->send(json_encode([...]), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);

// Should be:
return $connection->send(json_encode([...], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));

The largeJson() function on line 31 is correct — just the db endpoint at line 62 has the misplaced parenthesis.

Nice optimization btw — skipping unicode/slash escaping is free speed for json_encode. 👍

@joanhey joanhey marked this pull request as ready for review March 29, 2026 12:16
@BennyFranciscus
Copy link
Copy Markdown
Collaborator

Fix looks good — both calls have the flags in the right place now. 👍

Want me to kick off a benchmark run to see how much the unescaped encoding helps on the json endpoints?

@joanhey
Copy link
Copy Markdown
Contributor Author

joanhey commented Mar 29, 2026

/benchmark

@github-actions
Copy link
Copy Markdown
Contributor

🚀 Benchmark run triggered for workerman (all profiles). Results will be posted here when done.

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark Results

Framework: workerman | Profile: all profiles

workerman / baseline / 512c (p=1, r=0, cpu=64)
  Best: 2425632 req/s (CPU: 6559.9%, Mem: 1.8GiB) ===

workerman / baseline / 4096c (p=1, r=0, cpu=64)
  Best: 2720495 req/s (CPU: 6311.2%, Mem: 1.8GiB) ===

workerman / baseline / 16384c (p=1, r=0, cpu=64)
  Best: 2549442 req/s (CPU: 6138.1%, Mem: 1.9GiB) ===

workerman / pipelined / 512c (p=16, r=0, cpu=unlimited)
  Best: 3666817 req/s (CPU: 8817.6%, Mem: 1.7GiB) ===

workerman / pipelined / 4096c (p=16, r=0, cpu=unlimited)
  Best: 3792007 req/s (CPU: 9276.2%, Mem: 1.8GiB) ===

workerman / pipelined / 16384c (p=16, r=0, cpu=unlimited)
  Best: 3725151 req/s (CPU: 8704.9%, Mem: 1.9GiB) ===

workerman / limited-conn / 512c (p=1, r=10, cpu=unlimited)
  Best: 1538583 req/s (CPU: 5566.1%, Mem: 1.7GiB) ===

workerman / limited-conn / 4096c (p=1, r=10, cpu=unlimited)
  Best: 2005597 req/s (CPU: 6368.6%, Mem: 1.8GiB) ===

workerman / json / 4096c (p=1, r=0, cpu=unlimited)
  Best: 703485 req/s (CPU: 10290.1%, Mem: 1.8GiB) ===

workerman / json / 16384c (p=1, r=0, cpu=unlimited)
  Best: 679205 req/s (CPU: 9705.5%, Mem: 1.9GiB) ===

workerman / upload / 64c (p=1, r=0, cpu=unlimited)
  Best: 240 req/s (CPU: 5410.4%, Mem: 3.1GiB) ===

workerman / upload / 256c (p=1, r=0, cpu=unlimited)
  Best: 190 req/s (CPU: 10829.2%, Mem: 5.8GiB) ===

workerman / upload / 512c (p=1, r=0, cpu=unlimited)
  Best: 151 req/s (CPU: 12454.7%, Mem: 9.4GiB) ===

workerman / compression / 4096c (p=1, r=0, cpu=unlimited)
  Best: 9992 req/s (CPU: 12393.3%, Mem: 1.8GiB) ===

workerman / compression / 16384c (p=1, r=0, cpu=unlimited)
  Best: 9884 req/s (CPU: 11759.3%, Mem: 1.9GiB) ===

workerman / noisy / 512c (p=1, r=0, cpu=unlimited)
  Best: 1629546 req/s (CPU: 5863.2%, Mem: 1.7GiB) ===

workerman / noisy / 4096c (p=1, r=0, cpu=unlimited)
  Best: 2369271 req/s (CPU: 7050.5%, Mem: 1.8GiB) ===

workerman / noisy / 16384c (p=1, r=0, cpu=unlimited)
  Best: 2028423 req/s (CPU: 7404.6%, Mem: 1.9GiB) ===

workerman / mixed / 4096c (p=1, r=5, cpu=unlimited)
  Best: 43879 req/s (CPU: 11698.6%, Mem: 2.5GiB) ===

workerman / mixed / 16384c (p=1, r=5, cpu=unlimited)
  Best: 39742 req/s (CPU: 10356.1%, Mem: 2.6GiB) ===
Full log
httparena-bench-workerman
httparena-bench-workerman

==============================================
=== workerman / mixed / 4096c (p=1, r=5, cpu=unlimited) ===
==============================================
fe3665ab5e79c5ba917deff1438383d08ebbe7f58cceca42eafab82441c2722e
[wait] Waiting for server...
[ready] Server is up

[run 1/3]
gcannon — io_uring HTTP load generator
  Target:    localhost:8080/
  Threads:   64
  Conns:     4096 (64/thread)
  Pipeline:  1
  Req/conn:  5
  Templates: 14
  Expected:  200
  Duration:  15s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   75.36ms   15.30ms   265.50ms   646.40ms   927.70ms

  834875 requests in 15.00s, 775201 responses
  Throughput: 51.67K req/s
  Bandwidth:  1.56GB/s
  Status codes: 2xx=656850, 3xx=0, 4xx=118351, 5xx=0
  Latency samples: 775199 / 775201 responses (100.0%)
  Reconnects: 166718
  Per-template: 59363,59604,59831,60062,60227,48399,48730,60051,47355,47239,58804,47183,59093,59258
  Per-template-ok: 59363,59604,59831,60062,60227,48399,48730,60051,47355,47239,58804,47183,0,0

  WARNING: 118351/775201 responses (15.3%) had unexpected status (expected 2xx)
  CPU: 11564.6% | Mem: 2.5GiB

[run 2/3]
gcannon — io_uring HTTP load generator
  Target:    localhost:8080/
  Threads:   64
  Conns:     4096 (64/thread)
  Pipeline:  1
  Req/conn:  5
  Templates: 14
  Expected:  200
  Duration:  15s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   75.25ms   15.30ms   263.60ms   657.50ms   923.60ms

  837005 requests in 15.00s, 776788 responses
  Throughput: 51.77K req/s
  Bandwidth:  1.57GB/s
  Status codes: 2xx=658195, 3xx=0, 4xx=118593, 5xx=0
  Latency samples: 776781 / 776788 responses (100.0%)
  Reconnects: 167101
  Per-template: 59598,59725,59957,60211,60398,48550,48793,60071,47465,47265,58974,47184,59130,59460
  Per-template-ok: 59598,59725,59957,60211,60398,48550,48793,60071,47465,47265,58974,47184,0,0

  WARNING: 118593/776788 responses (15.3%) had unexpected status (expected 2xx)
  CPU: 11698.6% | Mem: 2.5GiB

[run 3/3]
gcannon — io_uring HTTP load generator
  Target:    localhost:8080/
  Threads:   64
  Conns:     4096 (64/thread)
  Pipeline:  1
  Req/conn:  5
  Templates: 14
  Expected:  200
  Duration:  15s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   75.52ms   15.30ms   266.60ms   646.40ms   907.30ms

  834009 requests in 15.00s, 774241 responses
  Throughput: 51.60K req/s
  Bandwidth:  1.56GB/s
  Status codes: 2xx=656117, 3xx=0, 4xx=118124, 5xx=0
  Latency samples: 774239 / 774241 responses (100.0%)
  Reconnects: 166614
  Per-template: 59315,59534,59783,60035,60266,48436,48619,59968,47325,47153,58651,47030,58951,59173
  Per-template-ok: 59315,59534,59783,60035,60266,48436,48619,59968,47325,47153,58651,47030,0,0

  WARNING: 118124/774241 responses (15.3%) had unexpected status (expected 2xx)
  CPU: 11615.4% | Mem: 2.5GiB

=== Best: 43879 req/s (CPU: 11698.6%, Mem: 2.5GiB) ===
  Input BW: 3.06GB/s (avg template: 74962 bytes)
[dry-run] Results not saved (use --save to persist)
httparena-bench-workerman
httparena-bench-workerman

==============================================
=== workerman / mixed / 16384c (p=1, r=5, cpu=unlimited) ===
==============================================
82a36362d07563f752a32e787c2647cc226f2fc77e577839dbb8197f724f7da1
[wait] Waiting for server...
[ready] Server is up

[run 1/3]
gcannon — io_uring HTTP load generator
  Target:    localhost:8080/
  Threads:   64
  Conns:     16384 (256/thread)
  Pipeline:  1
  Req/conn:  5
  Templates: 14
  Expected:  200
  Duration:  15s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   323.38ms   24.80ms    1.42s    2.12s    2.53s

  772195 requests in 15.01s, 701443 responses
  Throughput: 46.74K req/s
  Bandwidth:  1.41GB/s
  Status codes: 2xx=595424, 3xx=0, 4xx=106019, 5xx=0
  Latency samples: 701443 / 701443 responses (100.0%)
  Reconnects: 150540
  Per-template: 52779,52298,52961,55078,56084,45240,45328,54885,42908,42598,52814,42450,53154,52866
  Per-template-ok: 52779,52298,52961,55078,56084,45240,45328,54885,42908,42598,52814,42450,0,1

  WARNING: 106019/701443 responses (15.1%) had unexpected status (expected 2xx)
  CPU: 10310.5% | Mem: 2.6GiB

[run 2/3]
gcannon — io_uring HTTP load generator
  Target:    localhost:8080/
  Threads:   64
  Conns:     16384 (256/thread)
  Pipeline:  1
  Req/conn:  5
  Templates: 14
  Expected:  200
  Duration:  15s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   324.45ms   25.30ms    1.42s    2.11s    2.53s

  770105 requests in 15.01s, 699542 responses
  Throughput: 46.60K req/s
  Bandwidth:  1.41GB/s
  Status codes: 2xx=593821, 3xx=0, 4xx=105721, 5xx=0
  Latency samples: 699542 / 699542 responses (100.0%)
  Reconnects: 150091
  Per-template: 52712,51768,52906,55104,55881,45169,45414,54943,42794,42456,52578,42095,52770,52952
  Per-template-ok: 52712,51768,52906,55104,55881,45169,45414,54943,42794,42456,52577,42095,0,2

  WARNING: 105721/699542 responses (15.1%) had unexpected status (expected 2xx)
  CPU: 10484.7% | Mem: 3.0GiB

[run 3/3]
gcannon — io_uring HTTP load generator
  Target:    localhost:8080/
  Threads:   64
  Conns:     16384 (256/thread)
  Pipeline:  1
  Req/conn:  5
  Templates: 14
  Expected:  200
  Duration:  15s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   323.96ms   25.10ms    1.41s    2.16s    2.61s

  773172 requests in 15.01s, 702653 responses
  Throughput: 46.80K req/s
  Bandwidth:  1.41GB/s
  Status codes: 2xx=596534, 3xx=0, 4xx=106119, 5xx=0
  Latency samples: 702653 / 702653 responses (100.0%)
  Reconnects: 150805
  Per-template: 52875,52289,53131,55221,56264,45427,45686,55205,42805,42349,52920,42361,53099,53021
  Per-template-ok: 52875,52289,53131,55221,56264,45427,45686,55205,42805,42349,52920,42361,1,0

  WARNING: 106119/702653 responses (15.1%) had unexpected status (expected 2xx)
  CPU: 10356.1% | Mem: 2.6GiB

=== Best: 39742 req/s (CPU: 10356.1%, Mem: 2.6GiB) ===
  Input BW: 2.77GB/s (avg template: 74962 bytes)
[dry-run] Results not saved (use --save to persist)
httparena-bench-workerman
httparena-bench-workerman
[skip] workerman does not subscribe to static
[skip] workerman does not subscribe to async-db
[skip] workerman does not subscribe to baseline-h2
[skip] workerman does not subscribe to static-h2
[skip] workerman does not subscribe to baseline-h3
[skip] workerman does not subscribe to static-h3
[skip] workerman does not subscribe to unary-grpc
[skip] workerman does not subscribe to unary-grpc-tls
[skip] workerman does not subscribe to echo-ws
[restore] Restoring CPU governor to performance...

@BennyFranciscus
Copy link
Copy Markdown
Collaborator

Nice — benchmark results look solid. Baseline and pipelined numbers are consistent with PR #243 (2.4-2.7M baseline, 3.7-3.8M pipelined), so no regression from the json encode change.

JSON endpoint at ~700K req/s with the unescaped encoding — that's a good showing for PHP. 👍

@MDA2AV
Copy link
Copy Markdown
Owner

MDA2AV commented Mar 29, 2026

btw there are 2 new tests you might want to add to workerman, static and async-db for http/1.1 test suite, they are now also included in the mixed

@BennyFranciscus
Copy link
Copy Markdown
Collaborator

Oh nice, didn't realize those got added to the mixed suite too. I'll look into adding static and async-db to the workerman config — static should be straightforward, async-db might need a bit more work depending on what the endpoint spec looks like. Will check the test definitions and put up a follow-up PR.

@joanhey
Copy link
Copy Markdown
Contributor Author

joanhey commented Mar 29, 2026

Static was already enabled in the last PR. Need any change in the meta.json ?

The Postgre Async-db will be added later.

@BennyFranciscus
Copy link
Copy Markdown
Collaborator

Ah right, my bad — I see the static file handler is already in server.php on main. Yeah, meta.json needs "static" added to the tests array so the benchmark runner picks it up. Right now it only lists baseline through mixed.

If you want to add it in this PR, just drop "static" into the tests list. Otherwise I can do a quick follow-up.

And sounds good on async-db later — no rush on that one.

@MDA2AV
Copy link
Copy Markdown
Owner

MDA2AV commented Mar 29, 2026

ill trigger verification and benchmark in a sec

@MDA2AV
Copy link
Copy Markdown
Owner

MDA2AV commented Mar 29, 2026

/benchmark static

@github-actions
Copy link
Copy Markdown
Contributor

🚀 Benchmark run triggered for workerman (profile: static). Results will be posted here when done.

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark Results

Framework: workerman | Profile: static

workerman / static / 4096c (p=1, r=0, cpu=unlimited)
  Best: 1078589 req/s (CPU: 8564.8%, Mem: 1.8GiB) ===

workerman / static / 16384c (p=1, r=0, cpu=unlimited)
  Best: 930734 req/s (CPU: 8250.1%, Mem: 1.9GiB) ===
Full log

#12 [stage-0  5/11] COPY --from=composer/composer:latest-bin --link /composer /usr/local/bin/composer
#12 CACHED

#13 [stage-0  8/11] COPY --link composer.json .
#13 CACHED

#14 [stage-0  3/11] RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null &&     apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null
#14 CACHED

#15 [stage-0  7/11] WORKDIR /workerman
#15 CACHED

#16 [stage-0  2/11] RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
#16 CACHED

#17 [stage-0  6/11] RUN apt-get install -y php-pear php8.5-dev libevent-dev git > /dev/null &&     pecl install event-3.1.4 > /dev/null && echo "extension=event.so" > /etc/php/8.5/cli/conf.d/30-event.ini
#17 CACHED

#18 exporting to image
#18 exporting layers done
#18 exporting manifest sha256:38fde6950249429f06e448c9a2d57fc02e6dbf76e5be19a714e04f0b0df89bb2 done
#18 exporting config sha256:d0f1ebcf4584047f41afb89e223b04ec48a26f854b0f97d530eaeb7037a285ee done
#18 exporting attestation manifest sha256:8f45ed4d07d3cc301717513ee9066acfc1429b9dbe7df72c4842442daf30e161
#18 exporting attestation manifest sha256:8f45ed4d07d3cc301717513ee9066acfc1429b9dbe7df72c4842442daf30e161 0.1s done
#18 exporting manifest list sha256:9e495ba8077538c983a4f5586109780b87810866b76b33267f4ffde829dddab3 0.0s done
#18 naming to docker.io/library/httparena-workerman:latest done
#18 unpacking to docker.io/library/httparena-workerman:latest 0.0s done
#18 DONE 0.2s

==============================================
=== workerman / static / 4096c (p=1, r=0, cpu=unlimited) ===
==============================================
1ff33ec182bee301368e4aa178a5e353ec37c6e30c1abdbbcd5e468653447940
[wait] Waiting for server...
[ready] Server is up

[run 1/3]
gcannon — io_uring HTTP load generator
  Target:    localhost:8080/
  Threads:   64
  Conns:     4096 (64/thread)
  Pipeline:  1
  Req/conn:  unlimited (keep-alive)
  Templates: 20
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   1.76ms   1.09ms   3.70ms   10.90ms   38.50ms

  5394359 requests in 5.00s, 5392947 responses
  Throughput: 1.08M req/s
  Bandwidth:  12.83GB/s
  Status codes: 2xx=5392947, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 5392882 / 5392947 responses (100.0%)
  Per-template: 375939,348885,367825,242274,225231,366440,236729,205293,194483,224878,303710,378555,245909,184383,286858,273891,169657,217571,204403,339968
  Per-template-ok: 375939,348885,367825,242274,225231,366440,236729,205293,194483,224878,303710,378555,245909,184383,286858,273891,169657,217571,204403,339968
  CPU: 8564.8% | Mem: 1.8GiB

[run 2/3]
gcannon — io_uring HTTP load generator
  Target:    localhost:8080/
  Threads:   64
  Conns:     4096 (64/thread)
  Pipeline:  1
  Req/conn:  unlimited (keep-alive)
  Templates: 20
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   1.83ms   1.17ms   3.97ms   10.30ms   35.60ms

  5368859 requests in 5.00s, 5367643 responses
  Throughput: 1.07M req/s
  Bandwidth:  12.77GB/s
  Status codes: 2xx=5367643, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 5368008 / 5367643 responses (100.0%)
  Per-template: 309293,343920,324412,253469,235437,398198,300879,205303,205657,222578,322099,377992,190103,188993,269201,262365,176434,214079,207670,359558
  Per-template-ok: 309293,343920,324412,253469,235437,398198,300879,205303,205657,222578,322099,377992,190103,188993,269201,262365,176434,214079,207670,359558
  CPU: 9044.7% | Mem: 1.8GiB

[run 3/3]
gcannon — io_uring HTTP load generator
  Target:    localhost:8080/
  Threads:   64
  Conns:     4096 (64/thread)
  Pipeline:  1
  Req/conn:  unlimited (keep-alive)
  Templates: 20
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   1.90ms   1.25ms   4.08ms   10.30ms   28.10ms

  5392891 requests in 5.00s, 5392674 responses
  Throughput: 1.08M req/s
  Bandwidth:  12.57GB/s
  Status codes: 2xx=5392674, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 5392611 / 5392674 responses (100.0%)
  Per-template: 370317,337547,345419,254330,230445,344082,288961,209713,176705,212403,342794,348828,217861,187372,265245,330139,167300,206700,193252,363198
  Per-template-ok: 370317,337547,345419,254330,230445,344082,288961,209713,176705,212403,342794,348828,217861,187372,265245,330139,167300,206700,193252,363198
  CPU: 8743.5% | Mem: 1.8GiB

=== Best: 1078589 req/s (CPU: 8564.8%, Mem: 1.8GiB) ===
  Input BW: 58.63MB/s (avg template: 57 bytes)
[dry-run] Results not saved (use --save to persist)
httparena-bench-workerman
httparena-bench-workerman

==============================================
=== workerman / static / 16384c (p=1, r=0, cpu=unlimited) ===
==============================================
63c7d80d5479c5196181786e55f361b47a486dc4fe815b15997212b38f49dc38
[wait] Waiting for server...
[ready] Server is up

[run 1/3]
gcannon — io_uring HTTP load generator
  Target:    localhost:8080/
  Threads:   64
  Conns:     16384 (256/thread)
  Pipeline:  1
  Req/conn:  unlimited (keep-alive)
  Templates: 20
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   13.49ms   10.50ms   25.40ms   58.60ms   133.40ms

  4679362 requests in 5.01s, 4662978 responses
  Throughput: 931.23K req/s
  Bandwidth:  13.27GB/s
  Status codes: 2xx=4662978, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 4662978 / 4662978 responses (100.0%)
  Per-template: 245754,238421,242958,239624,236680,243542,247500,224115,220171,236552,248449,246832,215003,211373,236250,243850,193940,223934,223809,244221
  Per-template-ok: 245754,238421,242958,239624,236680,243542,247500,224115,220171,236552,248449,246832,215003,211373,236250,243850,193940,223934,223809,244221
  CPU: 8250.1% | Mem: 1.9GiB

[run 2/3]
gcannon — io_uring HTTP load generator
  Target:    localhost:8080/
  Threads:   64
  Conns:     16384 (256/thread)
  Pipeline:  1
  Req/conn:  unlimited (keep-alive)
  Templates: 20
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   13.39ms   10.30ms   25.10ms   59.60ms   138.70ms

  4664609 requests in 5.00s, 4648225 responses
  Throughput: 928.85K req/s
  Bandwidth:  13.30GB/s
  Status codes: 2xx=4648225, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 4648225 / 4648225 responses (100.0%)
  Per-template: 247118,237496,235161,238610,237913,242514,239671,217476,217373,227925,243019,248922,217976,213159,240614,244568,196380,231963,225542,244825
  Per-template-ok: 247118,237496,235161,238610,237913,242514,239671,217476,217373,227925,243019,248922,217976,213159,240614,244568,196380,231963,225542,244825
  CPU: 8739.9% | Mem: 1.9GiB

[run 3/3]
gcannon — io_uring HTTP load generator
  Target:    localhost:8080/
  Threads:   64
  Conns:     16384 (256/thread)
  Pipeline:  1
  Req/conn:  unlimited (keep-alive)
  Templates: 20
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   13.72ms   10.80ms   25.50ms   58.80ms   144.60ms

  4648449 requests in 5.01s, 4632065 responses
  Throughput: 925.49K req/s
  Bandwidth:  13.21GB/s
  Status codes: 2xx=4632065, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 4632065 / 4632065 responses (100.0%)
  Per-template: 236690,246407,241927,238197,239865,239032,232145,219108,217899,231077,246770,248011,215946,212396,239366,239258,193415,225496,221490,247570
  Per-template-ok: 236690,246407,241927,238197,239865,239032,232145,219108,217899,231077,246770,248011,215946,212396,239366,239258,193415,225496,221490,247570
  CPU: 8272.9% | Mem: 1.9GiB

=== Best: 930734 req/s (CPU: 8250.1%, Mem: 1.9GiB) ===
  Input BW: 50.59MB/s (avg template: 57 bytes)
[dry-run] Results not saved (use --save to persist)
httparena-bench-workerman
httparena-bench-workerman
[restore] Restoring CPU governor to performance...

@BennyFranciscus
Copy link
Copy Markdown
Collaborator

1M+ req/s on static serving — workerman is holding up really well there. The ~14% drop from 4096 to 16384 connections is pretty typical for PHP userland event loops dealing with that many concurrent fds, nothing unusual.

Looks like the static endpoint is good to go for the test suite. 👍

@joanhey
Copy link
Copy Markdown
Contributor Author

joanhey commented Mar 29, 2026

I didn't preloaded the files in the RAM

Files are loaded into memory at startup

Tomorrow I'll try with the files preloaded in RAM.

@joanhey
Copy link
Copy Markdown
Contributor Author

joanhey commented Mar 29, 2026

Or if you want @BennyFranciscus you can try it to add into RAM at startup of the test.

I need to go, later I'll come back.

@BennyFranciscus
Copy link
Copy Markdown
Collaborator

Oh interesting — so those static numbers are with disk reads on every request? That's actually impressive then. 1M req/s without any in-memory caching is solid.

Curious to see how much preloading bumps it. If the files fit comfortably in memory (which they should, the test templates are tiny), I'd expect a nice jump since you'd skip the syscall overhead entirely. Looking forward to the results!

@MDA2AV MDA2AV merged commit 8e70486 into MDA2AV:main Mar 29, 2026
3 of 4 checks passed
@joanhey joanhey deleted the workerman-json branch March 29, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants