[RFC] [CTDB] Optimized memory handling.

Amitay Isaacs amitay at gmail.com
Wed Dec 13 23:42:58 UTC 2017


On Wed, Dec 13, 2017 at 10:52 AM, Jeremy Allison via samba-technical
<samba-technical at lists.samba.org> wrote:
> On Tue, Dec 12, 2017 at 12:49:08PM +0100, Swen Schillig via samba-technical wrote:
>> As mentioned in an earlier mail, I'm new to SAMBA and CTDB.
>> During my on-boarding (reading code) I was wondering if the memory
>> handling is really so fortunate.
>>
>> The attached patch shows a more extensive usage of the
>> memory pool concepts provided by the talloc API.
>> In addition I re-organized the processing a bit in that way that I'm
>> trying to first gather the memory requirements and then allocate,
>> instead of the other way around and then fail.
>>
>> The currently used magic numbers for the pool sizes are still under
>> investigation...hints and recommendations are welcome.
>>
>> However, initial tests showed big improvements.
>
> Can you give more details on what you mean by "big improvements" ?
> Some numbers would be good :-).
>
> Thanks,
>
> Jeremy.
>

Even without seeing the proof I can imagine the improvements in packet
handling using the talloc pool.  That code is in the hot path and
avoiding extra malloc() calls will definitely result in reducing the
load on ctdb daemon.  However, as Jeremy mentioned, it would be good
to verify with real numbers.

As outlined in another email, I would prefer if you make these changes
in sock_io.c.  It will be easier to spin up a self-contained
performance test using sock_io without needing to run an expensive
cluster test.

Regarding the actual changes, I wish I had looked at talloc pools
before.  Packet handling is the ideal place for using talloc pools.  I
would avoid adding static globals (datapool) and stick them on a
context.

Amitay.



More information about the samba-technical mailing list