Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow increasing Meshcat kMaxPort #19362

Closed
nepfaff opened this issue May 5, 2023 · 3 comments · Fixed by #19960
Closed

Allow increasing Meshcat kMaxPort #19362

nepfaff opened this issue May 5, 2023 · 3 comments · Fixed by #19960
Assignees
Labels
component: geometry illustration What and how geometry gets communicated to external visualizers type: feature request

Comments

@nepfaff
Copy link
Member

nepfaff commented May 5, 2023

Is your feature request related to a problem? Please describe.
At the moment, we are limited to 100 meshcat ports, and it is not possible to close a port without exiting the script that opened them. This is limiting if I want to run lots of simulations in a script and save the meshcat recording for each of them. This is a quite common scenario for me, and I keep running into this issue.

Describe the solution you'd like
From #15618, the reason for the current limit is docker:

Yes. I've made it 7099, since that's the number of ports that the docker instances open up for meshcat (but it's all pretty arbitrary, i guess... I've rarely needed more than 2!). I've added a comment in the constructor, which I think is the right place since we may offer passing a port number as a constructor option in the future.

I would suggest adding an option to specify a custom value for kMaxPort to allow overriding the docker-motivated limit.

@jwnimmer-tri jwnimmer-tri added the component: geometry illustration What and how geometry gets communicated to external visualizers label May 5, 2023
@ggould-tri
Copy link
Contributor

Assigning @joemasterjohn as component owner.

@jwnimmer-tri
Copy link
Collaborator

My vote would not be for a config option, but instead to bump up our kMaxPort constant to be much larger (32767, to stop before we hit linux's ephemeral ports range).

Or if we want a config option, it would be something like meshcat_params.listen = false; which would not bind any port number. The Meshcat object then could only be used for making recordings, not anything interactive.

@jwnimmer-tri
Copy link
Collaborator

jwnimmer-tri commented Aug 8, 2023

Once #19960 lands, the linear search range will be wider (1000 instead of 100).

More importantly for this use case, you can also specify port = 0 which will let the kernel assign a port number automatically from a pool of >16,000.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: geometry illustration What and how geometry gets communicated to external visualizers type: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants