Subject Re: [firebird-support] Linux Classic 2.x
Author Alexandre Benson Smith
Anderson Farias wrote:
> Hi,
> From: "Leyne, Sean"
>> For CS, "less is more"...
>> A value of 75 is good for most purposes, for a large number of
>> connections 50 could be better.
> Why?? Can you elaborate on this??
> Regards,
> Anderson

Hi Anderson,

FB CS keeps a separate cache for each connection.

If you set the cache size too high you could get two "problems"
1.) Use more RAM that is available, making the process to go to swap,
what will be terrible
2.) If you are smart enough to look if the process is trashing to disk,
and set down the cache size the process will not trash (what is good),
but every connection will keep a piece of the database that is most used
but a lot of duplicated data will be held by each connection (since
there is a big chance that the most used part of the database are the
same pages across distinct connections), so you are wasting memory to
keep copies of the same piece of the database.

If you set the cache size to a low number, the FB CS process will use
small amount of RAM and a lot of RAM will be available to OS keep it's
own cache, since the OS file system cache is unique you will keep a
bigger part of the database in RAM.

Let suppose you have 2GB of RAM used by FB CS cache shared by 10
connections, this mean that each connection will keep 200MB of cache,
let's suppose 80% of that pages are the same across the connections, so
you have a waste of 1.4GB of redundant data.

If you setup FB CS to a small cache size (75 pages of 8KB) the same 10
connections would use 6MB, the OS will have 2042MB more available memory
to keep it's file system cache.

Get it now ?

see you !

Alexandre Benson Smith
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil