There is no such thing as a free lunch.

If you force a fresh allocation measured in gigabytes, the memory allocator 
will mmap(...) a bunch of (4k) pages which will incur (expensive) pagefaults as 
they’re populated. Vec_validate(...) copies data when necessary. When 
structures grow to gigabytes, that takes a measurable amount of time and will 
almost certainly result in packet drops.

Preallocation is the only strategy for avoiding packet drops when data 
structures expand beyond a certain size. Either that, or simply accept 
vector-size excursions until vpp reaches steady state: at that point, data 
structures shouldn’t have to expand, and you shouldn’t drop any more packets.

Note that vec_reset_length(v) is highly preferable to constant cycling of fresh 
large vectors from vec_validate(...) / vec_add1(...) to vec_free(...).

HTH... D.


From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of 
david.leitch....@gmail.com
Sent: Wednesday, October 24, 2018 11:06 AM
To: vpp-dev@lists.fd.io
Subject: Re: [vpp-dev] Memory Performance issue #vpp


[Edited Message Follows]
Do you mean it is impossible to have packet processing and memory operation at 
the same time,
for example doing vec_validate or vec_free when NAT plugin is working and 
create new session.

I have drop rate when vec_free or vec_vlidate for memory size greater than 3GB.

What are your suggestions for such problems?
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#10961): https://lists.fd.io/g/vpp-dev/message/10961
Mute This Topic: https://lists.fd.io/mt/27615950/21656
Mute #vpp: https://lists.fd.io/mk?hashtag=vpp&subid=1480452
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-
  • [... david . leitch . vpp
    • ... Matus Fabian -X (matfabia - PANTHEON TECHNOLOGIES@Cisco) via Lists.Fd.Io
      • ... david . leitch . vpp
        • ... Dave Barach via Lists.Fd.Io
          • ... david . leitch . vpp
          • ... david . leitch . vpp
            • ... Dave Barach via Lists.Fd.Io

Reply via email to