*The Idea:*
Maybe the fancy solution is to have all of the hubs communicate to each
other, or a central dashboard that can query the Hubs to give a 'bigger
picture' view of the grid.
As a poor mans solution I would like to plop a load balancer in front of
the Hub.

*What I know* (correct me where I'm wrong)
In order to do that I need some sort of session stickiness.
Selenium/Grid isn't using sessions (in the JEE sense) it is using an
internal Test Session passed along in the url.
To accomplish this I'll need to do 2 things:
1) Identify all paths where that Session is passed along
2) Make that session uniquely tied to the hub so the loadbalancer can
identify which hub to route it to.

*My questions*
In Hub I see a number of servlets being registered.
- Is there any docs on the possible args passed to each (or do I have to
dig thru each servlet and map it myself?)
- Most important: When an actual test is being run, it appears that it is
going thru the DriverServlet (usually via
/wd/hub/session/{sessionnumber}).
Are there other places that session is passed along?

Thanks,
ken


Basically I'm trying to identify all urls where that session might be
passed in so I can make the load balancer understand them and also the
second half of

--

Search Discussions

  • Jason Leyba at Dec 18, 2012 at 1:34 am
    WebDriver uses exactly 1 servlet: DriverServlet. According to the JSON
    wire protocol <http://code.google.com/p/selenium/wiki/JsonWireProtocol>,
    the URI for every request targeting a specific session will start with
    /wd/hub/session/{sessionId}/. Note, the "/wd/hub/" prefix is actually the
    servlet path used on the Selenium server and is not part of our protocol.
    If you want to work independently of a servlet container, take a look
    at org.openqa.selenium.remote.server.JsonHttpRemoteConfig - that's where
    all the real work happens.

    -- Jason
    On Mon, Dec 17, 2012 at 12:44 PM, Kenneth Brooks wrote:

    *The Idea:*
    Maybe the fancy solution is to have all of the hubs communicate to each
    other, or a central dashboard that can query the Hubs to give a 'bigger
    picture' view of the grid.
    As a poor mans solution I would like to plop a load balancer in front of
    the Hub.

    *What I know* (correct me where I'm wrong)
    In order to do that I need some sort of session stickiness.
    Selenium/Grid isn't using sessions (in the JEE sense) it is using an
    internal Test Session passed along in the url.
    To accomplish this I'll need to do 2 things:
    1) Identify all paths where that Session is passed along
    2) Make that session uniquely tied to the hub so the loadbalancer can
    identify which hub to route it to.

    *My questions*
    In Hub I see a number of servlets being registered.
    - Is there any docs on the possible args passed to each (or do I have to
    dig thru each servlet and map it myself?)
    - Most important: When an actual test is being run, it appears that it is
    going thru the DriverServlet (usually via
    /wd/hub/session/{sessionnumber}).
    Are there other places that session is passed along?

    Thanks,
    ken


    Basically I'm trying to identify all urls where that session might be
    passed in so I can make the load balancer understand them and also the
    second half of

    --

    --
  • Kenneth Brooks at Dec 18, 2012 at 1:47 am
    Thanks.. the link to the JSON Wire Protocol helps a bunch.

    (and yeah, i saw that /wd/hub among others listed in Hub.java are just the
    context paths to the associated servlets).
    On Monday, December 17, 2012 8:34:27 PM UTC-5, Jason Leyba wrote:

    WebDriver uses exactly 1 servlet: DriverServlet. According to the JSON
    wire protocol <http://code.google.com/p/selenium/wiki/JsonWireProtocol>,
    the URI for every request targeting a specific session will start with
    /wd/hub/session/{sessionId}/. Note, the "/wd/hub/" prefix is actually the
    servlet path used on the Selenium server and is not part of our protocol.
    If you want to work independently of a servlet container, take a look
    at org.openqa.selenium.remote.server.JsonHttpRemoteConfig - that's where
    all the real work happens.

    -- Jason

    On Mon, Dec 17, 2012 at 12:44 PM, Kenneth Brooks <kenneth....@gmail.com<javascript:>
    wrote:
    *The Idea:*
    Maybe the fancy solution is to have all of the hubs communicate to each
    other, or a central dashboard that can query the Hubs to give a 'bigger
    picture' view of the grid.
    As a poor mans solution I would like to plop a load balancer in front of
    the Hub.

    *What I know* (correct me where I'm wrong)
    In order to do that I need some sort of session stickiness.
    Selenium/Grid isn't using sessions (in the JEE sense) it is using an
    internal Test Session passed along in the url.
    To accomplish this I'll need to do 2 things:
    1) Identify all paths where that Session is passed along
    2) Make that session uniquely tied to the hub so the loadbalancer can
    identify which hub to route it to.

    *My questions*
    In Hub I see a number of servlets being registered.
    - Is there any docs on the possible args passed to each (or do I have to
    dig thru each servlet and map it myself?)
    - Most important: When an actual test is being run, it appears that it is
    going thru the DriverServlet (usually via
    /wd/hub/session/{sessionnumber}).
    Are there other places that session is passed along?

    Thanks,
    ken


    Basically I'm trying to identify all urls where that session might be
    passed in so I can make the load balancer understand them and also the
    second half of

    --

    --
  • Kenneth Brooks at Dec 18, 2012 at 1:44 am
    I have stickied loadbalancing working (all done via apache
    mod_proxy_balancer and mod_header magic).
    It is just the poor mans solution since i still have to manually hit all of
    the hub instances to get the status of it and its associated nodes, but it
    is definitely workable.

    I still would like if someone would answer the questions about the session
    paths below because I believe that will possibly be useful if I'm to take
    this further.


    For those who care, here is basically what I did. I'm sure there is plenty
    more tweaking I can do as I'm not an apache expert by any means.

    2 Hubs, each hub had a node assigned to it.
    Everything running 2.25.0

    httpd.conf:
    Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/"
    env=BALANCER_ROUTE_CHANGED
    <Proxy balancer://mycluster>
    BalancerMember http://hub1.com:4444 route=1
    BalancerMember http://hub2.com:4445 route=2
    ProxySet stickysession=ROUTEID
    </Proxy>
    ProxyPass / balancer://mycluster/
    ProxyPassReverse / balancer://mycluster/

    This sets the cookie from apache (since selenium never starts its own
    container based session).
    Future requests from that client are routed to the same route (target hub)
    (1 or 2 in this case).


    On Monday, December 17, 2012 3:44:14 PM UTC-5, Kenneth Brooks wrote:

    *The Idea:*
    Maybe the fancy solution is to have all of the hubs communicate to each
    other, or a central dashboard that can query the Hubs to give a 'bigger
    picture' view of the grid.
    As a poor mans solution I would like to plop a load balancer in front of
    the Hub.

    *What I know* (correct me where I'm wrong)
    In order to do that I need some sort of session stickiness.
    Selenium/Grid isn't using sessions (in the JEE sense) it is using an
    internal Test Session passed along in the url.
    To accomplish this I'll need to do 2 things:
    1) Identify all paths where that Session is passed along
    2) Make that session uniquely tied to the hub so the loadbalancer can
    identify which hub to route it to.

    *My questions*
    In Hub I see a number of servlets being registered.
    - Is there any docs on the possible args passed to each (or do I have to
    dig thru each servlet and map it myself?)
    - Most important: When an actual test is being run, it appears that it is
    going thru the DriverServlet (usually via
    /wd/hub/session/{sessionnumber}).
    Are there other places that session is passed along?

    Thanks,
    ken


    Basically I'm trying to identify all urls where that session might be
    passed in so I can make the load balancer understand them and also the
    second half of
    --

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-developers @
categoriesselenium
postedDec 17, '12 at 8:58p
activeDec 18, '12 at 1:47a
posts4
users2
websiteseleniumhq.org

2 users in discussion

Kenneth Brooks: 3 posts Jason Leyba: 1 post

People

Translate

site design / logo © 2021 Grokbase