TMPFS file system under Linux (/DEV/SHM)

Source: Internet
Author: User
Tags php session

Introduced

/dev/shm/ is a use that isTmpfs File system device, is actually a special file system. RedhatThe default size is half of physical memory,Make time unavailableMKFSformatted.

Tmpfs is a memory-based Linux/unix system. Virtualfile System. TMPFS can use your memory or swap partition to store files (that is, its storage space isVirtual Memoryin, the VMbyReal Memoryand theSwapcomposition). Thus, TMPFS primarily stores staged files. It has the following 2 advantages: 1. The size of the dynamic file system. 2. TmpfsUseVMSbuilt file system, speed of course fast. 3.data loss after reboot.

When you deleteTmpfswhen the file in, Tmpfswill dynamically reduce the file system and releaseVMSResources ,LINUX The temporary files of some programs can be placed in theTmpfs, the use ofTmpfs features faster than hard drive to improve system performance . In practice, setting this file system for the specific needs of your application can improve application read-write performance, such as SquidThe cache directory is placed in the/ tmp, PHP sessionfiles are placed in/ tmp, Socketfiles are placed in/ tmp,or use/ tmpas a cache device for other applications

Temporarily modify the/DEV/SHM size

#mount-o size=1500m-o nr_inodes=1000000-o noatime,nodiratime-o remount/dev/shm

mount-t tmpfs-o size=20m tmpfs/tmp temporary mount using

Boot-enabled configuration

can be in /etc/fstab  

Tmpfs /dev/shm tmpfs,defaults,size=512m 0 0

Tmpfs                   /TMP&NBSP,                          tmpfs defaults, size=25m             0 0

modified after execution Mount-o Remoount/dev/shm after the effective

mkdir/dev/shm/tmp (/dev/shm/ /tmp binding then/ tmp uses the tmpfs file system )

chmod 1777/dev/shm/tmp

Mount--bind/dev/shm/tmp/tmp

Reference

Understanding and use of/dev/shm under Linux directory

Welcome everyone to visit my personal website Meng Meng's IT People

TMPFS file system under Linux (/DEV/SHM)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.