Global Controller spawning agents is currently sequential, and can be optimized with parallelism.
This happens in the ensure_instances function in ventis/controller/instance_manager.py, on line 33, "for agent_spec in self._agent_specs:"
Since the instance generations are independent of each other, a fix would be to add threading this function, which would speed up the "ventis deploy" command by a factor of the threads able to run on this function.
Main concerns:
- With threads being created simultaneously, host-port assignments will need to be put under a lock to prevent instances from taking the same host-port.
- Too many threads could cause the global controller instance to crash, limit the threads to machine resources.
- Need to make sure failed instances get re-instantiated rather than disappearing.
Link to the function:
|
def ensure_instances(self, agent_specs): |
Global Controller spawning agents is currently sequential, and can be optimized with parallelism.
This happens in the ensure_instances function in ventis/controller/instance_manager.py, on line 33, "for agent_spec in self._agent_specs:"
Since the instance generations are independent of each other, a fix would be to add threading this function, which would speed up the "ventis deploy" command by a factor of the threads able to run on this function.
Main concerns:
Link to the function:
canyoncodecore/ventis/controller/instance_manager.py
Line 29 in 62803c2