How to Check Memory Usage in Linux based Server如何检查记忆体使用量在基于Linux的服务器

Memory is one of the most critical resource components on a server to ensure that the smooth and fast operation.记忆体是其中一个最关键的资源组件在服务器上,以确保顺利和快速的运作。 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.因此,提供足够的和丰富的物理内存大小是非常重要的,尤其是对于任何服务器,特别是高负载网络的主机也运行数据库服务器如Oracle或MySQL的,这是著名的记忆体密集。 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的,包括centos这是上流行的cPanel和plesk虚拟主机服务器,还带有一些命令和工具来检查记忆体使用量在服务器上。

free 自由的

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.免费命令显示的金额总数,自由和使用的物理内存( RAM )在该系统中,以及shoing的信息共享存储器,缓冲器,快取记忆体和swap空间所用的Linux内核。

Syntax of free 语法免费

free -[options]免费-[选项]

Example usage of free 例如使用免费

free -m免费-米

The command will display information about physical memory in MB.该命令将显示信息的物理内存以MB 。

free -m -s 5免费-米- S的5

The command will activate continuous polling delay at 5 seconds apart, and then display memory status in megabytes on terminal.该命令将启动连续投票站延迟在五秒除了,然后显示记忆体的地位,在兆字节的终端。 Any floating point number for delay can be specified.任何浮点运算的数目为延迟就可以指定。

free -t -m免费-吨-米

Same with “free -m”, but -t switch will display a line containing the totals of physical memory and swap space.同时,与“免费-米” ,但- t参数,将显示一条线载总数的物理内存和swap空间。

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. vmstat报告,报告虚拟内存统计,其中有有关进程的信息,互换,免费,自由,缓冲和快取记忆体,分页空间,磁盘IO活动,陷阱,中断,上下文开关和CPU活动。 With vmstat command, administrators can has instantaneous reports on memory usage.与vmstat命令,管理员可以有瞬时的报告对记忆体使用量。

Syntax of vmstat 语法vmstat

vmstat -[options] [delay count] vmstat -[选项] [延迟计数]

Example usage of vmstat 例如使用vmstat

vmstat

The command will display report based on averages since last reboot.该命令将显示报告的基础上平均自去年重新启动。

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.该命令将池平均系统资源的使用水平,为采样周期为5秒,间隔5秒钟,除了第一个结果是平均数,自上次重新启动。

top 顶端

top command displays dynamic real-time view of the running tasks managed by kernel and system information in Linux system.顶端命令显示动态实时时间,鉴于对运行任务管理内核和系统信息在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.记忆体使用量的统计顶端命令,包括实时直播的总时间,用的和可用的物理内存和交换的记忆与他们的缓冲器和快取记忆体大小分别。

Syntax and example usage of top 语法和用法,例如顶端

top顶端

Using top is simple, simply type top at command shell, and constantly update stats page will be shown.用最简单,只需键入顶端,在命令外壳,并且不断更新的统计资料页将显示。

ps aux 保安局常任秘书长辅助

ps command reports a snapshot on information of the current active processes.常任指挥报告的快照的资料,对当前活跃的进程。 Advantage of ps command is that system admins will be able to see where the memory is used.利用PS的命令是系统管理员将能够看到那里的记忆是用来。 ps will show the percentage of memory resource that is used by each process or task running in the system.保安局常任秘书长将显示百分比的内存资源,是所用的每一个进程或任务运行在该系统。 With this command, top memory hogging processes can be identified.与此命令,顶端内存荒加工过程中可以查明。

Syntax and example of ps aux 语法和榜样的PS辅助

aux is actually already the options for ps command to see every process on the system.辅助,其实是已经选择的PS命令查看每一个过程在系统上。 So the typical command to type the following in the command shell:因此,典型的命令,键入以下,在命令外壳:

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:看到只有内存资源占用每类进程,如Apache的httpd , MySQL的mysqld或Java ,使用下列命令:

ps aux | awk '{print $4"\t"$11}' | sort | uniq -c | awk '{print $2" "$1" "$3}' | sort -nr 保安局常任秘书长辅助| awk ' (打印4元, “ \吨” 11元) ' |排序| uniq - C的| awk ' (打印$ 2 “ ” $ 1 “ ” $ 3 ) ' |排序-二○ ○

The all mentioned ways of check memory usage should works on most Unix and Linux variant of operating systems.所有提到的方法检查记忆体使用量应工程,对大多数Unix和Linux变的操作系统。 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.然而,如果您正在运行的电子道路收费(虚拟专用服务器)或自愿离职计划(虚拟专用服务器)或混合式服务器,特别是那些由Virtuozzo软件或openvz ,上述命令将检索数据从主机上,即整个服务器的虚拟环境上运行。 In these virtualization system, the memory usage info has to be calculated from control panel or /proc/user_beancounters file.在这些虚拟化系统,记忆体使用量的信息要计算从控制面板或系统/ proc / user_beancounters档案。

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要说明 :这是一个机器翻译网页是“按原样”提供的担保。 Machine translation may be difficult to understand.机器翻译可能很难理解。 Please refer to请参阅 original English article英文原版的文章 whenever possible.只要有可能。

Share and contribute or get technical support and help at分享和贡献,或取得技术的支持和帮助,在 My Digital Life Forums 我的数字生活论坛 .



One Response to “How to Check Memory Usage in Linux based Server” 1回应“如何检查记忆体使用量在基于Linux的服务器”

  1. Artem S. Tashkinov artem第tashkinov
    September 24th, 2007 15:20 2007年9月24日15时20分
    1

    When you are running top there are three fields related to memory usage.当您正在运行的顶端有三个领域相关的记忆体使用量。 In order to assay your server memory requirements you have to understand their meaning.在以检测您的服务器的内存要求,你必须了解他们的意思。

    The first thing you have to know is that all the columns (VIRT RES SHR) report memory usage in KB (kilobytes).第一件事,你必须知道的是,所有栏位( virt第SHR )等报告,记忆体使用量在KB (千字节) 。

    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栏(虚拟内存大小的过程中)指多少记忆体特定应用程序的要求,也是计数换到磁盘存储器的页面。 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.但这个领域并不意味着这个过程中,其实用途的内存量,用它来真正的记忆,这已被发起的,例如使用memset 。 Generally speaking you can disregard this column.一般来说,您可以忽略此列。

    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.第栏(驻地集的大小,非交换的物理内存的一个专责小组,已使用(千字节) )是其中最重要的-它实际上表明,有多少物理R AM是分配给一个过程。

    SHR column says how much memory a particular application is sharing with other applications.自发性高血压大鼠柱说,多少记忆体特定应用程序的共享与其他应用程序。 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.例如,大多数应用在Linux依赖于LIBC的,并作为每一个环节的应用与它的用途其职能,然后这个图书馆的内存空间映射到所有的进程,同时为了节约内存。

    Consult with this pages for better understanding:谘询与此页面为更好地理解:

    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/

Leave a Reply离开的答复

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> 您可以使用这些标签:的<a href="" title=""> <abbr title=""> <acronym title="">的<b> <blockquote cite=""> <cite>的<code> <删除日期时间= “ ” >的<em>的<i> <q cite=""> <strike>的<strong>

Subscribe without commenting订阅无评论


Custom Search

New Articles新的条款,

Incoming Search Terms for the Article传入的搜索条件文章

linux memory usage Linux的记忆体使用量 - - linux memory stats Linux的内存统计 - - CentOS memory usage centos记忆体使用量 - - linux show memory Linux的显示记忆体 - - linux memory size Linux的内存大小 - - Linux memory status Linux的记忆状态 - - linux top memory Linux的顶端内存 - - ubuntu show memory Ubuntu的显示记忆体 - - linux check memory usage Linux的检查记忆体使用量 - - linux check resources Linux的检查资源 - - ubuntu show memory usage Ubuntu的显示记忆体使用量 - - ubuntu check memory Ubuntu的检查记忆体 - - linux check memory Linux的检查记忆体 - - memory usage linux 记忆体使用量的Linux - - linux memory usage report Linux的内存使用情况的报告 - - ubuntu check memory usage Ubuntu的检查记忆体使用量 - - linux check memory status Linux的检查记忆状态 - - show memory linux 显示记忆体的Linux - - checking memory usage on linux 检查记忆体使用量在Linux上 - - top command memory usage 顶端命令记忆体使用量 - - how to check memory in linux 如何检查内存在Linux - - linux real memory usage Linux实时记忆体使用量 - - plesk memory usage plesk记忆体使用量 - - linux show swap usage Linux的显示互换使用 - - unix memory usage UNIX的记忆体使用量 - - ubuntu server memory usage Ubuntu的伺服器记忆体使用量 - - linux check processes Linux的检查过程 - - linux physical memory usage Linux的物理内存使用情况 - - linux memory statistics Linux的内存统计 - - unix memory status UNIX的记忆状态 - - how to check memory status in linux 如何检查记忆体的地位在Linux - - Linux ps show memory Linux的常任显示记忆体 - - linux check resource usage Linux的检查资源使用 - - linux show physical memory Linux的显示物理内存 - - check memory usage ubuntu 检查记忆体使用量Ubuntu的 - - linux check process Linux的检查过程 - - check memory usage linux 检查记忆体使用量的Linux - - ps show memory usage 保安局常任秘书长显示记忆体使用量 - - linux memory stat Linux的内存统计 - - check memory status in linux 检查记忆体的地位在Linux - - checking memory in unix 检查内存在Unix - - top memory linux 顶端内存的Linux - - ps show memory 保安局常任秘书长显示记忆体 - - linux top memory Linux的顶端内存 - - show physical memory linux 显示物理内存的Linux - - show memory in linux 显示记忆体在Linux - - checking memory in linux 检查内存在Linux - - Linux ps memory size Linux的记忆体大小的PS - - all 全部 - - unix ps show memory usage UNIX的常任显示记忆体使用量 - - linux check memory process Linux的检查记忆过程 - - ps display memory usage 保安局常任秘书长显示记忆体使用量 - - show memory usage ubuntu 显示记忆体使用量Ubuntu的 - - top virt column virt顶端栏 - - linux application memory usage Linux应用记忆体使用量 - - linux memory info Linux的内存信息 - - check memory on linux 检查内存在Linux上 - - linux display memory size Linux的显示记忆体大小 - - linux check memory size Linux的检查记忆体大小 - - linux top virt Linux的顶端virt - - linux show memory status Linux的显示记忆体状态 - - show memory usage linux 显示记忆体使用量的Linux - - linux show memory size Linux的显示记忆体大小 - - check memory linux 检查内存的Linux - - linux+check process+memory Linux的+检查过程+记忆 - - linux show memory usage Linux的显示记忆体使用量 - - top command virt 顶端命令virt - - check memory in linux 检查内存在Linux - - linux memory report Linux的记忆体报告 - - linux ps memory usage Linux的的PS记忆体使用量 - - ubuntu check ram size Ubuntu的检查RAM大小 - - checking the amount of memory on a Linux server 检查的记忆体数量对Linux服务器 - - linux command to check memory status Linux命令,以检查记忆状态 - - check ram on linux 检查RAM的Linux系统 - - linux report memory usage Linux的内存使用情况的报告 - -