ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Slow loading of nodes in docker

asked 2020-05-26 07:27:29 -0600

tompe17 gravatar image

It is very slow loading a node and nodelets inside a docker.

Loading outside the docker I get:

real    0m8,070s
user    0m29,146s
sys 0m3,882s

Inside the docker:

real    0m53.304s
user    0m56.128s
sys     0m48.309s

I load approximately 75 nodes and nodelets. Is anybody else seeing this? Is the file system still traversed for each node to load?

I want to distribute a docker image and let the user start the system in different ways. And they might start 3 "robots" so the time might be 3 minutes. That is not so good so I really would like to solve this issue.

/Tommy Persson

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-06-01 03:08:24 -0600

tompe17 gravatar image

I finally managed to find a workaround. If I added

 --ulimit nofile=1024

to my "docker run" command the loading of nodes and nodelets is very fast. Without this the value given by "ulimit -Hn" is above 1000000 (probably the maximum value). It seems to be a race condition or so that gives this high value. The value should really be the one you have in the shell were you start the docker container. If it is correct behaviour to be slow if this values is high I do not know.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-05-26 07:27:29 -0600

Seen: 672 times

Last updated: Jun 01 '20