-
2008-02-18
jfriar
Hi,
I was having a problem with deleting media files when mbstring was not enabled on my webserver. I would get various errors, most of which seemed to indicated a problem with utf8.php:
Fatal error: Maximum execution time of 30 seconds exceeded in
/etc/httpd/htdocs/dokuwiki/inc/utf8.php on line 740
Fatal error: Maximum execution time of 30 seconds exceeded in
/etc/httpd/htdocs/dokuwiki/inc/utf8.php on line 338
Fatal error: Maximum execution time of 30 seconds exceeded in
/etc/httpd/htdocs/dokuwiki/inc/utf8.php on line 581
And sometimes the media management window would simply be redrawn with some random dokuwiki markup (not necessarily from the page I edited to get into the media management window). Also, sometimes I would get two of those "Fatal error" messages at a time, and sometimes I would just get a single "Fatal error" message. The line numbers varied too.
When I enabled mbstring on this server, the problem stopped immediately, and I was able to delete media files. I did not try increasing the maximum execution time for php, as I don't think deleting a file should actually take 30 seconds on a lightly loaded server...
-
2008-02-23
ChrisS
Hi John,
Since the last DW release there have been several improvements in the utf8 library functions (replacements to be used when mbstring is not available). The changes affect utf8_strtolower which media_delete uses to parse the wiki for references to the deleted image. Is it possible for you to install a recent daily snapshot somewhere along with a copy of your wiki's data and test image deleting with the current code to see whether or not performance has improved?
---------------------
Andi,
media_delete() uses search with search_regex via search_reference and puts the whole wiki through utf8_strtolower followed by preg_match_all, which has to be time consuming and not very scalable for large wikis. Can the indexer/index be used to find the links as the "deprecated" note on search_regex indicates? If not there are probably a couple of improvements that could be made in search_regex, e.g. remove the "i" from the regex flag and ensure incoming match text is lower case, just like the data being searched.
-
2008-02-23
andi
I just changed this last bit of non-scaling code to use the fulltext index. Please test.
-
2008-02-23
andi
should be fixed now
-
2008-02-27
jfriar
I tried dokuwiki-latest.tgz from today, on a server without mbstring (we ended up adding mbstring to our main dokuwiki server), and now everything seems to work fine (I first tried deleting an image that was in use, and the media manager reported that the image was not deleted because it is still in use - then I removed the reference to that file, tried deleting again, and it deleted successfully).
Just FYI: here is our data directory space usage:
10M ./attic
22M ./cache
2.2M ./index
43K ./locks
688M ./media
5.1M ./meta
4.3M ./pages
and we have 1574 pages in the pages dir
Thanks!
-
Related tasks: