Comments (10)
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.
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.
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.
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.
Sorry for the misleading
from libvma.
But after adding initializing m_ready_conn_cnt in the constructor, seems still has the problem
from libvma.
by problem you mean 600% cpu?
using gstack, who do you see spining now?
from libvma.
Sorry, my mistake,
After initializing the variable to 0 in constructor, does solve the problem.
Thanks a lot for the help
from libvma.
thank you!
i updated the repo with the fix.
from libvma.
OrK fixed the issue back in Oct 2015.
closing the ticket...
from libvma.
Related Issues (20)
- can't sent/receive between internal threads with libvma HOT 4
- VMA TCP connect() call takes much longer than OS HOT 4
- Libvma : 8.9.4 arp caching HOT 4
- Use MADV_HUGEPAGE as ALLOC_TYPE_HUGEPAGES fallback
- NOT see any rocev2 packet HOT 9
- epoll_ctl EPOLL_CTL_MOD called incorrectly HOT 2
- issue: errno=111 Connection refused
- Rust TcpStream clone cannot send/recv through libvma HOT 5
- Unable to build libvma rpm follow the build instruction wiki HOT 2
- How do I fix the warning "Not enough hugepage resources for VMA memory allocation"?
- Running vma inside docker container HOT 9
- libvma uses huge amount of memory (~4x8G) with max RLIMIT_NOFILE HOT 2
- `libvma` load failed in some situation HOT 1
- `ibv_create_comp_channel` fails with ENOTTY (Inappropriate ioctl for device)
- Trouble Getting Timestamps in vma_recv_callback HOT 3
- failed to build libvma with gcc-12 HOT 5
- How to estimate a number of huge pages required by libvma? HOT 2
- Unable to find the libibverbs-devel header files HOT 2
- VMA support with Connectx-6 VPI HCAs HOT 3
- verify_qp_creation() QP creation failed on ConnectX-6 IPoIB interface HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libvma.