I am using TinyMCE with IMCE plugin. When I launch the IMCE directory from TinyMCE to import it takes a very long time and then I occasionally get this error:

Warning: MySQL server has gone away query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (1, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:103:\"Lost connection to MySQL server during query\nquery: SELECT * FROM system WHERE type = 'theme'\";s:5:\"%file\";s:67:\"/nfs/c02/h06/mnt/39552/domains/sample.com/html/includes/theme.inc\";s:5:\"%line\";i:429;}', 3, '', 'http://www.sample.com/?q=imce&app=TinyMCE|url@src', 'http://www.sample.com/sites/all/modules/tinymce/tinymce/jscripts/tiny_mc...', '76.87.91.201', 1237131859) in /nfs/c02/h06/mnt/39552/domains/sample.com/html/includes/database.mysqli.inc on line 128

Basically, my thought is that maybe there are too many images in my directory that it has to load. Right now that directory currently has 450 MB of images. In addition, the directory shows small thumbnails for each thumbnail version of the image. This has to take a fair amount of time to load as well. Any thoughts on how to optimize this? Or what the best practices are in this scenario? Help would be greatly appreciated.

Comments

ufku’s picture

Did you check mysql doc? http://dev.mysql.com/doc/refman/5.0/en/gone-away.html
or http://drupal.org/node/227445#comment-770663

For thumbnail previews, you can disable the functionality in tpl/imce-content.tpl.php file by commenting the line that starts with imce.hooks.list.push(imce.thumbRow)....

superflyman’s picture

Thanks ukfu. I will disable thumbnails and see if that helps. Off hand, do you know what a reasonable limit is for image directory size? I think it will balloon to several gigs in the next few months. How do large production sites handle this?

ufku’s picture

The time to read the contents of a directory increases with the increasing number of files in it. It will probably take longer to read a directory having 100 files of 1Mb than reading a directory having 1 file of 1Gb.
You should find a way to organize images in multiple directories. Many people use IMCE for this purpose as it allows personal directories. However, in your case IMCE is not the main uploader.

ufku’s picture

Status: Active » Closed (fixed)

Closing 6.x-1.x issues as this branch is no more supported.