Giter Site home page Giter Site logo

Comments (10)

rosenbaumalex avatar rosenbaumalex commented on June 29, 2024

By design VMA is tuned to push each user application thread which is calling a socket receive API and this drives the VMA engine handle all packets. The lower latency is achieved by keeping this thread spinning on the HW until an ingress packet is received and then handling it in VMA.

This 'spinning' module is the default VMA configuration. You can turn off the high polling configuration but you'll loss the very good low latency performance.

The socket 'receive' APIs which push the Rx polling include:

  • recv() recvfrom(), recvmsg(), ...
  • select(), epoll_wait(), poll(), ...

So if you have 6 applicaton threads which use epoll() as their main loop so there is a high chance that your'll see 600% CPU (6 cores).

from libvma.

nijinboc avatar nijinboc commented on June 29, 2024

HI, I found that the value m_ready_conn_cnt is not zero (sometime seems very large number) that causes this piece of code in int sockinfo_tcp::rx_wait_helper(int &poll_count, bool is_blocking)

if (!m_n_rx_pkt_ready_list_count && !m_ready_conn_cnt)
{
going_to_sleep();
unlock_tcp_con();
}
else
{
unlock_tcp_con();
return 0;
}

never going_to_sleep();

from libvma.

orkmellanox avatar orkmellanox commented on June 29, 2024

it seems you are correct!
thanks for catching this.
the m_ready_conn_cnt was not initialized to 0 in the constructor, so it got random high numbers for non-listen (connected) sockets.

but this actually seem to affect the recv() call and not the epoll_wait() call.
am i missing something?

from libvma.

nijinboc avatar nijinboc commented on June 29, 2024

HI, initially I suspect that it is epoll_wait that causes the high CPU.
But after I adding some printf message in code, I found that it is the variable m_ready_conn_cnt that causes the problem.

from libvma.

nijinboc avatar nijinboc commented on June 29, 2024

Sorry for the misleading

from libvma.

nijinboc avatar nijinboc commented on June 29, 2024

But after adding initializing m_ready_conn_cnt in the constructor, seems still has the problem

from libvma.

orkmellanox avatar orkmellanox commented on June 29, 2024

by problem you mean 600% cpu?
using gstack, who do you see spining now?

from libvma.

nijinboc avatar nijinboc commented on June 29, 2024

Sorry, my mistake,
After initializing the variable to 0 in constructor, does solve the problem.
Thanks a lot for the help

from libvma.

orkmellanox avatar orkmellanox commented on June 29, 2024

thank you!
i updated the repo with the fix.

from libvma.

rosenbaumalex avatar rosenbaumalex commented on June 29, 2024

OrK fixed the issue back in Oct 2015.
closing the ticket...

from libvma.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.