Hello, i think that MySQL is creating some temporary tables on the HDD and some in RAM. I would like to use ramdisk /dev/shm to hold temporary disk tables. How can i tell MySQL to save temporary data there? And is it safe if there is a power outage, it is temporary tale so it should not be big problem if its lost? Is there any tutorial on how to achieve this? Thx
If you mean temporary tables, you can make ramdisk something like: mkdir -p /var/mysqltmp chown mysql:mysql /var/mysqltmp mount -t tmpfs -o size=2g tmpfs /var/mysqltmp don't forget to add it to fstab tmpfs /var/mysqltmp tmpfs nodev,nosuid,noexec,nodiratime,size=2g 0 0 and add it to mysql: nano /etc/my.cnf tmpdir = /var/mysqltmp service mysql restart
Thx i think it works. The folder is empty when i check it, but its modiffication times changing and it is locked by mysql process. (lsof /tmp/mysqltmp) I set 6GB size and location in /tmp, not sure what should be proper size and what happen if size is too small for MySQL. PS: iotop -ao command shows mysql processes generating IO, hopefully this is related to that ram based partition not to real HDD.