2b-t / docker-realtime

Guide on how to use Docker for real-time applications with Linux and the Ubuntu realtime-kernel/PREEMPT_RT patch with a focus on robotics with ROS and ROS 2
MIT License
234 stars 27 forks source link

Latency Threshold in the example graphs #7

Closed elishafer closed 1 year ago

elishafer commented 1 year ago

In the Example section you have two graphs. One with docker and one without. It seems that the test without docker has a higher latency threshold than the one with docker. Do you perhaps know the reason why this happens? I would think that a system with docker would have a higher latency threshold.

2b-t commented 1 year ago

Hi @elishafer, I do not see a noticeable difference between the two graphs. The data was obtained by 5 minutes of benchmark and I would assume that any visible difference would be caused by the small sample size (normally you would run these tests for several hours/days) as well as background load. As Docker is based on abstractions on the Linux kernel level , it should achieve native performance on a Linux machine. After all a Docker container still uses the same kernel as the host system! The only aspects that might suffer a slight performance hit are those where some form of virtualization is involved, such as I/O and networking. Latter can be worked around by removing the isolation between the container's network stack and the host systems with net=host. For actual benchmarks you might have a look at this fairly old research paper from IBM (also available for free on IBM Research).

elishafer commented 1 year ago

Thanks for the quick and detailed response! Also thank you for your guides, your motivation section for academy really struck a chord with me.

2b-t commented 1 year ago

Glad to hear that! Let me know if we can close this issue.