🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
3 messages
3 total messages Started by Brad Knowles Wed, 14 Jul 1999 00:00
Diablo w/ history file on mfs?
#38684
Author: Brad Knowles
Date: Wed, 14 Jul 1999 00:00
42 lines
2552 bytes
Folks,

    Has anyone here run Diablo with the history file on a memory-based
filesystem (not true SSD, where you would presumably have battery backup,
etc...)?

    Are there any particular pitfalls I need to be aware of, other than
the obvious "you really should copy the history file to rotating media
periodically, you should do expire with the history file on rotating
media, etc..."?


    On a related note, it is my understanding that Diablo will use mmap()
on the history file (which will cause the data to be pulled into the
buffer cache), up to a certain maximum size, and beyond that it will just
use lseek() (which should avoid having the rest of the file pulled into
buffer cache).

    However, my C skills are extraordinarily rusty, and I'm not able to
find any obvious HISTORY_MMAP_MAX definition within the source.  Can
anyone tell me what the appropriate section of code is that makes this
determination, and how it decides when to stop mmap()ing the history file
and to start lseek()ing it past that point?


    The reason I ask is that I've recently received the machine that will
be replacing our news peering server (currently a Pentium Pro 200 w/ 256MB
RAM).  On the new machine I've got 1GB of ECC RAM, of which I'm willing to
give up about 384MB worth to store a 256MB history file on an mfs and
guarantee that I never hit any disk latency when accessing the file, but I
don't want to give up another 256MB to also store the entire file in
buffer cache.

    Giving up 37.5% of my RAM to keep the whole file in RAM is okay, but I
don't want to give up 62.5% for that function, if there's any way at all
that I can avoid it.  ;-)

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>
    <http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=0xE38CCEF1>

Re: Diablo w/ history file on mfs?
#38674
Author: Andrew Gierth
Date: Wed, 14 Jul 1999 00:00
24 lines
1888 bytes
>>>>> "Brad" == Brad Knowles <brad@shub-internet.org> writes:

 Brad>     On a related note, it is my understanding that Diablo will
 Brad> use mmap() on the history file (which will cause the data to be
 Brad> pulled into the buffer cache), up to a certain maximum size,
 Brad> and beyond that it will just use lseek() (which should avoid
 Brad> having the rest of the file pulled into buffer cache).

 Brad>     However, my C skills are extraordinarily rusty, and I'm not
 Brad> able to find any obvious HISTORY_MMAP_MAX definition within the
 Brad> source.  Can anyone tell me what the appropriate section of
 Brad> code is that makes this determination, and how it decides when
 Brad> to stop mmap()ing the history file and to start lseek()ing it
 Brad> past that point?

What it does, AIUI, is to mmap() the file header and hashtable that
appears at the start of the file (there's a define somewhere that sets
the size of the hashtable), and use lseek/read/write for the actual
history entries.

-- 
Andrew.

Re: Diablo w/ history file on mfs?
#38702
Author: Brad Knowles
Date: Thu, 15 Jul 1999 00:00
24 lines
1912 bytes
In article <874sj7hzfj.fsf@erlenstar.demon.co.uk>, Andrew Gierth
<andrew@erlenstar.demon.co.uk> wrote:

> What it does, AIUI, is to mmap() the file header and hashtable that
> appears at the start of the file (there's a define somewhere that sets
> the size of the hashtable), and use lseek/read/write for the actual
> history entries.

    So, whatever the size is of the header and hashtable, I'd pay that
cost in RAM twice (once on mfs and once in buffer cache), but for the rest
of the history file this would be a *huge* win as you would then be doing
lseek/read/write against memory without any disk access.  Did I get that
right?

    What about copying the history file to rotating media periodically
(say, every five minutes), and making sure that the history file is
resident on rotating media during an expire?  Are those both good ideas? 
Is there anything else you can think of that I might need to be aware of?

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>
    <http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=0xE38CCEF1>

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads