Hello, I am running Drupal on a server with a very slow disk. I have tried to do a lot of optimizations but I still have roughly 50% of the queries creating on disk temporary tables even though I have increased the max_heap_table_size and tmp_table_size to 64M.
The server is very busy and will lock up when too many temporary tables are being created at the same time.
In a podcast about MySQL optimization I heard that drupal.org was set up to use a ram disk for its tmpdir but I didn't find much documentation on this.
I did an experiment to create a RAM disk and change the the tmpdir to this RAM disk. I however ran into two problems loading my drupal site.
When I would surf to the main page of my site some items would be ok for example the theme and the side bars but the main content would revert to the "Welcome to drupal screen". If I would try to login to the site I could not login it didn't seem to find my user record, yet the theme of the web site was in tact.
Or if sometimes I would navigate to my site and the main content would be there but the side bars would disappear. All the blocks would be gone on the left and right side.
So even thought I was able to successfully get a RAM disk mounted and change the path it does not work properly. This is on a Mac Mini running Mac OS X. In the Finder I can view the RAM disk window and see files being created and deleted. There was no error in the mysql log to give some hint on this. Due to past performance problems I am running a mix of innodb and myisam tables.
I have a external USB disk hooked up to this server for backup and I tried using it as the temp folder as well and ran into similar problems. This behavior of blocks disappearing or content disappearing seems to be random.
Please let me know if you have any suggestions on what to do.
Comments
Solution found
I found a solution to this RAM Disk problem under Mac OS X. I had to put the ram disk instead the tmp directory. I'm not sure why.
1. hdiutil attach -nomount ram://65536
2. newfs_hfs -v ramdisk /dev/disk2
3. mount_hfs -u _mysql -g _mysql -w -m 777 /dev/disk2 /var/tmp/ramdisk
4. Change tmpdir to /var/tmp/ramdisk in /opt/local/etc/my.cnf
5. Restart mysql: sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql5.plist
6. sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
7. Restart Apache: apache2ctl restart
If I restart the server I have to recreate the ram disk I didn't figure out how to automate this yet.
RAM disk setup
This is discussed here:
http://drupal.org/node/901408
-Kristen
Profile: https://www.linkedin.com/in/kristenpol
Drupal 7 Multilingual Sites: http://kristen.org/book