Using RAM for MySQL's tmpdir

Minimal Artica version: 1.6.080715
If you are currently running MySQL and don't have /tmp on a tmpfs, you're getting burned and performance will be extremely poor.
In MySQL, the tmpdir path is mainly used for disk-based sorts (if the sort_buffer_size is not enough) and disk-based temp tables.
The latter cannot always be avoided even if you made tmp_table_size and max_heap_table_size quite large, since MEMORY tables don’t support TEXT/BLOB type columns, and also since you just really don’t want to run the risk of exceeding available memory by setting these things too large.

You can see how your server is doing with temporary tables, how many of those become disk tables, and also other created temporary files, by looking at SHOW GLOBAL STATUS LIKE ‘Created_tmp%’;

  • Under the MySQL section, click on Temp directory and Temp in memory icon

07-08-2012_14-59-15.png

  • In the Directory field, set the path that will be used by the MySQL service.
  • If you want to make the working directory in memory, define a size in M.
    You will see a progress bar that show the % used and the mounted size in memory.

07-08-2012_15-22-18.png

Note: If you set /tmp as the working directory, the memory feature will be disabled.
You cannot set a memory under 2MB
After apply this form, the MySQL service will be restarted.