gridrouter icon indicating copy to clipboard operation
gridrouter copied to clipboard

Updating Quota dynamically

Open dhorbach opened this issue 9 years ago • 1 comments

Hi,

My assumption is that quota.xml contains static list of hubs for balancing. What if we have scalable environment (hub servers are added dynamically) - is there any API to add new hubs to quota on top of default configuration? We can't restart gridrouter or selenograph because it might impact existing sessions.

This is different to what I requested in https://github.com/seleniumkit/gridrouter/issues/32 but related to the same scaling strategy - add new hub servers dynamically

Would be great to know what strategy you have in-house.

dhorbach avatar Sep 28 '16 19:09 dhorbach

@dhorbach currently gridrouter does two things: reads XML files on start and re-reads them on XML change. So if you dynamically change XML using some hooks from the cloud side - it will work. However having several instances of Gridrouter behind load balancer you can have a situation when one instance has already loaded a new XML and another one - has not. In that case with round-robin load balancing the following can happen:

  • You request a browser from already updated instance and get a session from a newly added host
  • The second request goes to another instance with old quota and fails with 404 because new hosts are not present in quota This state can last a few seconds and we know about it. However with sufficiently big number of hosts behind grid router this situation is not very probable.

You may also want to look at our recently open-sourced Selenium Hub replacement: https://github.com/seleniumkit/selenoud This stuff uses Docker API to start container with browser for each session. You can prepare containers for all browsers and have homogenous nodes with Selenoud behind GridRouter.

vania-pooh avatar Sep 29 '16 10:09 vania-pooh