How to Check Memory Usage in Linux based Server Làm thế nào để Kiểm tra sử dụng bộ nhớ trong Linux trên máy chủ

Memory is one of the most critical resource components on a server to ensure that the smooth and fast operation. Bộ nhớ là một trong những thành phần nguồn lực quan trọng nhất trên một máy chủ để đảm bảo sự vận hành trơn tru và nhanh chóng. Thus, the availability of adequate and abundant physical memory size is vital especially for any server, especially high load web host that are also running database server such as Oracle or MySQL, which is famous for memory intensive. Do đó, sự sẵn có của kích thước đầy đủ và phong phú, bộ nhớ vật lý là rất quan trọng đặc biệt đối với bất kỳ máy chủ, đặc biệt là cao tải web host đó cũng chạy máy chủ cơ sở dữ liệu như Oracle hay MySQL, trong đó nổi tiếng với bộ nhớ chuyên sâu. Linux, including CentOS which is popular on cPanel and Plesk web hosting server, comes with several commands and tools to check memory usage on server. Linux, bao gồm cả CentOS được phổ biến trên cPanel Plesk, web hosting server, đi kèm với một số lệnh và các công cụ để kiểm tra sử dụng bộ nhớ trên máy chủ.

free rảnh rỗi

free command displays amount of total, free and used physical memory (RAM) in the system, as well as shoing information on shared memory, buffers, cached memory and swap space used by the Linux kernel. Việt lệnh hiển thị số tiền tổng cộng, miễn phí và được sử dụng bộ nhớ vật lý (RAM) trong hệ thống, cũng như shoing thông tin trên bộ nhớ chia sẻ, bộ đệm, bộ nhớ cache và không gian trao đổi được sử dụng bởi hạt nhân Linux.

Syntax of free Cú pháp của Việt

free -[options] Việt - [tuỳ chọn]

Example usage of free Ví dụ sử dụng miễn phí

free -m Việt-m

The command will display information about physical memory in MB. Lệnh này sẽ hiển thị thông tin về bộ nhớ vật lý trong MB.

free -m -s 5 Việt-m-s 5

The command will activate continuous polling delay at 5 seconds apart, and then display memory status in megabytes on terminal. Lệnh này sẽ kích hoạt chậm trễ liên tục bỏ phiếu tại 5 giây ngoài, và sau đó sẽ hiển thị tình trạng bộ nhớ trong megabyte trên thiết bị đầu cuối. Any floating point number for delay can be specified. Bất cứ số điểm nổi cho sự chậm trễ có thể được chỉ định.

free -t -m Việt-t-m

Same with “free -m”, but -t switch will display a line containing the totals of physical memory and swap space. Cùng với "Việt-m", nhưng-t chuyển đổi sẽ hiển thị một dòng chứa tổng số bộ nhớ vật lý và không gian trao đổi.

vmstat vmstat

vmstat reports report virtual memory statistics, which has information about processes, swap, free, buffer and cache memory, paging space, disk IO activity, traps, interrupts, context switches and CPU activity. báo cáo vmstat báo cáo thống kê bộ nhớ ảo, trong đó có thông tin về quy trình, trao đổi, miễn phí, đệm và bộ nhớ cache, không gian phân trang, hoạt động của IO đĩa, bẫy, ngắt, chuyển mạch bối cảnh và hoạt động CPU. With vmstat command, administrators can has instantaneous reports on memory usage. Với lệnh vmstat, các quản trị viên có thể có báo cáo tức thời về sử dụng bộ nhớ.

Syntax of vmstat Cú pháp của vmstat

vmstat -[options] [delay count] vmstat - [tuỳ chọn] [chậm trễ tính]

Example usage of vmstat Ví dụ sử dụng vmstat

vmstat vmstat

The command will display report based on averages since last reboot. Lệnh hiển thị sẽ báo cáo dựa trên trung bình kể từ khi khởi động lại cuối cùng.

vmstat 5 vmstat 5

The command will pool average system resources usage level for a sampling period of 5 seconds at interval of 5 seconds, except the first result that is averages since the last reboot. Lệnh này sẽ bơi trung bình hệ thống tài nguyên mức độ sử dụng trong một thời gian lấy mẫu của 5 giây ở khoảng thời của 5 giây, ngoại trừ các kết quả đầu tiên mà là trung bình kể từ khi khởi động lại cuối cùng.

top đỉnh

top command displays dynamic real-time view of the running tasks managed by kernel and system information in Linux system. hiển thị các lệnh đầu trang năng động thời gian thực xem những nhiệm vụ hoạt động quản lý hạt nhân và hệ thống thông tin trong các hệ thống Linux. The memory usage stats by top command include real-time live total, used and free physical memory and swap memory with their buffers and cached memory size respectively. Các số liệu thống kê bộ nhớ sử dụng bởi lệnh đầu bao gồm thời gian thực tổng số sinh sống, sử dụng và bộ nhớ vật lý miễn phí và trao đổi với bộ nhớ đệm của mình và kích thước bộ nhớ cache tương ứng.

Syntax and example usage of top Cú pháp và cách sử dụng ví dụ về đầu trang

top đỉnh

Using top is simple, simply type top at command shell, and constantly update stats page will be shown. Sử dụng hàng đầu là đơn giản, lúc đầu chỉ đơn giản là loại vỏ lệnh, và liên tục cập nhật các số liệu thống kê trang sẽ được hiển thị.

ps aux ps aux

ps command reports a snapshot on information of the current active processes. ps lệnh báo cáo một bản chụp trên thông tin của các quá trình hoạt động hiện hành. Advantage of ps command is that system admins will be able to see where the memory is used. Lợi thế của ps lệnh là quản trị viên hệ thống sẽ có thể nhìn thấy nơi mà bộ nhớ được sử dụng. ps will show the percentage of memory resource that is used by each process or task running in the system. ps sẽ hiển thị tỷ lệ phần trăm của tài nguyên bộ nhớ được sử dụng bởi mỗi quá trình hay tác vụ đang chạy trong hệ thống. With this command, top memory hogging processes can be identified. Với lệnh này, đầu quá trình hogging bộ nhớ có thể được xác định.

Syntax and example of ps aux Cú pháp và ví dụ của aux ps

aux is actually already the options for ps command to see every process on the system. aux là thực sự đã có các tùy chọn cho ps lệnh để xem tất cả các quá trình trên hệ thống. So the typical command to type the following in the command shell: Vì vậy, các điển hình để gõ lệnh sau đây trong vỏ lệnh:

ps aux

To see only the memory resources occupied by each category of processes, such as Apache httpd, MySQL mysqld or Java, use the following command: Để chỉ xem các nguồn tài nguyên bộ nhớ chiếm bởi mỗi thể loại của các quá trình, như là Apache httpd, MySQL mysqld hoặc Java, sử dụng lệnh sau đây:

ps aux | awk '{print $4"\t"$11}' | sort | uniq -c | awk '{print $2" "$1" "$3}' | sort -nr

The all mentioned ways of check memory usage should works on most Unix and Linux variant of operating systems. Tất cả được đề cập cách sử dụng bộ nhớ nên kiểm tra các công trình trên hầu hết các Unix và Linux phiên bản của hệ điều hành. However, if you're running a VPS (Virtual Private Server) or VDS (Virtual Dedicated Server) or Hybrid Server, especially those powered by Virtuozzo or OpenVZ, the above commands will retrieve data from the host machine, ie the entire server the virtual environment is running on. Tuy nhiên, nếu bạn đang chạy một VPS (Virtual Private Server) hoặc VDS (Virtual Dedicated Server) hoặc Hybrid Server, đặc biệt là những hỗ trợ bởi Virtuozzo hoặc OpenVZ, các lệnh trên sẽ lấy dữ liệu từ máy chủ, nghĩa là toàn bộ các máy chủ ảo môi trường đang chạy trên. In these virtualization system, the memory usage info has to be calculated from control panel or /proc/user_beancounters file. Trong các hệ thống ảo hóa, các thông tin sử dụng bộ nhớ đã được tính toán từ bảng điều khiển hoặc / proc / user_beancounters tập tin.

IMPORTANT : The page is machine translated and provided "as is" without warranty. Quan trọng: Sửa là máy dịch và cung cấp "như là" không có bảo hành. Machine translation may be difficult to understand. Máy dịch thuật có thể khó hiểu. Please refer to Vui lòng tham khảo original English article bản gốc tiếng Anh bài viết whenever possible. bất cứ khi nào có thể.


3 Responses to “How to Check Memory Usage in Linux based Server” 3 Responses to "Làm thế nào để Kiểm tra sử dụng bộ nhớ trong Linux dựa trên máy chủ"

  1. nanaz nanaz
    September 1st, 2009 12:19 Ngày 1 tháng 9 năm 2009 12:19
    3 3

    what about PR NI S?? những gì về PR NI S?? is there any GUI for this command. là có bất kỳ giao diện cho lệnh này. I use Ubuntu Linux 9.04. Tôi sử dụng Ubuntu Linux 9,04. thanks cảm ơn

  2. anonymous vô danh
    February 23rd, 2009 21:50 23 tháng 2 năm 2009 21:50
    2 2

    annoying javascript! gây phiền nhiễu javascript!
    pgup moves you to bottom of page. PgUp di chuyển bạn đến cuối trang. can't navigate không thể điều hướng

  3. Artem S. Tashkinov Artem S. Tashkinov
    September 24th, 2007 15:20 24 Tháng Chín 2007 15:20
    1 1

    When you are running top there are three fields related to memory usage. Khi bạn đang chạy trên cùng có ba lĩnh vực liên quan đến sử dụng bộ nhớ. In order to assay your server memory requirements you have to understand their meaning. Để khảo nghiệm các yêu cầu bộ nhớ máy chủ của bạn, bạn phải hiểu ý nghĩa của chúng.

    The first thing you have to know is that all the columns (VIRT RES SHR) report memory usage in KB (kilobytes). Việc đầu tiên bạn phải biết được rằng tất cả các cột (VIRT RES SHR) báo cáo sử dụng bộ nhớ trong KB (kilobyte).

    VIRT column (virtual memory size of the process) means how much memory a particular application has requested, also it counts swapped to the disk memory pages. VIRT cột (kích thước bộ nhớ ảo của quá trình này) có nghĩa là bộ nhớ bao nhiêu một ứng dụng cụ thể đã yêu cầu, nó cũng có số lần đổi chỗ những trang bộ nhớ đĩa. But this field does NOT mean that this process actually uses that amount of memory, to use it for real this memory has to be initiated for example using memset. Nhưng lĩnh vực này KHÔNG có nghĩa là quá trình này thực sự sử dụng số tiền đó bộ nhớ, sử dụng nó cho bộ nhớ thực tế này phải được khởi xướng ví dụ bằng cách sử dụng memset. Generally speaking you can disregard this column. Nói chung, bạn có thể bỏ qua cột này.

    RES column (resident set size, the non-swapped physical memory that a task has used (in kiloBytes)) is the most important one – it actually shows how much physical RAM is allocated for a process. RES cột (trú đặt kích thước, những người không phải đổi chỗ bộ nhớ vật lý là một nhiệm vụ đã được sử dụng (bằng kilobytes)) là một trong những quan trọng nhất - nó thật sự cho thấy có bao nhiêu RAM vật lý được phân bổ cho một quá trình.

    SHR column says how much memory a particular application is sharing with other applications. SHR cột nói bao nhiêu bộ nhớ một ứng dụng cụ thể được chia sẻ với các ứng dụng khác. Eg, most applications in Linux depend on libc, and as every application links with it and uses its functions then this library memory space is mapped to all process simultaneously to conserve memory. Ví dụ, hầu hết các ứng dụng trong Linux phụ thuộc vào LIBC, và như mọi ứng dụng liên kết với nó và sử dụng các chức năng của nó thì không gian thư viện này là bộ nhớ được ánh xạ để xử lý tất cả đồng thời để bảo tồn bộ nhớ.

    Consult with this pages for better understanding: Tham khảo ý kiến với các trang này để hiểu rõ hơn:

    1. 1. http://tldp.org/LDP/tlk/mm/memory.html http://tldp.org/LDP/tlk/mm/memory.html
    2. 2. http://www.ibm.com/developerworks/linux/library/l-mem26/ http://www.ibm.com/developerworks/linux/library/l-mem26/

Leave a Reply Để lại một trả lời

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Bạn có thể sử dụng các thẻ: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q <strike> <strong>

Subscribe to comments feature has been disabled. Thuê bao với ý kiến đều đã bị vô hiệu hoá. To receive notification of latest comments posted, subscribe to Để nhận được thông báo mới nhất đăng ý kiến, đăng ký với My Digital Life Comments RSS feed My Digital Life kiến RSS feed or hoặc register to receive đăng ký để nhận được new comments in daily email digest. Các ý kiến mới trong email tiêu hàng ngày.
Custom Search

New Articles Bài viết mới

Incoming Search Terms for the Article Tìm đến các Điều khoản Điều

ubuntu memory usage ubuntu bộ nhớ sử dụng - -- linux memory usage Linux sử dụng bộ nhớ - -- centos memory usage centos bộ nhớ sử dụng - -- linux top memory Linux trên bộ nhớ - -- memory usage ubuntu bộ nhớ sử dụng ubuntu - -- linux memory usage by process Linux sử dụng bộ nhớ của quá trình - -- ubuntu show memory ubuntu hiển thị bộ nhớ - -- memory usage linux bộ nhớ sử dụng Linux - -- process memory usage linux quá trình sử dụng bộ nhớ Linux - -- linux top memory usage Linux trên bộ nhớ sử dụng - -- linux top sort by memory linux đầu sắp xếp theo bộ nhớ - -- linux process memory usage linux quá trình sử dụng bộ nhớ - -- linux real memory usage Linux sử dụng bộ nhớ thực - -- linux memory statistics linux bộ nhớ số liệu thống kê - -- ps show memory ps hiển thị bộ nhớ - -- memory statistics linux bộ nhớ số liệu thống kê linux - -- linux view memory usage linux xem bộ nhớ sử dụng - -- ubuntu show memory usage ubuntu hiển thị bộ nhớ sử dụng - -- linux ps memory usage linux ps bộ nhớ sử dụng - -- linux show swap usage linux hiện trao đổi cách sử dụng - -- ubuntu server track memory usage ubuntu máy chủ theo dõi bộ nhớ sử dụng - -- ps show memory usage ps hiển thị sử dụng bộ nhớ - -- linux check Ram linux kiểm tra Ram - -- top virt column virt đầu cột - -- ubuntu server memory usage ubuntu máy chủ sử dụng bộ nhớ - -- centos ram usage centos ram sử dụng - -- linux ps memory linux ps bộ nhớ - -- top memory usage đầu sử dụng bộ nhớ - -- linux top virt linux đầu trang virt - -- ubuntu view memory usage ubuntu xem bộ nhớ sử dụng - -- linux memory stats linux bộ nhớ số liệu thống kê - -- linux memory usage top Linux sử dụng bộ nhớ đầu trang - -- show memory linux hiển thị bộ nhớ Linux - -- how to check swap space in linux làm thế nào để kiểm tra sức chứa trao đổi trong linux - -- how to check memory status in linux làm thế nào để kiểm tra tình trạng bộ nhớ trong linux - -- linux sort processes by memory usage Linux sắp xếp các quy trình bằng cách sử dụng bộ nhớ - -- linux check memory usage linux kiểm tra bộ nhớ sử dụng - -- linux memory top linux bộ nhớ đầu trang - -- ps linux memory usage ps linux sử dụng bộ nhớ - -- linux top sort memory linux đầu sắp xếp bộ nhớ - -- linux memory report linux nhớ báo cáo - -- ubuntu check memory usage ubuntu kiểm tra bộ nhớ sử dụng - -- linux show memory usage by process Linux hiển thị bộ nhớ sử dụng bởi quá trình - -- linux ps columns linux ps cột - -- linux show physical memory linux hiện vật lý bộ nhớ - -- ps memory usage linux ps bộ nhớ sử dụng Linux - -- view memory usage linux xem bộ nhớ sử dụng Linux - -- check memory usage linux kiểm tra bộ nhớ sử dụng Linux - -- linux memory status Linux tình trạng bộ nhớ - -- linux physical memory usage Linux sử dụng bộ nhớ vật lý - --