title: /tmp vs. /dev/shm for temp file storage on Linux?
body: <p>I have scripts that make hundreds of quick succession, small, temp files needing to be created and very soon read back in, then unlinked.</p>
  
  <p>My testing shows little if any performance difference by putting said files in <code>/tmp</code> (to disk) or into <code>/dev/shm</code> (filesystem-level shared memory) on Linux even under moderate load.  I attribute this to the filesystem cache.  </p>
  
  <p>Granted the disk will <em>eventually</em> get hit with the fileystem actions, but on multiple small write-read temp files, why would you (not) recommend <code>/dev/shm</code> over disk-backed directory?  Have you noticed big performance increases with shared memory directory over a cached VFS?</p>