Hi all!
I'm asking for help with our adorable doku installation. It occasionally stucks. Always in the one function: io_saveFile, here is the code part with logging embedded by me:
function io_saveFile($file,$content,$append=false){
global $conf;
global $LoggerFilename;
file_put_contents($LoggerFilename,date('Y.m.d H:i:s ', time())." io io_saveFile start $file \n",FILE_APPEND) ;
$mode = ($append) ? 'ab' : 'wb';
$fileexists = @file_exists($file);
io_makeFileDir($file);
io_lock($file);
file_put_contents($LoggerFilename,date('Y.m.d H:i:s ', time())." io io_saveFile after io_lock \n",FILE_APPEND) ;
if(substr($file,-3) == '.gz'){
file_put_contents($LoggerFilename,date('Y.m.d H:i:s ', time())." io io_saveFile gz block file=$file mode=$mode \n",FILE_APPEND) ;
$fh = @gzopen($file,$mode.'9');
file_put_contents($LoggerFilename,date('Y.m.d H:i:s ', time())." io io_saveFile gz block after gzopen \n",FILE_APPEND) ;
[/color]
When doku stucks you can see always the same in the log:
2012.08.09 18:58:46 io io_saveFile start C:/Sites/sitrowiki/data/attic/pagename.1344524326.txt.gz
2012.08.09 18:58:46 io io_saveFile after io_lock
2012.08.09 18:58:46 io io_saveFile gz block file=C:/Sites/sitrowiki/data/attic/pagename.1344524326.txt.gz mode=wb
[/color]
It stops to respond in
$fh = @gzopen($file,$mode.'9');.
It don't stop "every N days" or any other period. Can freeze few times in a one day or in an hour, sometimes can work perfectly for a few weeks. Apache restart helps.
Release 2012-01-25 "Angua". Win2k3. Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.2.
There is nothing but wiki on the server. No suspicious activity. There is nothing in Apache access-logs after freezing moment and no errors in any log.
This doku helds 2000-2500 page opening queries per day and have a lot of plugins installed.