Re: cache limit

From: Nick Piggin (piggin_at_cyberone.com.au)
Date: 08/27/03

  • Next message: warudkar_at_vsnl.net: "2.6.0-test4-mm1 - kswap hogs cpu OO takes ages to start!"
    Date:	Wed, 27 Aug 2003 21:07:29 +1000
    To: Ihar 'Philips' Filipau <filia@softhome.net>
    
    

    Ihar 'Philips' Filipau wrote:

    > Mike Fedyk wrote:
    >
    >>
    >> That was because they wanted the non-streaming files to be left in
    >> the cache.
    >>
    >>> I will try to produce some benchmarktings tomorrow with different
    >>> 'mem=%dMB'. I'm afraid to confirm that it will make difference.
    >>> But in advance: mantainance of page tables for 1GB and for 128MB of
    >>> RAM are going to make a difference.
    >>
    >>
    >> I'm sorry to say, but you *will* get lower performance if you lower
    >> the mem=
    >> value below your working set. This will also lower the total amount of
    >> memory available for your applications, and force your apps, to swap and
    >> balance cache, and app memory.
    >>
    >> That's not what you are looking to benchmark.
    >>
    >
    > Okay. I'm completely puzzled.
    > I will qute here only one test - and I really do not understand this
    > stuff.
    >
    > Three boots with the same parameters and only mem=nMB, n =
    > {512,256,128} (I have 512MB RAM)
    >
    > hdparm tests:
    > [root@hera ifilipau]# hdparm -t /dev/hda
    > /dev/hda:
    > Timing buffered disk reads: 64 MB in 1.56 seconds = 41.03 MB/sec
    > [root@hera ifilipau]# hdparm -T /dev/hda
    > /dev/hda:
    > Timing buffer-cache reads: 128 MB in 0.44 seconds =290.91 MB/sec
    > [root@hera ifilipau]#
    >
    > Before tests I was doing 'swapoff -a; sync'
    > RedHat's 2.4.20-20.9 kernel.
    >
    > What has really puzzled me.
    > Operation: "cat *.bz2 >big_file", where *.bz2 is just two bzipped
    > kernels. Total size: 29MB+32MB (2.4.22 + 2.6.0-test1)
    >
    > To be bsolutely fair in this unfair benchmark I have run test only
    > once. Times in seconds as shown by bash's time.
    >
    > cat sync
    > 512MB: 1.565 0.007
    > 256MB: 1.649 0.008
    > 128MB: 2.184 0.007
    >
    > Kill me - shoot me, but how it can be?
    > Resulting file fits RAM.
    > Not hard to guess that source files, which no one cares about
    > already - are still hanging in the RAM...
    >
    > That's not right: as long as resulting file fits memory - and it
    > fits memory in all (512MB, 256MB, 128MB) cases - this operation should
    > take the _same_ time. (Actually before 128MB test, vmstat was saying
    > that I have +70MB of free non-touched memory)
    >
    > So resume is quite simple: kernel loses *terribly* much time
    > resorting read()s against write()s. Way _too_ _much_ time.

    The kernel spends _very_ little time in the disk elevator actually. The
    2.4 elevator can send very suboptimal orderings of requests to the disk
    when reads and writes are going to the disk at the same time. That might
    be happening here. The VM might also be doing more work if you have other
    things in RAM as well, although its unlikely to cause such a big
    difference.

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: warudkar_at_vsnl.net: "2.6.0-test4-mm1 - kswap hogs cpu OO takes ages to start!"

    Relevant Pages

    • Re: What can I check to fix system performance?
      ... it seems you have plenty of memory available: ... copies of files you have read of written lately, in a cache, in case ... processes per CPU, or 40 in all. ... Consider the disk structure. ...
      (comp.os.linux.setup)
    • Re: Caching control
      ... |> | invalidate/unmap them in order to discard the data from memory. ... |> writing out to disk. ... | easy to discard as clean disk cache. ... stating that a specific amount of RAM can be used only for I/O ...
      (comp.os.linux.development.system)
    • Re: Scheduler: Process priority fed back to parent?
      ... > interactivity cache could estimate interactivity over a period of hours ... Then you don't even have to write it to the filesystem. ... For those of us with enough memory or a large variety of programs, ... That way the file is already in disk cache or on its way when the ...
      (Linux-Kernel)
    • Re: FreeBSD and poor ata performance
      ... Linux doesn't really have raw disk devices. ... All disk I/O is through the disk cache, ... performance (on a system with sufficient memory to hold all of the data ... sys 0m12.477s ...
      (freebsd-questions)
    • Re: Named Shared "memory" or "file"?
      ... And second process can show "Message from first ... Second process get handle to first process' physical "memory" and get ... another file) on the disk or "same memory"? ... the data will be in cache. ...
      (microsoft.public.win32.programmer.kernel)