MySQL – Handling Queries Larger Than tmpfs (RAM Disk)

memoryMySQL

I recently set up a ramdisk tmpfs on our mysql server and the performance improvement has been quite noticeable. I've allocated 24 out of 32 GB's of ram for the ramdisk. My only concern is what happens when there's a terrible query that ends up requiring more space than the allocated tmpfs? I've read in a few places that it depends on the type of query but wanted to confirm that in some instances such a query can effectively shut down mysql.

Best Answer

Temp is used to store temporary on-disk tables for queries which go over the in-memory tmp tables limit. When MySQL needs to insert to a table and there is not enough space, the query stops - You get disk-full warning and you can either free some space or kill the offending query.

In your case one runaway query would probably stop all queries using on-disk temporary tables.