Ãâó :
https://access.redhat.com/knowledge/solutions/15244
¹ø¿ª¿ä¾à
RHEL °è¿¿¡¼ÀÇ ±ÇÀå SWAP Å©±â´Â?
¿¹Àü¿¡´Â ¹°¸®ÀûÀÎ ¸Þ¸ð¸®¿¡ 2¹è¸¦ Àâ¾ÆÁÖ´Â°Ô ÀϹÝÀûÀÌ¿´Áö¸¸ ¸Þ¸ð¸®¾çÀÌ Áõ°¡ÇÏ¸é¼ Å©±âº°·Î ±ÇÀåÇÏ´Â ÃÖ¼Ò(Minimum) °ø°£ÀÌ ³ª¿À°Ô µÇ¾ú½À´Ï´Ù.
ÀÌ´Â ±ÇÀå ÃÖ¼Ò°ªÀ̶ó´Â ÀǹÌÀÌÁö ½ÇÁ¦ ±×¸¸Å¸¸ »ç¿ëÇѴٴ°ÍÀº ¾Æ´Ï¹Ç·Î ¸Þ¸ð¸®¸¦ ¸¹ÀÌ ¾²´Â ȯ°æÀ̶ó¸é º¸´Ù ¿©À¯ÀÖ°Ô Àâ¾ÆÁִ°ÍÀÌ ÁÁ½À´Ï´Ù.
Áï swap °ø°£Àº ÆÄƼ¼Ç Å©±â°¡ Çã¿ëÇÏ´Â Çѵµ±îÁö »ç¿ëÇҽǼö ÀÖ´Ù°í º¸½Ã¸é µÇ°ÚÀ¸¸ç Å©°Ô Àâ´õ¶óµµ ½ÇÁ¦ ȯ°æ¿¡¼ ±×¸¸ÅÀÇ ´ë·®ÀÇ µ¥ÀÌÅ͸¦ Swap in/out ÇÑ´Ù¸é ¼º´ÉÀúÇÏ°¡ ½É°¢ÇÏ°Ô ¹ß»ýÇÒ ¼ö Àֱ⿡ ¹°¸®ÀûÀÎ ¸Þ¸ð¸®¸¦ ´Ã·Á¼ ÇØ°áÇϴ°ÍÀÌ ÀϹÝÀûÀÔ´Ï´Ù.
If I add several hundred GB of RAM to a system, do I really
need several hundred GB of swap space for
RHEL?
Issue
• If add several hundred
GB of RAM to a system, do really need several hundred GB of swap space?
•
What are the recommended swap size settings for Red Hat Enterprise Linux 5 or
Red Hat Enterprise Linux
6?
Environment
• Red
Hat Enterprise Linux 5
• Red Hat Enterprise Linux
6
Resolution
Currently Red Hat recommends a linear
increase to the amount of swap space on a system
as the amount of RAM
increases. Specifically, that swap space on a system be twice the
amount of
RAM when the system has up to 2 GB and the amount of RAM plus 2 GB when
the
system has more than 2GB of RAM. This is pretty much the same recommendation
as
upstream so the reasoning behind it is, the larger the system, the larger
memory workload
that system will likely encounter.
This no longer makes
sense as memory sizes have increased into the hundreds of GBs.
The reality is
the amount of swap space a system needs is not really a function of
the
amount of RAM it has but rather the memory workload that is running on
that system. A Red
Hat Enterprise Linux 5 system will run just fine with no
swap space at all as long as the sum
of anonymous memory and system V shared
memory is less than about 75% the amount of
RAM. In this case the system will
simply lock the anonymous and system V shared memory
into RAM and use the
remaining RAM for caching file system data so when memory is
exhausted the
kernel only reclaims pagecache memory.
Considering that
1. At
installation time when configuring the swap space there is no easy way to
predetermine the memory a
workload will require, and
2. The more RAM a
system has the less swap space it typically needs, a better swap space
requirements
rule for Red Hat Enterprise Linux 5 is:
• Systems
with 4 GB of ram or less require a minimum of 2 GB of swap space
• Systems
with 4 GB to 16 GB of ram require a minimum of 4 GB of swap space
• Systems
with 16 GB to 64 GB of ram require a minimum of 8 GB of swap space
• Systems
with 64 GB to 256 GB of ram require a minimum of 16 GB of swap space