For optimal performance, we recommend that people integrate their applications 
with VCL. LDP functionally supports a number of applications, but for certain 
scenarios it is not optimal. 

In particular, it is not efficient when the application is heavily threaded 
because VLS (shim between VCL and LDP) does a lot of locking to ensure that 
file descriptors are not simultaneously accessed from multiple threads. 
Compared to applications that use multiple processes as workers (e.g., nginx) 
in multi-threaded scenarios, LDP + VLS do not register those threads as new 
workers because they can’t know which of the app’s threads are actual workers. 

Regarding epoll, the current implementation is inefficient if the application 
needs to epoll wait blocking (timeout is -1) or with a positive timeout on both 
linux fds and vcl sessions. That’s because message queue notifications from vpp 
cannot be linux epolled if the message queues use mutex-condvars, so we end up 
alternatively polling linux fds and vcl sessions with zero timeout (busy wait). 
Going forward we may enforce eventfd mq notifications only with ldp, so this 
could be solved. 

Finally, if app polls the fds by setting timeout to 0, I’d expect the 
application’s poll loop (which includes epoll) to use most of the cpu. 

Florin

> On Nov 24, 2019, at 6:24 AM, [email protected] wrote:
> 
> I test nginx with ldp, then nginx work well, but the cpu to hight. ldp thread 
> cpu usage is 100% and the cpu mostly wasted at epoll function.
> The test apache jmeter with ldp is more worse. Jmeter will start thousand 
> threads, When simulating multiple users for http perf test.
> And each java thread call the select with 0 timeout, and ldp select function 
> will make cpu 100% busy. -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> 
> View/Reply Online (#14681): https://lists.fd.io/g/vpp-dev/message/14681
> Mute This Topic: https://lists.fd.io/mt/61875428/675152
> Group Owner: [email protected]
> Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [[email protected]]
> -=-=-=-=-=-=-=-=-=-=-=-

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#14685): https://lists.fd.io/g/vpp-dev/message/14685
Mute This Topic: https://lists.fd.io/mt/61875428/21656
Group Owner: [email protected]
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to