How to enable /dev/shm RAM disk for MySQL? (temp dir in /dev/shm)

$ vi /etc/fstab
tmpfs /dev/shm tmpfs defaults,size=512m 0 0

$ mount -o remount /dev/shm

Is this correct? Now what?

......

......

......

Server info:

VPS (Xen)
1.5GB RAM
link|improve this question
I think I should have posted this at ServerFault.com.... – Randomprogrammer Jul 20 '11 at 11:02
Creating ramdisks will only starve the server of memory - every byte you allocate to a ramdisk is one byte less for cacheing/buffering and executing code. How about boosting mysql's cache/buffer sizes instead? – Marc B Jul 20 '11 at 15:09
What do you want to do when your VPS is rebooted, and you've lost all your tables ? Maybe you can rather add suitable indexes to speed things up. – nos Jul 20 '11 at 18:39
themattreid.com/wordpress/2011/04/04/… --- Question closed. – Randomprogrammer Jul 25 '11 at 16:51
feedback

migrated from stackoverflow.com Jul 26 '11 at 1:59

This question came from our site for professional and enthusiast programmers.

2 Answers

The first rule of optimisation is: Don't assume.

Don't assume that you will automatically get better performance by putting (any) files on a ramdisc. Also consider how you are hoping to persist data following the (inevitable) power failure.

In general, SQL is slow because you are using it wrong, so it is an application design fault. The fix is to (re-)design your application correctly.

link|improve this answer
I didn't wrote that app. – Randomprogrammer Jul 25 '11 at 16:28
feedback

Just use MEMORY storage engine.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown