[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [[cobalt-developers] Maximum Ram on Raq 3i ?]



david woods wrote:
 
> 512Mb is pretty large anyway, but considering Linux uses Virtual Memory, maybe
> you won't get such a great speed increase by just plugging-in extra memory.
> I've ported things to the Mac, which has awful memory-handling, and noticed a
> few things about performance:

All modern systems use virtual memory.  Just to clarify - if the total
of the sizes of the "resident set" for each of your active tasks is
larger than total memory, you will likely incur swapping.  swapping is
slow.  virtual memory is not slow, but swapping is. 

> Using virtual memory really slows things down.
> A disk cache really speeds things up.

The OS is a disk cache.
 
> Why not create a RAM disk and, where possible, set file cache options on the
> programs you're using to point to this.
> This will make oft-used files really zoom.

This is a really micro optimization, and is likely to reduce overall
performance.  The OS uses almost all available memory for the "buffer
cache" - for disk files.  By forcing some files into a ramdisk, you are
taking memory away from the OS (whichc caches most-used files) and
forcing it to cache files you deem most important.  Now, that is not to
say that there aren't applications for a ramdisk, but I don't know if
this is one.  Of course, I don't know the details.
 
> Some software may be using very inefficient code to read/write data (eg
> reading/writing single bytes at a time), and here using a RAM disk will make
> an incredible difference to the speed.

Again, the OS doesn't read one byte at a time - it reads blocks (512
bytes?).  It also generally performs read-ahead, on the assumption you
will be requesting data later.  Now, reading one byte at a time CAN be
slow (repeated system calls...) but that is why stdio was developed.  It
buffers files in user-space.

I don't know what the OPs real propblem was, but I just wanted to
clarify.

> Where can I get an external RAM disk for a RAQ (or just something that plugs
> into an ethernet connection and looks like a normal hard drive)?

ehh?  an external RAM disk?  a ramdisk is a pretend disk that actually
exists only in system memory.  There are plenty of devices that attach
to your network and act like a disk (NASRaq?)  but they won't be fast
like memory.  The further you get from the CPU the slower things get (in
general):

Fastest:
	Registers
	L1 cache
	L2 cache
	Memory
	Disk
	Local Network
	WAN
Slowest:


> Is there some GUI utility to tell me in real-time how much RAM/Virtual Memory
> each process on the RAQ is using?

There are plenty of text based ways - try the 'top' command.
 
Tim
-- 
Tim Hockin
Software Engineer / OS Engineer
Cobalt Networks
thockin@xxxxxxxxxx