Proposed API change to tdb.
simo
idra at samba.org
Tue Dec 21 12:32:42 MST 2010
On Tue, 2010-12-21 at 11:25 -0800, Jeremy Allison wrote:
> Hi Rusty & friends,
>
> I'd like to propose an API addition to tdb.
>
> Currently, when we expand a tdb file on running out
> of freelist, we have a heuristic that we follow that
> states:
>
> "always make room for at least 100 more records, and at
> least 25% more space."
>
> and then rounded up to a multiple of a page size.
>
> I am working with an OEM that is running Samba on
> a memory contrained box, and they are storing some
> of the tdb's in an in-memory filesystem, to prevent
> disk spin-up and consequent power drain.
>
> The problem with the above heuristic is it creates
> tdb files that are far too large for their box and
> prevents them storing them on the ramfs.
>
> So I added a call tdb_set_filesize_expansion_factor()
>
> void tdb_set_filesize_expansion_factor(struct tdb_context *tdb,
> unsigned int record_number_expansion_factor,
> double min_filesize_expansion_factor)
>
> That allows this heuristic to be controlled by an
> application. The first number "record_number_expansion_factor"
> is the "at least this number of records" factor, and
> the second number "min_filesize_expansion_factor" is the
> "at least this amount more space in the file".
>
> By default they are set to :
>
> record_number_expansion_factor = 100
> min_filesize_expansion_factor = 1.25
>
> But this call gives an application control over
> these values. For this OEM it enabled them to
> tune Samba to fit in the ramfs, and was the difference
> between using our technology and having to look
> for a different solution.
>
> What do you all think ? Comments on the patch and
> corrections welcome. I'd like to make this part of
> 3.6.0 if possible (and the version of tdb that ships
> around that time) if everyone agrees.
>
> Happy Holidays !
+1 sounds like a very useful addition to have these options tunable.
Simo.
--
Simo Sorce
Samba Team GPL Compliance Officer <simo at samba.org>
Principal Software Engineer at Red Hat, Inc. <simo at redhat.com>
More information about the samba-technical
mailing list