CentOS view CPU, disk, memory usage, and how to clean up memory

Source: Internet
Author: User
Tags memory usage cpu usage

The system in the long run, the available memory will gradually become less, if there is no mechanism to do monitoring and regularly clean up the characters, the server will have a lot of hidden dangers, the following operations to manually check and clean up: Check the basic situation of the server to see memory usage

    Free-m
View CPU Usage
    Top #查看进程运行情况
View disk and partition conditions
    
View network conditions
    Ifconfig
View Port Usage
    #1. Method One
    lsof-i: port number

    #2. Method two
    netstat-apn|grep port number
Server Troubleshooting and optimization Cleaning up Memory
    #1. "Recommended" release of the Web cache (to-free pagecache),
    sync
    echo 1 >/proc/sys/vm/drop_caches

    #2. Release directory entries and indexes (to free Dentries and Inodes)
    sync
    echo 2 >/proc/sys/vm/drop_caches
    #3. Free Web page caching, directory entries, and indexes (to $ pagecache, Dentries and Inodes):
    sync
    echo 3 >/proc/sys/vm/drop_caches

Select the appropriate way to clean up, and then perform a view of memory, you can see that memory has a lot of free space;

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.