From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,eb7bea273cf69a0c X-Google-Attributes: gidfee84,public From: Phil Farrell Subject: Re: Swap: Deferred or Immediate? Date: 1998/02/13 Message-ID: <34E49FE2.2742@pangea.stanford.edu>#1/1 X-Deja-AN: 324837421 Content-Transfer-Encoding: 7bit References: To: "Daniel J. Potter" Content-Type: text/plain; charset=us-ascii Organization: Stanford University School of Earth Sciences Mime-Version: 1.0 Newsgroups: comp.unix.osf.osf1 Daniel J. Potter wrote: > > Hey there, > Are there any significant performance differences b/w immediate and > deferred swap modes? We are currently using immediate, but are having > problems with OSF reporting less than 10% swap available. I have heard > that switching to deferred mode could solve this problem. As has been discussed many times in this group, switching to deferred mode will most likely solve your problem of low available swap space, but it may introduce another problem, that some of us consider more serious. In the deferred mode, the kernel only allocates swap space when actually needed to page out memory, rather than pre-allocating possible needs when the process starts, as is done in immediate mode. This "raises the bar" on how far your swap space will "stretch". However, if you ever do reach the limit of swap space, you get a different, and potentially more serious, result with deferred mode. In immediate mode, when you reach the limit of swap space, the next NEW process that tries to start will fail. In deferred mode, when you reach the limit, it will most likely be because a new process is starting and the system wants to page out some older process that is in a wait state. In that case, the page will fail and the OLD process will die. This will be a RANDOM old process. Several DEC engineers have mentioned that the algorithm for picking a process to swap out often picks on important system background daemons, with the result that a simple user process starting up when swap space is exhausted in deferred mode has the side effect of forcing an important system daemon like "inetd" (your network connection daemon) to die. Personally, I would rather have the user get a "not enough memory" message than have a random important system daemon die with bad consequences for the whole system and lots of time wasted trying to associate the resulting symptoms with the real cause, not to mention dealing with all the frustrated other users who are affected by the loss of a system daemon. I want my systems to behave predictably, so I always use immediate swap mode. Disks are cheap and well worth the savings in my time and aggravation. -- Phil Farrell, Computer Systems Manager Stanford University School of Earth Sciences farrell@pangea.stanford.edu