ApolloAuto / apollo

An open autonomous driving platform
Apache License 2.0
25.06k stars 9.68k forks source link

Poor performance for CyberRT in different docker containers on a single host pc. #15358

Open EternalSaga opened 6 months ago

EternalSaga commented 6 months ago

This issue reports an abnormal network performance problem when running CyberRT in Docker. I moved CyberRT into docker which uses CMake as the build tool according to this repo. Then I test the network performance through the cyber_recorder tool. Unfortunately, there're wired performant issues for cyberrt between two cyber containers.

System information

Steps for reproduce this issue.

This reproduction is based on standard apollo container which is built by bazel.

  1. Launch two standard Docker containers using docker compose. Here is an example docker compose file. Pay attention to containers' names and image names.
    
    # 在这个例子里,我们使用docker compose创建了两个容器,并将这两个容器放在同一个网络中,同时给容器指定了ip
    # 手动添加有关cyberrt ip的环境变量,进入容器后不用重新设置
    networks:
    cyber_net:
    ipam:
      config:
        - subnet: 192.168.50.0/24
          gateway: 192.168.50.1

services: cyber_1: image: "apolloauto/apollo:dev-x86_64-18.04-20240204_0555"#注意镜像名称 container_name: apollo_raw_container volumes:

2. Build apollo and launch the cyber_recorder to play the demo record in the first container. Then use the cyber_moniter in the second container.

enter container 2

docker exec -it apollo_raw_container2 bash

play the demo record

./bazel-bin/cyber/tools/cyber_recorder/cyber_recorder play -l -f ./sensor_rgb.record

enter container 1

docker exec -it apollo_raw_container bash

launch moniter

./bazel-bin/cyber/tools/cyber_monitor/cyber_monitor


3. The data transmission frequency between the two Cyber containers is extremely low, far below expectations.

![Screenshot 2024-04-01 165120](https://github.com/ApolloAuto/apollo/assets/15174504/f4dc03e0-6e58-4b9c-ac5a-6be0a2ec444f)
daohu527 commented 6 months ago

Can you determine whether it is a problem with cmake or a problem with bazel?

We will first try to test the bazel compilation situation

EternalSaga commented 6 months ago

Can you determine whether it is a problem with cmake or a problem with bazel?

We will first try to test the bazel compilation situation

This problem appears both on bazel and cmake.

EternalSaga commented 6 months ago

@daohu527 I also tested it on a kvm based ubuntu22.04 virtual machine. The CyberRT performance is still bad. Screenshot 2024-04-03 102802

zhangjianming0724 commented 2 months ago

hello ,Has the problem been resolved?

EternalSaga commented 2 months ago

hello ,Has the problem been resolved?

Unfortunately, no. Have you meet the same problem?

zhangjianming0724 commented 2 months ago

We need to deploy multiple cyberRT containers to one host for communication in a production environment