ソースを参照

Limit php memory use

Bob Mottram 11 年 前
コミット
20476e7613
共有1 個のファイルを変更した25 個の追加11 個の削除を含む
  1. 25
    11
      beaglebone.txt

+ 25
- 11
beaglebone.txt ファイルの表示

@@ -2043,17 +2043,17 @@ emacs /etc/apache2/apache2.conf
2043 2043
 Search for MaxClients and replace the value with 6. As an example the settings should look something like this:
2044 2044
 
2045 2045
 #+BEGIN_SRC: bash
2046
-KeepAliveTimeout 2
2047
-Timeout 150
2046
+Timeout 30
2047
+KeepAlive On
2048
+MaxKeepAliveRequests 50
2049
+KeepAliveTimeout 10
2048 2050
 
2049 2051
 <IfModule mpm_prefork_module>
2050
-  StartServers           1
2051
-  MinSpareServers        1
2052
-  MaxSpareServers        5
2053
-  ServerLimit           16
2054
-  MaxClients             5
2055
-  MaxRequestsPerChild    0
2056
-  ListenBacklog        100
2052
+  StartServers          3
2053
+  MinSpareServers       2
2054
+  MaxSpareServers       5
2055
+  MaxClients            10
2056
+  MaxRequestsPerChild   1000
2057 2057
 </IfModule>
2058 2058
 
2059 2059
 <IfModule mpm_worker_module>
@@ -2062,7 +2062,7 @@ Timeout 150
2062 2062
     MaxSpareThreads      75
2063 2063
     ThreadLimit          64
2064 2064
     ThreadsPerChild      25
2065
-    MaxClients            5
2065
+    MaxClients           10
2066 2066
     MaxRequestsPerChild   0
2067 2067
 </IfModule>
2068 2068
 
@@ -2072,7 +2072,7 @@ Timeout 150
2072 2072
     MaxSpareThreads      75
2073 2073
     ThreadLimit          64
2074 2074
     ThreadsPerChild      25
2075
-    MaxClients            5
2075
+    MaxClients           10
2076 2076
     MaxRequestsPerChild   0
2077 2077
 </IfModule>
2078 2078
 #+END_SRC
@@ -2358,6 +2358,20 @@ Enter some trivial password for the key file, such as "password".  The password
2358 2358
 
2359 2359
 If all has gone well then there should be no warnings or errors after you run the service restart command.  After that you should enable ports 80 (HTTP) and 443 (HTTPS) on your internet router/firewall, such that they are redirected to the BBB.
2360 2360
 
2361
+Also limit the amount of memory which any php scripts can use.
2362
+
2363
+#+BEGIN_SRC: bash
2364
+emacs /etc/php5/apache2/php.ini
2365
+#+END_SRC
2366
+
2367
+Set the following:
2368
+
2369
+#+BEGIN_SRC: bash
2370
+memory_limit = 32M
2371
+#+END_SRC
2372
+
2373
+Save and exit.  Also edit */etc/php5/cli/php.ini* and set /memory_limit/ to the same value.  This should prevent any rogue scripts from crashing the system.
2374
+
2361 2375
 ** Accessing your Email
2362 2376
 
2363 2377
 #+BEGIN_VERSE