Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions frameworks/true-async-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM trueasync/php-true-async:0.7.0-beta.5-php8.6
FROM trueasync/php-true-async:0.7.0-rc.3-php8.6

RUN printf '%s\n' \
'opcache.jit=1255' \
Expand All @@ -13,6 +13,6 @@ RUN printf '%s\n' \
WORKDIR /app
COPY entry.php PostgreSQL.php SQLite.php /app/

EXPOSE 8080 8443
EXPOSE 8080 8443 8443/udp

CMD ["php", "/app/entry.php"]
22 changes: 16 additions & 6 deletions frameworks/true-async-server/entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
$port = (int)(getenv('PORT') ?: 8080);
$tlsPort = (int)(getenv('TLS_PORT') ?: 8443);
$h2cPort = (int)(getenv('H2C_PORT') ?: 8082);
$h3Port = (int)(getenv('H3_PORT') ?: $tlsPort);
$h3Enabled = getenv('H3_DISABLE') !== '1';
$workers = (int)(getenv('WORKERS') ?: 0);
if ($workers <= 0) {
$workers = available_parallelism();
Expand Down Expand Up @@ -81,12 +83,20 @@
->addListener('0.0.0.0', $tlsPort, true)
->addListener('0.0.0.0', 8081, true)
->setCertificate($certPath)
->setPrivateKey($keyPath);

// No HTTP/3 listener: meta.json subscribes to no h3 profile, so the
// QUIC UDP listener would be pure liability — an extra bind that races
// with the previous container's teardown on back-to-back profile runs
// and makes the server fail to come up ("did not come up" on limited-conn).
->setPrivateKey($keyPath)
// Pin the TLS clear-text-out BIO ring to 64 KiB (#29). This already
// matches the built-in default, set explicitly so the arena's TLS
// write-buffer size stays fixed regardless of future default changes.
->setTlsBufferBytes(64 * 1024);

// HTTP/3 over QUIC on the same UDP port — powers baseline-h3 / static-h3.
// Reuses the TLS cert/key and coexists with h2 on TCP :8443. A 120-iteration
// back-to-back restart repro (16 and 64 workers) showed 0 startup failures
// with this listener on — the C listener sets SO_REUSEADDR/SO_REUSEPORT — so
// it stays always-on. Set H3_DISABLE=1 to skip on builds without H3.
if ($h3Enabled) {
$config->addHttp3Listener('0.0.0.0', $h3Port);
}
}

// Bootloader needs the class files visible in the parent too, otherwise
Expand Down
2 changes: 2 additions & 0 deletions frameworks/true-async-server/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"baseline-h2",
"baseline-h2c",
"json-h2c",
"baseline-h3",
"static-h3",
"async-db",
"fortunes"
]
Expand Down
24 changes: 12 additions & 12 deletions site/data/api-16-1024.json
Original file line number Diff line number Diff line change
Expand Up @@ -1166,28 +1166,28 @@
{
"framework": "true-async-server",
"language": "PHP",
"rps": 152800,
"avg_latency": "5.70ms",
"p99_latency": "99.80ms",
"cpu": "1574.7%",
"memory": "77MiB",
"rps": 143872,
"avg_latency": "5.98ms",
"p99_latency": "85.40ms",
"cpu": "1564.8%",
"memory": "79MiB",
"connections": 1024,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "762.37MB/s",
"input_bw": "8.60MB/s",
"reconnects": 458523,
"status_2xx": 2292002,
"bandwidth": "727.40MB/s",
"input_bw": "8.10MB/s",
"reconnects": 431707,
"status_2xx": 2158094,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0,
"tpl_baseline": 860025,
"tpl_json": 859000,
"tpl_baseline": 809390,
"tpl_json": 809302,
"tpl_db": 0,
"tpl_upload": 0,
"tpl_static": 0,
"tpl_async_db": 572974
"tpl_async_db": 539398
},
{
"framework": "uvicorn",
Expand Down
24 changes: 12 additions & 12 deletions site/data/api-4-256.json
Original file line number Diff line number Diff line change
Expand Up @@ -1166,28 +1166,28 @@
{
"framework": "true-async-server",
"language": "PHP",
"rps": 56308,
"avg_latency": "3.62ms",
"p99_latency": "41.20ms",
"cpu": "394.0%",
"memory": "42MiB",
"rps": 51257,
"avg_latency": "3.91ms",
"p99_latency": "45.30ms",
"cpu": "394.7%",
"memory": "43MiB",
"connections": 256,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "280.94MB/s",
"input_bw": "3.17MB/s",
"reconnects": 168949,
"status_2xx": 844621,
"bandwidth": "259.11MB/s",
"input_bw": "2.88MB/s",
"reconnects": 153800,
"status_2xx": 768859,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0,
"tpl_baseline": 316921,
"tpl_json": 316708,
"tpl_baseline": 288429,
"tpl_json": 288315,
"tpl_db": 0,
"tpl_upload": 0,
"tpl_static": 0,
"tpl_async_db": 210990
"tpl_async_db": 192115
},
{
"framework": "uvicorn",
Expand Down
16 changes: 8 additions & 8 deletions site/data/async-db-1024.json
Original file line number Diff line number Diff line change
Expand Up @@ -936,19 +936,19 @@
{
"framework": "true-async-server",
"language": "PHP",
"rps": 249894,
"avg_latency": "3.56ms",
"p99_latency": "12.50ms",
"cpu": "4917.3%",
"memory": "248MiB",
"rps": 249931,
"avg_latency": "3.54ms",
"p99_latency": "18.00ms",
"cpu": "4968.6%",
"memory": "230MiB",
"connections": 1024,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "943.85MB/s",
"bandwidth": "960.73MB/s",
"input_bw": "16.68MB/s",
"reconnects": 99973,
"status_2xx": 2498944,
"reconnects": 99610,
"status_2xx": 2499314,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
16 changes: 8 additions & 8 deletions site/data/baseline-4096.json
Original file line number Diff line number Diff line change
Expand Up @@ -1328,19 +1328,19 @@
{
"framework": "true-async-server",
"language": "PHP",
"rps": 2260254,
"avg_latency": "1.81ms",
"p99_latency": "2.53ms",
"cpu": "5871.2%",
"memory": "220MiB",
"rps": 1553382,
"avg_latency": "2.63ms",
"p99_latency": "5.38ms",
"cpu": "6195.6%",
"memory": "207MiB",
"connections": 4096,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "142.23MB/s",
"input_bw": "174.60MB/s",
"bandwidth": "198.46MB/s",
"input_bw": "120.00MB/s",
"reconnects": 0,
"status_2xx": 11301272,
"status_2xx": 7766912,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
16 changes: 8 additions & 8 deletions site/data/baseline-512.json
Original file line number Diff line number Diff line change
Expand Up @@ -1328,19 +1328,19 @@
{
"framework": "true-async-server",
"language": "PHP",
"rps": 2154955,
"avg_latency": "237us",
"p99_latency": "571us",
"cpu": "6712.0%",
"memory": "182MiB",
"rps": 1458274,
"avg_latency": "350us",
"p99_latency": "1.05ms",
"cpu": "6266.6%",
"memory": "184MiB",
"connections": 512,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "135.61MB/s",
"input_bw": "166.47MB/s",
"bandwidth": "186.31MB/s",
"input_bw": "112.65MB/s",
"reconnects": 0,
"status_2xx": 10774775,
"status_2xx": 7291374,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
14 changes: 7 additions & 7 deletions site/data/baseline-h2-1024.json
Original file line number Diff line number Diff line change
Expand Up @@ -509,18 +509,18 @@
{
"framework": "true-async-server",
"language": "PHP",
"rps": 3288741,
"avg_latency": "27.37ms",
"p99_latency": "27.37ms",
"cpu": "7207.5%",
"memory": "505MiB",
"rps": 3733476,
"avg_latency": "24.66ms",
"p99_latency": "24.66ms",
"cpu": "6324.9%",
"memory": "539MiB",
"connections": 1024,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "66.54MB/s",
"bandwidth": "79.29MB/s",
"reconnects": 0,
"status_2xx": 16608143,
"status_2xx": 18891391,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
14 changes: 7 additions & 7 deletions site/data/baseline-h2-256.json
Original file line number Diff line number Diff line change
Expand Up @@ -509,18 +509,18 @@
{
"framework": "true-async-server",
"language": "PHP",
"rps": 4969431,
"avg_latency": "5.40ms",
"p99_latency": "5.40ms",
"cpu": "7904.6%",
"memory": "225MiB",
"rps": 4735569,
"avg_latency": "5.80ms",
"p99_latency": "5.80ms",
"cpu": "6052.0%",
"memory": "235MiB",
"connections": 256,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "100.12MB/s",
"bandwidth": "99.76MB/s",
"reconnects": 0,
"status_2xx": 24996239,
"status_2xx": 23772558,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
14 changes: 7 additions & 7 deletions site/data/baseline-h2c-1024.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,18 @@
{
"framework": "true-async-server",
"language": "PHP",
"rps": 3991541,
"avg_latency": "23.14ms",
"p99_latency": "23.14ms",
"cpu": "7607.8%",
"memory": "528MiB",
"rps": 4506134,
"avg_latency": "22.05ms",
"p99_latency": "22.05ms",
"cpu": "6331.3%",
"memory": "516MiB",
"connections": 1024,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "81.07MB/s",
"bandwidth": "95.89MB/s",
"reconnects": 0,
"status_2xx": 20237114,
"status_2xx": 22846100,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
14 changes: 7 additions & 7 deletions site/data/baseline-h2c-256.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,18 @@
{
"framework": "true-async-server",
"language": "PHP",
"rps": 6038026,
"avg_latency": "4.37ms",
"p99_latency": "4.37ms",
"cpu": "7082.3%",
"memory": "244MiB",
"rps": 5818880,
"avg_latency": "4.91ms",
"p99_latency": "4.91ms",
"cpu": "6212.8%",
"memory": "255MiB",
"connections": 256,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "121.65MB/s",
"bandwidth": "122.58MB/s",
"reconnects": 0,
"status_2xx": 30371272,
"status_2xx": 29210778,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
12 changes: 6 additions & 6 deletions site/data/baseline-h2c-4096.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,18 @@
{
"framework": "true-async-server",
"language": "PHP",
"rps": 3753829,
"avg_latency": "100.43ms",
"p99_latency": "100.43ms",
"cpu": "7497.4%",
"rps": 3796119,
"avg_latency": "108.93ms",
"p99_latency": "108.93ms",
"cpu": "5956.0%",
"memory": "1.5GiB",
"connections": 4096,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "76.44MB/s",
"bandwidth": "81.16MB/s",
"reconnects": 0,
"status_2xx": 19069452,
"status_2xx": 19322248,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
19 changes: 19 additions & 0 deletions site/data/baseline-h3-64.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,5 +268,24 @@
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
},
{
"framework": "true-async-server",
"language": "PHP",
"rps": 1277,
"avg_latency": "3.77ms",
"p99_latency": "7.22ms",
"cpu": "12.7%",
"memory": "175MiB",
"connections": 64,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "11.51KB/s",
"reconnects": 0,
"status_2xx": 6400,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
}
]
Loading