From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28400 invoked from network); 4 Dec 2004 23:49:25 +0000 Received: from smtp.gentoo.org (156.56.111.197) by lists.gentoo.org with AES256-SHA encrypted SMTP; 4 Dec 2004 23:49:25 +0000 Received: from lists.gentoo.org ([156.56.111.196] helo=parrot.gentoo.org) by smtp.gentoo.org with esmtp (Exim 4.41) id 1CajeX-0000IO-1v for arch-gentoo-user@lists.gentoo.org; Sat, 04 Dec 2004 23:49:25 +0000 Received: (qmail 11823 invoked by uid 89); 4 Dec 2004 23:49:09 +0000 Mailing-List: contact gentoo-user-help@gentoo.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail Reply-To: gentoo-user@lists.gentoo.org X-BeenThere: gentoo-user@gentoo.org Received: (qmail 6969 invoked from network); 4 Dec 2004 23:49:08 +0000 Message-ID: <41B24CF3.2030102@colannino.org> Date: Sat, 04 Dec 2004 15:49:07 -0800 From: James Colannino User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041107 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org References: <49bf44f104120306566d7e95cc@mail.gmail.com> <1102117306.10326.3.camel@sf.rout.dyndns.org> <49bf44f10412031709175d496@mail.gmail.com> <20041204013213.GA30529@vicerveza.homeunix.net> <49bf44f104120318296c48f892@mail.gmail.com> In-Reply-To: <49bf44f104120318296c48f892@mail.gmail.com> X-Enigmail-Version: 0.86.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) Subject: Re: [gentoo-user] More memory? X-Archives-Salt: ed7c6218-44a6-41e9-940b-e152a2a4c16b X-Archives-Hash: 31afd0805e9090862b46b89aa40a496b Grant wrote: >>Swap enables the system to have more memory pages for the running processes. If >>the OS doesn't have enough memory for a process, it'll let the process know, or >>simply kill it. >> >>If you don't want swap to be used, disable it. Remember that the system also >>uses physical ram for caching disk, not only for user processes. >> >>If you don't use swap, your 'inactive' processes won't go into swap. Maybe the >>OS prefers having more disk into cache than a process in physical ram. (there >>must be rules in Linux for that). Then, when your usually-inactive process is >>awakened, the OS must move its pages from disk to RAM, shown as a slow answer >>from that process. >> >>Reaching your memory limit without swap, is the same as reaching the memory >>limit with swap (physical + disk). Someone who maintains a system, must select a >>reasonable amount of 'swap' according to the expected behaviour of that system. >>What do you want, be able of running more processes than your physical RAM >>enables -use swap- against some slowness, or keep on your physical RAM limit, >>keeping a normal system speed for all processes? >> >>conclusion: you're absolutely free for disabling your swap. System doesn't >>require swap for "some reason", as you said. >> >> > >OK, I'm getting a better grip on memory and swap thanks to you guys. >Let me ask this another way though. > >I doesn't seem like disabling swap is such a good idea, especially on >a commercial server and especially when I'm going to be running a >second instance of the OS inside VMware. What if my site gets a bunch >of traffic for whatever reason all of a sudden? Maybe I'm compiling >my kernel at the same time, and running all kinds of tests in the >VMware'd OS. It seems like the swap needs to be there for times when >the system is really strained and the memory fills up with active >stuff. I remember when I was just starting with Gentoo I forgot to >enable the swap and kept getting an out of memory error during the >bootstrap. > >Maybe a better way to phrase my question is: Is it possible to set my >server up so it will use swap when it needs it and then free it back >up when it doesn't need it anymore? What makes me think that is >necessary is the fact that I see a very snappy response when browsing >my site after a fresh reboot. After it's been up for awhile, the swap >starts to fill and it slows down. Rebooting clears out the swap and >the snaps return. > >All I'm trying to do here is keep my site nice and fast. > > Hey Grant, this may not help, but I'm reading posts about disk cache going into physical memory, and I thought of something. Since you get better performance when you reboot, try this command as root: #sync See if that helps. That basically flushes the cache and sends it to disk where it would eventually go anyway. If so, then you know what's hogging all your memory. James -- My blog: http://www.crazydrclaw.com/ My homepage: http://james.colannino.org/ "Black holes are where God divided by zero." --Steven Wright -- gentoo-user@gentoo.org mailing list