My server has a large amount of memory. However, the amount of IO (each of which is small) is very high.Is there a way to make a virtual drive out of portion of the memory?I realize I can also use SSD, but those are expensive.I need both speed and size. So memory only won't work. Data not often accessed should be in hdisk.
Does Linux have ways to cache IO with memory
linux;memory
Use tmpfs. It is usually mounted at /dev/shm with the default size 1/2 of total RAM. The advantage is, that the memory is available for general usage by system, until you place something there (it is reserved on the fly). You might want to tweak the default setting a bit though - I personally have something like the following in /etc/fstab:tmpfs  /dev/shm  tmpfs  defaults,size=16m   0   0tmpfs  /free     tmpfs  defaults,size=66%   0   0This does two things:mounts rather small (16MB) tmpfs at /dev/shm/ for applications that might want to use it. The size is limited to prevent accidental waste of memory due to bugs.mounts tmpfs with size of 2/3 of available RAM at /free.Note that the filesystem block size is equal to memory page size - should you be using architecture with larger memory page size (e.g. PowerPCs or Itanium), even empty file will occupy whole page. This overhead can be reasonably reduced by creating a large file, formatting it with a regular filesystem with smaller blocks (e.g. XFS can use blocks as small as 512B), and loop-mounting it.As for SSD - they are orders of magnitude slower than RAM, will get cached anyway, and have limited number of erase cycles, so question is whether you want to use these in situations when you have enough RAM. And by the way, there even are hardware RAM drives.