¸®´ª½º¿¡ ÀÖ´Â ±â¾ï »ç¿ë¹ýÀ» °Ë»çÇÏ´Â ¹æ¹ý ¼­¹öÀÇ ±âÃʸ¦ µÎ¾ú´Ù

±â¾ïÀº Àú°Í¿¡°Ô ¸Å²ô·´°í ºü¸¥ °¡µ¿À» ÁöŰ´Â ¼­¹ö¿¡ Áß¿ä ÀÚ¿ø ºÐ´ëÀÇ ÇѰ³ ÀÌ´Ù. µû¶ó¼­, ÃæºÐÇϰí dzºÎÇÑ ¹°¸®Àû ±â¾ï Àå¼Ò Å©±âÀÇ °¡¿ë¼ºÀº ¾î¶² ¼­¹öµçÁö, ¶ÇÇÑ ÁýÁß ±â¾ïÀ» À§ÇØ °í¸íÇÑ Oracle MySQL¿Í °°Àº µ¥ÀÌŸº£À̽º ¼­¹ö¸¦ ´Þ¸®°í Àִ ƯÈ÷ ³ôÀº Áü À¥ ÁÖÀÎÀ» À§ÇØ »ý¸í ƯÈ÷ ÀÌ´Ù. cPanel¿Í Plesk À¥ È£½ºÆÃ ¼­¹ö¿¡ ´ëÁßÀûÀÎ CentOS¸¦ Æ÷ÇÔÇÏ¿© ¸®´ª½º´Â, ¼­¹ö¿¡ ±â¾ï »ç¿ë¹ýÀ» °Ë»çÇÏ´Â ¸î¸î ¸í·É ¹× °ø±¸¿¡, ¿Â´Ù.

ÀÚÀ¯·Î¿î

ÀÚÀ¯·Î¿î ¸í·ÉÀº °øÀ¯ ±â¾ï ÀåÄ¡¿¡ shoing Á¤º¸ »Ó¸¸ ¾Æ´Ï¶ó ü°è, ¸®´ª½º ¾Ë°»ÀÌ¿¡ ÀÇÇØ ÀÌ¿ëµÈ ¿ÏÃæ±â, ij½Ã ±â¾ï ÀåÄ¡ ¹× ±³È¯ °ø°£¿¡¼­ ÃѰè, ÀÚÀ¯·Ó°Ô¿Í »ç¿ëÇÑ ¹°¸®Àû ±â¾ï Àå¼Ò (·½) ¾çÀ» Ç¥½ÃÇÑ´Ù.

ÀÚÀ¯·Î¿îÀÇ Åë¾î·Ð

ÇØ¹æÇϽʽÿÀ - [¼±ÅñÇ]

ÀÚÀ¯·Î¿îÀÇ º¸±â »ç¿ë¹ý

- m¸¦ ÇØ¹æÇϽʽÿÀ

¸í·ÉÀº MB¿¡ ÀÖ´Â ¹°¸®Àû ±â¾ï Àå¼Ò¿¡ °üÇÏ¿© Á¤º¸¸¦ Ç¥½ÃÇÒ °ÍÀÌ´Ù.

- m - s 5¸¦ ÇØ¹æÇϽʽÿÀ

¸í·ÉÀº 5 ÃÊ¿¡ Áö¼ÓÀûÀÎ ÅõÇ¥ Áö¿¬À» µû·Îµû·Î Ȱ¼ºÈ­Çϰí, ±× ÈÄ¿¡ ¸Ç³¡¿¡ ¸Þ°¡¹ÙÀÌÆ®¿¡ ÀÖ´Â ±â¾ï »óŸ¦ Ç¥½ÃÇÑ´Ù. Áö¿¬À» À§ÇÑ ¾î¶² ºÎµ¿ ¼Ò¼öÁ¡ ¼öµçÁö ÁöÁ¤µÉ ¼ö ÀÖ´Ù.

- t - m¸¦ ÇØ¹æÇϽʽÿÀ

"ÀÚÀ¯·Î¿î - m", ±×·¯³ª - t ½ºÀ§Ä¡¿¡ µ¿ÀÏÀº ¹°¸®Àû ±â¾ï Àå¼Ò ¹× ±³È¯ °ø°£ÀÇ Çհ踦 Æ÷ÇÔÇÏ´Â ¼±À» Ç¥½ÃÇÒ °ÍÀÌ´Ù.

vmstat

vmstat º¸°í´Â °¡»ó ±â¾ïÀåÄ¡ Åë°è¸¦ º¸°íÇÑ´Ù, °úÁ¤, ±³È¯, ÀÚÀ¯·Î¿î¿¡ °üÇÏ¿© Á¤º¸°¡, ¿ÏÃæ±â¿Í °ø°£, µð½ºÅ© IO Ȱµ¿, ÇÔÁ¤, °³ÀÔÁß´Ü, ¹®¸Æ ½ºÀ§Ä¡ ¹× CPU Ȱµ¿À» ã´Â ij½Ã ±â¾ï ÀåÄ¡ ÀÖ´Â. vmstat ¸í·ÉÀ¸·Î, ÇàÁ¤°üÀº ÀÖ´Ù ±â¾ï »ç¿ë¹ý¿¡ Áï¼® º¸°í°¡ ÅëÁ¶¸²À¸·Î ¸¸µç´Ù.

vmstatÀÇ Åë¾î·Ð

vmstat - [¼±ÅñÇ] [Áö¿¬ Á¶»ç]

vmstatÀÇ º¸±â »ç¿ë¹ý

vmstat

¸í·ÉÀº ¸¶Áö¸· Àç½Ãµ¿ÇϽʽÿÀ ¶§¹®¿¡ Æò±Õ¿¡ ±Ù°ÅÇÑ º¸°í¸¦ Ç¥½ÃÇÒ °ÍÀÌ´Ù.

vmstat 5

¸í·ÉÀº 5 ÃÊÀÇ °£°ÝÀ¸·Î 5 ÃÊÀÇ Ç¥º» ÃßÃ⠱ⰣÀ» À§ÇÑ Æò±Õ ½Ã½ºÅÛ ÀÚ¿ø »ç¿ë ¼öÁØÀ», ¸¦ Á¦¿ÜÇÏ°í Æò±Õ ¶§¹®¿¡ ¸¶Áö¸· Àç½Ãµ¿ÀΠù¹øÂ° °á°ú ÇÕµ¿ÇÒ °ÍÀÌ´Ù.

Á¤»ó

ÃÖ°í ¸í·ÉÀº Linux ½Ã½ºÅÛ¿¡ ÀÖ´Â ¾Ë°»ÀÌ ±×¸®°í ½Ã½ºÅÛ Á¤º¸¿¡ ÀÇÇØ ó¸®µÈ ¿î¿µÇÏ´Â ¾÷¹«ÀÇ µ¿ÀûÀÎ ¼ø°£ Àü¸ÁÀ» Ç¥½ÃÇÑ´Ù. ÃÖ°í ¸í·É¿¡ ÀÇÇÏ¿© ±â¾ï »ç¿ë¹ý stats´Â Áï½Ã »ì¾ÆÀÖ´Â ÃѰ踦, »ç¿ëÇØ Æ÷ÇÔÇÏ°í ¹°¸®Àû ±â¾ï Àå¼Ò¸¦ ÇØ¹æÇÏ°í °¢°¢ ±×µéÀÇ ¿ÏÃæ±â ¹× ij½Ã ±â¾ï ÀåÄ¡ Å©±â¸¦ °¡Áø ±â¾ïÀ» ±³È¯ÇÑ´Ù.

Á¤»óÀÇ Åë¾î·Ð°ú º¸±â »ç¿ë¹ý

Á¤»ó

Á¤»óÀ» »ç¿ëÇÏ¿© ¸í·É Æ÷ź¿¡ °£´ÜÇÏ, °£´ÜÇÏ°Ô À¯Çü Á¤»óÀº, ÀÏÁ¤ÇÏ°Ô °»½Å stats ÆäÀÌÁö´Â º¸ÀÏ °ÍÀÌ´Ù.

º¸Á¶ ps

ps ¸í·É º¸°í ÇöÀç Ȱµ¿ °úÁ¤ÀÇ Á¤º¸¿¡ ½º³À. ps ¸í·ÉÀÇ ÀÌÁ¡Àº ü°è admins°¡ ±â¾ïÀÌ ¾îµð¿¡ »ç¿ëµÇ´ÂÁö º¼ ¼ö ÀÖÀ» ÀÌ´Ù. ps´Â ü°è¿¡¼­ ´Þ¸®´Â °¢ °úÁ¤ ¶Ç´Â ¾÷¹«¿¡ ÀÇÇØ ÀÌ¿ëµÇ´Â ¸Þ¸ð¸® ¸®¼Ò½ºÀÇ ¹éºÐÀ²À» º¸¿©ÁÙ °ÍÀÌ´Ù. With this command, top memory hogging processes can be identified.

Syntax and example of ps aux

aux is actually already the options for ps command to see every process on the system. 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:

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. 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, i.e. the entire server the virtual environment is running on. In these virtualization system, the memory usage info has to be calculated from control panel or /proc/user_beancounters file.

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. Artem S. Tashkinov
    September 24th, 2007 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 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. 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. 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.

    SHR column says how much memory a particular application is sharing with other applications. E.g., 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.

    Consult with this pages for better understanding:

    1. http://tldp.org/LDP/tlk/mm/memory.html
    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>

Subscribe without commenting


Custom Search

New Articles

Incoming Search Terms for the Article

linux memory usage - linux memory stats - CentOS memory usage - linux show memory - linux memory size - Linux memory status - linux top memory - ubuntu show memory - linux check memory usage - linux check resources - ubuntu show memory usage - ubuntu check memory - linux check memory - memory usage linux - linux memory usage report - ubuntu check memory usage - linux check memory status - show memory linux - checking memory usage on linux - top command memory usage - how to check memory in linux - linux real memory usage - plesk memory usage - linux show swap usage - unix memory usage - ubuntu server memory usage - linux check processes - linux physical memory usage - linux memory statistics - unix memory status - how to check memory status in linux - Linux ps show memory - linux check resource usage - linux show physical memory - check memory usage ubuntu - linux check process - check memory usage linux - ps show memory usage - linux memory stat - check memory status in linux - checking memory in unix - top memory linux - ps show memory - linux top memory - show physical memory linux - show memory in linux - checking memory in linux - Linux ps memory size - all - unix ps show memory usage - linux check memory process - ps display memory usage - show memory usage ubuntu - top virt column - linux application memory usage - linux memory info - check memory on linux - linux display memory size - linux check memory size - linux top virt - linux show memory status - show memory usage linux - linux show memory size - check memory linux - linux+check process+memory - linux show memory usage - top command virt - check memory in linux - linux memory report - linux ps memory usage - ubuntu check ram size - checking the amount of memory on a Linux server - linux command to check memory status - check ram on linux - linux report memory usage -