File tree Expand file tree Collapse file tree 5 files changed +25
-5
lines changed
Expand file tree Collapse file tree 5 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 4949 'logger ' => ErrorLogger::class,
5050 ],
5151
52+ 'Cache ' => [
53+ 'session ' => [
54+ 'className ' => \Cake \Cache \Engine \RedisEngine::class,
55+ 'host ' => env ('REDIS_HOST ' , '127.0.0.1 ' ),
56+ 'database ' => 4 ,
57+ 'prefix ' => 'sandbox_session_ ' ,
58+ 'duration ' => '+1 week ' ,
59+ ],
60+ ],
61+
5262 'Log ' => [
5363 'debug ' => [
5464 //'className' => 'File',
95105 ],
96106
97107 'Session ' => [
98- //'defaults' => 'database',
108+ 'defaults ' => 'cache ' ,
109+ 'handler ' => [
110+ 'config ' => 'session ' ,
111+ ],
99112 'timeout ' => 60000 ,
100113 'ini ' => [
101114 'session.cookie_lifetime ' => WEEK ,
Original file line number Diff line number Diff line change 3434
3535 # PHP handling via FrankenPHP in worker mode
3636 php_server {
37- worker /app/webroot/worker.php
37+ worker /app/webroot/worker.php 12
3838 }
3939}
Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ RUN install-php-extensions \
1515 pdo_mysql \
1616 zip \
1717 opcache \
18- gd
18+ gd \
19+ redis
1920
2021# PHP configuration
2122RUN echo "upload_max_filesize = 32M" >> /usr/local/etc/php/conf.d/uploads.ini \
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ services:
1818 - MERCURE_PUBLISHER_JWT_KEY=${MERCURE_PUBLISHER_JWT_KEY}
1919 - MERCURE_SUBSCRIBER_JWT_KEY=${MERCURE_SUBSCRIBER_JWT_KEY}
2020 - MERCURE_EXTRA_DIRECTIVES=anonymous
21+ - REDIS_HOST=host.docker.internal
22+ extra_hosts :
23+ - " host.docker.internal:host-gateway"
2124 security_opt :
2225 - no-new-privileges:true
2326 cap_add :
@@ -38,6 +41,9 @@ services:
3841 environment :
3942 - MERCURE_PUBLISHER_JWT_KEY=${MERCURE_PUBLISHER_JWT_KEY}
4043 - MERCURE_SUBSCRIBER_JWT_KEY=${MERCURE_SUBSCRIBER_JWT_KEY}
44+ - REDIS_HOST=host.docker.internal
45+ extra_hosts :
46+ - " host.docker.internal:host-gateway"
4147 security_opt :
4248 - no-new-privileges:true
4349
Original file line number Diff line number Diff line change 3030$ server = new Server ($ app );
3131
3232// Max requests before worker restarts (prevents memory leaks)
33- // Add jitter to prevent all workers restarting simultaneously (thundering herd)
33+ // Add wide jitter to prevent all workers restarting simultaneously (thundering herd)
3434$ maxRequests = (int )($ _SERVER ['MAX_REQUESTS ' ] ?? 500 );
35- $ maxRequests = random_int ((int )($ maxRequests * 0.8 ), (int )($ maxRequests * 1.2 ));
35+ $ maxRequests = random_int ((int )($ maxRequests * 0.5 ), (int )($ maxRequests * 1.5 ));
3636
3737// Handle requests in a loop
3838for ($ requestCount = 0 ; $ requestCount < $ maxRequests ; $ requestCount ++) {
You can’t perform that action at this time.
0 commit comments