30M size of leaf, 5G mem of confd

Hi,

When I tried to save large string in one leaf, I found that ConfD use large memory.

I’ve got the following yang model:

container demo {
    leaf large-string {type string;}
}

and this config large.xml:

<config xmlns="http://tail-f.com/ns/config/1.0">
<demo>
    <large-string>
     aaaaaa.....aaa
    .... (up to 30 MB characters)
    </large-string>
</demo>
vm(config)# load merge large.xml
Loading.
34.24 MiB parsed in 5.84 sec (5.86 MiB/sec)

When commited this config, I found that ConfD had used up to 5G memory, and also cost much time to process this commit.

The same behavior when deleted this large leaf.

Why ConfD uses so much memory, is there any limit of leaf size?

PS:
The confd version is 6.7.3.

Hi,

See the YANG “length” and “pattern” statements:

and examples of use:

@cohult

Sorry, I didn’t express myself clearly, I mean is there any size limit for ConfD to process, in other words, what the max length does ConfD support, I don’t think 5G memory is acceptalbe for ConfD to store/delete 30M bytes of leaf but I need store more than 30M bytes in one leaf.

Your use case is kind of odd. If you think you found a bug, the forum is the wrong place for that. Tail-f RT is where you want file bug tickets.

But since ConfD’s CDB is not optimized for your use case, I would recommend that you consider using a Data Provider registered to a tailf:callpoint on that leaf to store the string externally of ConfD, perhaps in a file or a more suitable datastore such as PostgreSQL https://github.com/ConfD-Developer/ConfD-Demos/tree/master/postgres-config.

Thanks for the suggetion, I’ll try to store the string externally.