Maimum swappage分析和总结分析和总结.docxVIP

  • 0
  • 0
  • 约6.2千字
  • 约 4页
  • 2023-04-25 发布于上海
  • 举报
Disclaimer : Disclaimer : The original version of this article was first published on IBM developerWorks, and is property of Westtech Information Services. This document is an updated version of the original article, and contains various improvements made by the Gentoo Linux Documentation team. This document is not actively maintained. Maximum swappage 1. Getting the most out of swap When you set up a brand new Linux server, do you create a single 128 MB swap partition? If so, did you know that you are severely limiting swap performance? Would you like to increase swap performance by several orders of magnitude, and to create swap partitions larger than 1 GB? Its possible, requiring no kernel patches or special hardware, just pure geek know-how! Some of you may not really care about swap. After all, Linux systems are typically very memory efficient, and swap is often barely touched. While often true on desktop systems, servers are another story. Because servers may handle unexpected stresses, such as runaway processes, denial of service attacks, or even the Slashdot effect, they need to have adequate high-speed swap so that they do not grind to a halt and possibly crash when all physical memory (and then some) is exhausted. Still not convinced that this is a big deal? Ill show you how easy it is to bring down a server by launching a massive amount of new processes. Warning: Warning: Please, if you try this, do it only on a non-production server that you actually administer! Lets say you have two customized grep commands in /usr/bin, called bobgrep and jimgrep. Now, lets assume that bobgrep is simply a shell script that calls the ELF executable jimgrep, as follows: Code Listing 1.1: The bobgrep script #!/bin/bash Code Listing 1.1: The bobgrep script #!/bin/bash jimgrep -r $* Everything looks good so far, but what happens if jimgrep gets accidentally replaced with a symbolic link to bobgrep? Well, in that case, calling bobgrep or jimgrep will cause an infinite loop,

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档