Hi Pim,

The defaults we use are 96M for stat segment and 1G for main heap (default
main heap size). I know these need to scale up as the numbers of routes
and/or threads increase. These values can accommodate a million routes or
so when running single threaded, but allocations on the stat segment
fail if 2 worker threads are enabled with 1M routes. Allocations on the
main heap fail if the number of routes gets too far above 1M.

What I'm trying to figure out is this: do I need to try and determine a
formula for the sizes that should be used for main heap and stat segment
based on X number of routes and Y number of worker threads? Or is there a
downside to just setting the main heap size to 32G (which seems like a
number that is unlikely to ever be exhausted sans memory leaks)?

-Matt


On Mon, Jun 28, 2021 at 5:20 PM Pim van Pelt <p...@ipng.nl> wrote:

> Hoi Matt,
>
> Out of curiosity how large is your heap and stats segment? I ask because
> running VPP with a large FIB I needed 2G heap size (and I used page size of
> 2M), and 96M of statsseg:
>
> memory {
>   main-heap-size 3G
>   main-heap-page-size 2M
> }
>
> statseg {
>     socket-name /run/vpp/stats.sock
>     size 96M
>     per-node-counters off
> }
>
> On Mon, Jun 28, 2021 at 11:53 PM Matthew Smith via lists.fd.io <mgsmith=
> netgate....@lists.fd.io> wrote:
>
>> Hi all,
>>
>> It's my understanding that when you set the size of the main heap or the
>> stat segment in startup.conf, the size you specify is used to set up
>> virtual address space and the system does not actually allocate that full
>> amount of memory to VPP. I think when VPP tries to read/write addresses
>> within the address space, then memory is requested from the system to back
>> the chunk of address space containing the address being accessed. Is my
>> understanding correct(ish)?
>>
>> When I add a large number of routes to the FIB (>1M), I have seen VPP
>> crash when the main heap or stats segment run out of space. I am wondering
>> if it makes sense to just set the heap sizes to some huge value that I am
>> confident will not be exceeded. If memory is not allocated unless it's
>> needed, it seems like that would be ok to do.
>>
>> Thanks,
>> -Matt
>>
>>
>>
>> 
>>
>>
>
> --
> Pim van Pelt <p...@ipng.nl>
> PBVP1-RIPE - http://www.ipng.nl/
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19648): https://lists.fd.io/g/vpp-dev/message/19648
Mute This Topic: https://lists.fd.io/mt/83856384/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to