-
Bug
-
Resolution: Fixed
-
Blocker
-
None
-
2.0.2
-
Windows Server 2003 Standard Edition (Build 3790: Service Pack 2)
Intel Xeon CPU 5120 @ 1.86GHz 512MB RAM
IIS 6.0.3790.4735 (C:\WINDOWS\system32\inetsrv\asp.dll)
Microsoft SQL Server 2005 - 9.00.4053.00 (Intel X86) Standard Edition
PHP 5.3.3 NTS VC9
FastCGI Handler x86 6.1.36.1
Microsoft SQL Server Driver for PHP 2.0.1802.200
Microsoft Windows Cache Extension for PHP 1.1.630.0
PHP date.timezone = "Africa/Johannesburg"
Moodle config:
$CFG->dbtype = 'sqlsrv';
$CFG->dblibrary = 'native';
Number of users on Moodle: 10000
Courses on the site: 150Windows Server 2003 Standard Edition (Build 3790: Service Pack 2) Intel Xeon CPU 5120 @ 1.86GHz 512MB RAM IIS 6.0.3790.4735 (C:\WINDOWS\system32\inetsrv\asp.dll) Microsoft SQL Server 2005 - 9.00.4053.00 (Intel X86) Standard Edition PHP 5.3.3 NTS VC9 FastCGI Handler x86 6.1.36.1 Microsoft SQL Server Driver for PHP 2.0.1802.200 Microsoft Windows Cache Extension for PHP 1.1.630.0 PHP date.timezone = "Africa/Johannesburg" Moodle config: $CFG->dbtype = 'sqlsrv'; $CFG->dblibrary = 'native'; Number of users on Moodle: 10000 Courses on the site: 150
-
Microsoft SQL
-
MOODLE_20_STABLE
I'm running into a timeout problem when I upgrade a Moodle 1.9.10+ site to Moodle 2.0.2+ (Build: 20110221). The site is running under IIS 6 on Windows Server 2003 and MSSQL 2005. I started the Moodle upgrade and everything seemed to go ok. Then after about 25 minutes the Moodle upgrade screen displayed a message saying "Migrated course files" and "Migrated user icons". Each showed 100% as the result. Then the upgrade seemed to halt with no other messages.
After about an hour I looked in the PHP Error log file (I've configured php.ini to write all errors to a log file: error_log = "C:\PHP\PHPErrors.log") and I saw the following error:
[23-Feb-2011 07:50:11] PHP Fatal error: Maximum execution time of 300 seconds exceeded in D:\Moodle\lib\dml\sqlsrv_native_moodle_database.php on line 356
Some research indicated that this is a PHP timeout problem so I increased the following PHP configuration settings to very high values:
max_execution_time = 1800
max_input_time = 1800
session.gc_maxlifetime = 1800
I also increased the following FastCGI configuration settings to very high values:
ActivityTimeout=1800
RequestTimeout=1800
IdleTimeout=1800
Then I edited the IIS metabase and increased the IIS CGITimeout value to a high value: CGITimeout="1800"
After restarting the web server and restoring my 1.9.10 site I tried to run the Moodle 2.0.2+ upgrade again. Once again I got the "Maximum execution time of 300 seconds exceeded in D:\Moodle\lib\dml\sqlsrv_native_moodle_database.php on line 356" error.
Despite making all the above PHP and IIS configuration changes the upgrade still crashing after 300 seconds. All the googling that I was able to do indicated that this timeout can be adjusted by increasing the PHP max_execution_time and max_input_time values, but this obviously hasn't worked for me.
Line 356 in \lib\dml\sqlsrv_native_moodle_database.php contains the do_query() function with:
$result = sqlsrv_query($this->sqlsrv, $sql);
So, it looks like sqlsrv_query() is taking too long to complete and IIS (or PHP??) is timing out after 300 seconds instead of obeying the new ActivityTimeout and RequestTimeout PHP values that I've set.
Is there someway that I can alter the do_query() function so that it can "ping" the web server to let it know that the script is still running and thus prevent the timeout?
- has been marked as being related by
-
MDL-27251 add optional timeout estimation to file_storage.php download_file_content() based on header with file size as it reportedly blocks upgrade.
-
- Closed
-
-
MDL-30942 2.x upgrade times out when ALTER large tables, add more upgrade_set_timeout() or better dynamic estimate
-
- Closed
-