What we did was to count clock cycles (timestamps) spent processing the nodes, call this busy, and count the clock cycles spent elsewhere, call this idle. And then simply output (busy/(busy + idle). We did this per thread and stored the calculations globally. We then outputted the calculations on the ‘vppctl show thread’ cli.
This created a nice cpu usage metric that seems pretty accurate for io and worker threads… We compared this to something like htop for the worker threads and its within ~1%, the io cores seem the same as we can see the usage go to about 80-90% when we start dropping packets. We are able to calculate the approx. PPS for a given system configuration. It actually wasn’t a lot of effort. I think only three files were touched. 1. A new header file o create the global data structure to hold the clock cycle counts and associated macros to init and update the structures. 2. Vlib/main.c to instrument the main loop and collect the busy/idle clock cycles 3. Vlib threads_cli.c as show threads fn was used to output the cpu usage per thread. From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of Nick Zavaritsky Sent: Tuesday, December 15, 2020 1:38 PM To: ramukmar1...@gmail.com Cc: vpp-dev@lists.fd.io Subject: Re: [vpp-dev] Core Load Calculation We’ve been using flamegraphs quite successfully to see how much leeway is there. Ex: https://gist.githack.com/mejedi/d5d094df63faba66d413a677fcef26e3/raw/95294d36c4b180ba6741d793bf345041b00af48e/g.svg On 15 Dec 2020, at 19:53, Ramkumar B via lists.fd.io <ramukmar1998=gmail....@lists.fd.io <mailto:ramukmar1998=gmail....@lists.fd.io> > wrote: Hello All, I'm trying to calculate VPP core's load. I completely understand about the polling cores' 100% CPU usage. My requirement is different where I need to calculate the core's load based on how much more PPS it can handle before a packet drop occurs in the queue. The vec/call is a good indicator of load, but it does not increase linearly with PPS. This is because of the VPP's self balancing behaviour where the cost per packet reduces as load increases. It would be a great help if anyone can point out factors to calculate load. Thanks and regards, Ramkumar Balu
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#18348): https://lists.fd.io/g/vpp-dev/message/18348 Mute This Topic: https://lists.fd.io/mt/78980301/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-