To answer the why question, its two fold. The first and most impotrant is the debugging issue. Sometimes problems do not reveal themselves but for the most stressfull conditions. The second is for experiments under different conditions to see how it perfoms. i.e. benchmarks.
I allocated 520 mb of memory and my swap file is 512. In kernel 2.6 there is a further complication where you have to change the /proc/vm/swappiness to 0 so the kernel will prefer to remove cache pages instead of memory-swap pages. As for the query itself, I guess I'll have to use huge tables because IIRC the kernel cache has no defense against sequential scans in the cache. I also had to zero the readahead blockdev --setra 0 /dev/sda to get more accurate results. increasing vfs_cache_pressure to 1000 doesn't hurt. Is there a way to know how much physical memory I can allocate? i.e. if not then maybe, by some trial and error + mlock? It would allow me to lock the memory for the duration of the experiments so it won't be used for cache. It would be interesting to find out how the postgresql server will perform now that it doesn't have the cache support of the system and will have to rely on its own cache (as it should but they didn't get to this yet) which should increase its performance. Is there a way to know how much memory at all I can allocate right now? I was very surprised that the linux kernel don't allow me to restrict the size of the file cache like in windows. It doesn't have performance monitoring like in windows(per process). I looked at http://oss.sgi.com/projects/csa/ but I don't know if it has the per process i/o and I can manage with the block_dump. Regards, tzahi. > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Micha Feigin > Sent: Thursday, April 28, 2005 1:41 PM > To: ILUG > Subject: Re: cleaning memory. > > > On Thu, 28 Apr 2005 03:41:46 +0200 > Tzahi Fadida <[EMAIL PROTECTED]> wrote: > > > My next move was to try a big allocation like cacheman in > windows to > > free memory right now. > > I don't think that would work since the kernel allocates big > memory chunks sort of on loan. You can allocate more memory > then you actually have. The problem starts when you actually > try to access that memory and then the program will be killed > if the memory isn't really available. > > You may need to allocate AND use the memory. > > > Maybe create a huge file? > > I don't know if it will work though, since the kernel has > > to decide to somehow get rid of that particular caching. > > Its not like i can target this. > > Sync was the first thing i tried, and it had no effect. > > > > possibly if you start reading a lot of other files from disk > it will flush the new caches in favor of new ones. You can > run 'find /' or run updatedb which updates the databases for > the locate program. These too options should force the cache to flush. > > > Maybe there is proc setting or something like that > > limits or disables this caching? > > I'm not aware of one and I don't think one exists since there > are several non-strait-forward implementation for suspend in > order to force flushing disk caches so that they won't be > written to the hibernation image. > > > Maybe i can rename/move/etc... the files of the database and > > somehow the kernel will get the hint this cache is not > > valid anymore. > > > > Why do you want to force this flushing ? If you try to use > these files the > kernel makes sure that you are using the latest version and > if you are using a > removable disk, unmounting it will force a sync. The only > good it will do you > is to change benchmark results. > > > > Regards, > > tzahi. > > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Amos Shapira > > Sent: Thursday, April 28, 2005 2:02 AM > > To: [email protected] > > Subject: Re: cleaning memory. > > > > > > > > > > > > ================================================================= > > To unsubscribe, send mail to [EMAIL PROTECTED] with > > the word "unsubscribe" in the message body, e.g., run the command > > echo unsubscribe | mail [EMAIL PROTECTED] > > > > > > +++++++++++++++++++++++++++++++++++++++++++ > > This Mail Was Scanned By Mail-seCure System > > at the Tel-Aviv University CC. > > > > > +++++++++++++++++++++++++++++++++++++++++++ > This Mail Was Scanned By Mail-seCure System > at the Tel-Aviv University CC. > > ================================================================= > To unsubscribe, send mail to [EMAIL PROTECTED] with > the word "unsubscribe" in the message body, e.g., run the command > echo unsubscribe | mail [EMAIL PROTECTED] > > > ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
