How to Use tmpfs to accelerate your linux Server-Linux Enterprise Application-Linux server application information is as follows. Using tmpfs, I digested it and used it to store squid cache files and php seesion on a virtual disk. Fast!
By default, the system will load/dev/shm, which is called tmpfs. Some people say it is different from ramdisk (Virtual Disk. Like a virtual disk, tmpfs can use your RAM, but it can also use your swap partition for storage. In addition, a traditional virtual disk is a block device and requires commands such as mkfs to actually use it. tmpfs is a file system, not a block device. You only need to install it, it can be used.
Tmpfs has the following advantages:
1. Size of the dynamic file system,
2. Another major benefit of tmpfs is its lightning speed. Because the typical tmpfs file system will completely reside in RAM, reading and writing can be almost instantaneous.
3. tmpfs data will not be retained after restart, because the virtual memory is essentially easy to lose. Therefore, it is necessary to execute some scripts such as loading and binding.
Well, I have explained some things and I am tired of reading them. Let's talk about my applications :)
Create a tmp folder in/dev/stm and bind it to the actual/tmp folder.
CODE: mkdir/dev/shm/tmp
Chmod 1777/dev/shm/tmp
Mount -- bind/dev/shm/tmp |