Skip to content

Commit a625fe4

Browse files
committed
Increase PHP memory limit
Currently, some users of permanent have folders large enough that retrieving all their contents via the API causes PHP to run out of memory. The correct way to fix this is to paginate those API calls, but as a hotfix, this commit increases the memory limit so users will still be able to access their files. Since this commit adds a patch for the php.ini config file, it also includes the update to gc_maxlifetime that we've historically made manually on every deploy.
1 parent 77b4fd6 commit a625fe4

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

provisioners/configure.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ a2enconf \
155155
## Make sure to also review this patch when updating the PHP version, as the
156156
## line numbers / hunk contents could shift between config versions.
157157
patch -d /etc/php/8.3/fpm/pool.d < $TEMPLATES_PATH/etc/php/8.3/fpm/pool.d/www.conf.patch
158+
patch /etc/php/8.3/fpm/php.ini < $TEMPLATES_PATH/etc/php/8.3/fpm/php.ini/php.patch
158159
systemctl restart php8.3-fpm.service
160+
systemctl restart apache2.service
159161

160162
echo "Configure Upload Service"
161163
envsubst \
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@@@ Extend timeouts and memory limits
2+
--- php.ini
3+
+++ php.ini
4+
@@ -442,7 +442,7 @@
5+
6+
; Maximum amount of memory a script may consume
7+
; https://php.net/memory-limit
8+
-memory_limit = 128M
9+
+memory_limit = 1024M
10+
11+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12+
; Error handling and logging ;
13+
@@ -1468,7 +1468,7 @@
14+
; After this number of seconds, stored data will be seen as 'garbage' and
15+
; cleaned up by the garbage collection process.
16+
; https://php.net/session.gc-maxlifetime
17+
-session.gc_maxlifetime = 1440
18+
+session.gc_maxlifetime = 2592000
19+
20+
; NOTE: If you are using the subdirectory option for storing session files
21+
; (see session.save_path above), then garbage collection does *not*

0 commit comments

Comments
 (0)