From adae31db3e080c19d6682b4d3aec9495a1e972ad Mon Sep 17 00:00:00 2001 From: Aleksei Gagarin Date: Tue, 3 Mar 2026 16:14:33 +0400 Subject: [PATCH 1/6] Revise Yii configuration for RoadRunner setup Updated the RoadRunner configuration for Yii, including changes to middleware and removed the reload section. --- .../tutorial/using-yii-with-roadrunner.md | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/guide/tutorial/using-yii-with-roadrunner.md b/src/guide/tutorial/using-yii-with-roadrunner.md index c897f591..44e86919 100644 --- a/src/guide/tutorial/using-yii-with-roadrunner.md +++ b/src/guide/tutorial/using-yii-with-roadrunner.md @@ -28,6 +28,9 @@ First, we need to configure the server itself. Create `/.rr.yaml` and add the fo ```yaml server: command: "php worker.php" + env: + APP_ENV=prod + YII_DEBUG=false rpc: listen: tcp://127.0.0.1:6001 @@ -35,9 +38,10 @@ rpc: http: address: :8080 pool: - num_workers: 4 - max_jobs: 64 - middleware: ["static", "headers"] + debug: false # set to true for local development only + supervisor: + max_worker_memory: 192 + middleware: [static, gzip, headers, sendfile ] static: dir: "public" forbid: [".php", ".htaccess"] @@ -45,19 +49,14 @@ http: response: "Cache-Control": "no-cache" -reload: - interval: 1s - patterns: [ ".php" ] - services: - http: - recursive: true - dirs: [ "." ] - logs: mode: production level: warn ``` +> [!INFO] +> Read more about HTTP configuration on [RoadRunner docs](https://docs.roadrunner.dev/docs/http/http) + We're specifying that entry script is `worker.php`, there should be three workers on port 8080, `public` directory files are static ones except `.php` and `.htaccess`. Also, we're sending an additional header. @@ -68,7 +67,6 @@ Create `/worker.php`: declare(strict_types=1); - use Yiisoft\Yii\Runner\RoadRunner\RoadRunnerApplicationRunner; ini_set('display_errors', 'stderr'); @@ -83,7 +81,7 @@ require_once __DIR__ . '/preload.php'; To start a server, execute the following command: ``` -./rr serve -d +./rr serve ``` ## On worker scope From 9c53c3383a3a9f165c98ec2851ce5550d040a3e9 Mon Sep 17 00:00:00 2001 From: Aleksei Gagarin Date: Tue, 3 Mar 2026 16:17:58 +0400 Subject: [PATCH 2/6] Enhance HTTP configuration details in tutorial Updated the information about HTTP configuration to include TLS, HTTP/2, and HTTP/3. --- src/guide/tutorial/using-yii-with-roadrunner.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guide/tutorial/using-yii-with-roadrunner.md b/src/guide/tutorial/using-yii-with-roadrunner.md index 44e86919..9b96d506 100644 --- a/src/guide/tutorial/using-yii-with-roadrunner.md +++ b/src/guide/tutorial/using-yii-with-roadrunner.md @@ -55,7 +55,7 @@ logs: ``` > [!INFO] -> Read more about HTTP configuration on [RoadRunner docs](https://docs.roadrunner.dev/docs/http/http) +> Read more about TLS, HTTP/2, HTTP/3 configuration and other middleware [on the RoadRunner docs](https://docs.roadrunner.dev/docs/http/http). We're specifying that entry script is `worker.php`, there should be three workers on port 8080, `public` directory files are static ones except `.php` and `.htaccess`. Also, we're sending an additional header. From 04011a0fede11e5d8f4515c81cd29f4210634ab5 Mon Sep 17 00:00:00 2001 From: Aleksei Gagarin Date: Tue, 3 Mar 2026 16:24:17 +0400 Subject: [PATCH 3/6] Update src/guide/tutorial/using-yii-with-roadrunner.md Co-authored-by: Sergei Predvoditelev --- src/guide/tutorial/using-yii-with-roadrunner.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guide/tutorial/using-yii-with-roadrunner.md b/src/guide/tutorial/using-yii-with-roadrunner.md index 9b96d506..c659b094 100644 --- a/src/guide/tutorial/using-yii-with-roadrunner.md +++ b/src/guide/tutorial/using-yii-with-roadrunner.md @@ -30,7 +30,7 @@ server: command: "php worker.php" env: APP_ENV=prod - YII_DEBUG=false + APP_DEBUG=false rpc: listen: tcp://127.0.0.1:6001 From effd88ad7ca33125f532b35a4d6ad906816b1c6c Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 5 Mar 2026 15:23:03 +0300 Subject: [PATCH 4/6] Update src/guide/tutorial/using-yii-with-roadrunner.md --- src/guide/tutorial/using-yii-with-roadrunner.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guide/tutorial/using-yii-with-roadrunner.md b/src/guide/tutorial/using-yii-with-roadrunner.md index c659b094..922cbb6b 100644 --- a/src/guide/tutorial/using-yii-with-roadrunner.md +++ b/src/guide/tutorial/using-yii-with-roadrunner.md @@ -41,7 +41,7 @@ http: debug: false # set to true for local development only supervisor: max_worker_memory: 192 - middleware: [static, gzip, headers, sendfile ] + middleware: [static, gzip, headers, sendfile] static: dir: "public" forbid: [".php", ".htaccess"] From 3c1418cc9106ca61e700fc86836983f8a3636fb2 Mon Sep 17 00:00:00 2001 From: Aleksei Gagarin Date: Thu, 5 Mar 2026 17:31:04 +0400 Subject: [PATCH 5/6] Update src/guide/tutorial/using-yii-with-roadrunner.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/guide/tutorial/using-yii-with-roadrunner.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/guide/tutorial/using-yii-with-roadrunner.md b/src/guide/tutorial/using-yii-with-roadrunner.md index 922cbb6b..c3f068af 100644 --- a/src/guide/tutorial/using-yii-with-roadrunner.md +++ b/src/guide/tutorial/using-yii-with-roadrunner.md @@ -29,8 +29,8 @@ First, we need to configure the server itself. Create `/.rr.yaml` and add the fo server: command: "php worker.php" env: - APP_ENV=prod - APP_DEBUG=false + YII_ENV: prod + YII_DEBUG: false rpc: listen: tcp://127.0.0.1:6001 From 9b82e75fd6c33cf1b6f8afbcc47fb638a8e14112 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Mar 2026 17:42:29 +0400 Subject: [PATCH 6/6] Fix stale worker-count prose after http.pool config refactor (#386) * Initial plan * Update prose to match http.pool config (remove stale 'three workers' reference) Co-authored-by: roxblnfk <4152481+roxblnfk@users.noreply.github.com> * Clarify max_worker_memory as a soft limit with post-request restart Co-authored-by: roxblnfk <4152481+roxblnfk@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: roxblnfk <4152481+roxblnfk@users.noreply.github.com> --- src/guide/tutorial/using-yii-with-roadrunner.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/guide/tutorial/using-yii-with-roadrunner.md b/src/guide/tutorial/using-yii-with-roadrunner.md index c3f068af..5f86dea6 100644 --- a/src/guide/tutorial/using-yii-with-roadrunner.md +++ b/src/guide/tutorial/using-yii-with-roadrunner.md @@ -57,8 +57,9 @@ logs: > [!INFO] > Read more about TLS, HTTP/2, HTTP/3 configuration and other middleware [on the RoadRunner docs](https://docs.roadrunner.dev/docs/http/http). -We're specifying that entry script is `worker.php`, there should be three workers on port 8080, `public` directory -files are static ones except `.php` and `.htaccess`. Also, we're sending an additional header. +We're specifying that the entry script is `worker.php`, the server listens on port 8080, `public` directory +files are served statically except `.php` and `.htaccess`. The `max_worker_memory` is a soft limit: if a worker +exceeds 192 MB, it will restart after finishing its current request. Also, we're sending an additional header. Create `/worker.php`: