Apache crashes due to PHP out of memory error
I am running Moodle 1.9.2 on Intel xeon 5355 2.66 GHZ Dell server with 16 GB of memory in a single school with at mostly hundred students using Moodle at the same time. Moodle website has about 12000 students and with 700 courses of which 7000 active students and 300 active courses.
php.ini is configured:
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;
max_execution_time = 120 ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
memory_limit = 512M ; Maximum amount of memory a script may consume (16MB)
The underlying server architecture
Consisting of Apache 2.2.3, PHP 5.2.3.3, and MySQL (5.0.45) with APC installed
Apache's error.log contains the following entry
Thu May 14 14:41:15 2009] [error] [client 172.19.101.74] PHP Fatal error: Out of memory (allocated 6029312) (tried to allocate 58752 bytes) in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\moodle\\lib\\accesslib.php on line 129, referer: http://moodle.cwc.ac.uk/moodle/login/index.php
[Thu May 14 14:41:17 2009] [error] [client 82.11.3.224] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico
[Thu May 14 14:41:20 2009] [error] [client 82.11.3.224] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico
[Thu May 14 14:44:37 2009] [error] [client 82.1.153.63] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico
[Thu May 14 14:46:11 2009] [notice] Parent: Received restart signal -- Restarting the server.
[Thu May 14 14:46:11 2009] [notice] Child 1392: Exit event signaled. Child process is ending.
[Thu May 14 14:46:12 2009] [notice] Child 1392: Released the start mutex
[Thu May 14 14:46:13 2009] [notice] Child 1392: Waiting for 250 worker threads to exit.
[Thu May 14 14:46:13 2009] [notice] Child 1392: All worker threads have exited.
[Thu May 14 14:46:13 2009] [notice] Child 1392: Child process is exiting
[Thu May 14 14:46:15 2009] [notice] Apache/2.2.4 (Win32) PHP/5.2.3 mod_auth_sspi/1.0.4 configured -- resuming normal operations
[Thu May 14 14:46:15 2009] [notice] Server built: Jan 9 2007 23:17:20
[Thu May 14 14:46:15 2009] [notice] Parent: Created child process 4228
[Thu May 14 14:46:15 2009] [notice] Child 4228: Child process is running
[Thu May 14 14:46:15 2009] [notice] Child 4228: Acquired the start mutex.
[Thu May 14 14:46:15 2009] [notice] Child 4228: Starting 250 worker threads.
[Thu May 14 14:46:15 2009] [notice] Child 4228: Starting thread to listen on port 80.
but even with APC installed is crashing, is there any way to configure Apache and PHP to avoid the crashes??
Thanks in advance for your help.