View/modify of cache under Linux

Source: Internet
Author: User

Cause:

Memory is not large enough during the installation of OpenStack, and memory is typically set to twice times the amount of memory when it is raised.

The essence of the cache is that the hard disk opens up a space and then sets this space for caching.

View Cache Size

Free-m

Free-m        Total used        free      shared  buff/cache   availablemem:           4799         594        3968           8         235        3981Swap:          3583           0        3583

Find the appropriate hard disk space settings cache: Df-h

Df-hfilesystem               Size  used Avail use% mounted on/dev/mapper/centos-root   50G  2.7G   48G   6%/ Devtmpfs                 2.4G     0  2.4G   0%/devtmpfs                    2.4G  4.0K  2.4G   1%/dev/shmtmpfs                    2.4G  8.4M  2.4G   1%/runtmpfs                    2.4G     0  2.4G   0%/sys/fs/cgroup/dev/loop0               1.9G  6.1M  1.7G   1%/srv/node/swiftloopback/dev/mapper/centos-home   26G   33M   26G   1%/ HOME/DEV/SDA1                497M  210M  288M  43%/boottmpfs                    480M     0  480M   0%/run/user/0

/dev/mapper/centos-root this space in my computer is ample.

Partition cache space: DD command

DD if=/dev/mapper/centos-root of=/home/swap1 bs=1024 count=1048576 4194304+0 Records in4194304+0 Records out4294967296 bytes (4.3 GB) copied, 14.6148 S, 294 mb/sdd If=/dev/zero of=/home/swap bs=1024 count=1048576

  

Set to Cache

Mkswap/home/swap1

Enable caching

SWAPON/HOME/SWAP1 View the cache information again:
Free-m        Total used        free      shared  buff/cache   availablemem:           4799        2411           8        2207        2111Swap:          7684           1        7683

  

Boot up

Set to boot

Vi/etc/fstab Add the following command to the last line:/home/swap1 swap default 0 0

View/modify of cache under Linux

Related Article

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.