selenium icon indicating copy to clipboard operation
selenium copied to clipboard

Degradation of grid performance with release of v2.49.x and v2.50.x

Open schmidtkp opened this issue 10 years ago • 14 comments

It appears that the Selenium Grid functionality is degrading with each release since v2.48.2.

I've been running a Selenium grid for 3+ years with no issue until release v2.49.x and up. My grid is comprised of a hub running on a Linux VM and 56 nodes running on Windows 2008 server VM's. All nodes are registered to support Firefox (v43.0.4), Chrome v48. Versions of IE8-11 are also registered but distributed evenly across the 56 nodes.

During peek utilization of the grid, I see 100% utilization of the registered nodes and upwards of 40-60+ requests in the hub queue waiting for a slot to be free. As tests run I can see the hub queue increase/decrease and tests finish in a timely fashion. This is what we consider normal behavior with the grid pre-v2.49.x. Multiple teams use the grid from different geographical locations (hence the queue increase/decrease).

Since upgrading to v2.49.1 (with TIMEOUT fix, which now appears to have regressed in v2.50.0), the same grid configuration, same set of tests, etc, the grid (or test execution/webdriver?) degrades rapidly, such that tests that normally complete in 2-2.5 hours are still running after 6+ hours. We aborted the tests at this time since clearly something was amiss and our test efforts were being hindered and reverted back to v2.48.2.

I can visibly see activity on the nodes, albeit slow and sporadic - i.e. browsers opened on nodes, sendKeys/clicks/get happening periodically, but with very lengthy delays. It is as if there is a very lengthy pause/sleep happening between periods of webdriver requests, which normally are not present. Please note, the tests have not changed, no sleeps were added to the tests.

When I reverted back to v2.48.2 the grid behavior goes back to what we consider normal behavior. Same behavior with node utilization, hub queue requests, etc.

I've inspected the logs, monitored CPU/memory utilization to try and identify anything that might give me a hint as to what is causing this behavioral change in the grid (or webdriver?), but nothing seems to be out of the ordinary.

I create my hub/nodes via Java API's. With v2.49.x there was some code refactoring with SelfRegisteringRemote (and other classes) that required me to explicitly call SelfRegisteringRemote.setRemoteServer(), as the creation of the SeleniumSever() was removed from SelfRegisteringRemote.startRemoteServer(). Without this change my nodes would not register to the hub.

Are there additional code changes that I need to make with respect to hub/node creation/registration that I'm missing? I cannot find any documentation that might address it.

In addition, (I believe it has already been reported), the TIMEOUT issue introduced in v2.49.0 and fixed in v2.49.1 now appears to be back in v2.50.0:

org.openqa.selenium.WebDriverException: Session [981f8342-ae79-4424-8910-0b59f1ddb084] was terminated due to TIMEOUT

With v2.50.0 I'm now seeing sporadically this:

org.openqa.selenium.WebDriverException: The FirefoxDriver cannot be used after quit() was called.

Again, I have made absolutely no code changes in my Selenium grid configuration, creation of hub/nodes, except for adding a call to SelfRegisteringRemote.setRemoteServer(), or test sets being run between v2.48.2, 2.49.0, 2.49.1, and 2.50.0.

Again, if I revert back to v2.48.2 everything works just fine with the grid and test sets.

The only thing I can see that might be causing this is the refactoring work being done to decouple the RC server stuff.

I'm willing to work with whomever to try and isolate/understand this issue.

schmidtkp avatar Jan 29 '16 17:01 schmidtkp

Having same issue @schmidtkp #1564 :(

pi4r0n avatar Jan 29 '16 17:01 pi4r0n

Timeout issue is fixed in 2.50.1

For the degradation issiue we need more information on what's is slow -- browser startup, command execution, or what?

barancev avatar Jan 30 '16 18:01 barancev

@barancev - I really don't know what more I can give you. Like I said in the issue, I have 56 nodes registered with the hub. I can see all nodes getting utilized, browser opens (I do not know what I can do to measure this), I can see commands being issued (I don't know how to measure this), but overall a set of tests that have historically only taking 2-2.5 hours to run are taking in excess of 6-7+ hours (I killed them before they actually completed).

If I were to guess what the issue might be it would have something to do with command execution. When I RDC to a node I can witness a browser opened to a submission page which normally receives/processes commands fairly rapidly. Yet in this case I can observe that no activity happens for several minutes (4-5 minutes), and then all of a sudden there is a flurry of command being executed. The nothing again for several minutes. This happens across all the active nodes.

When I revert back to v2.48.2 and RDC to a node that is active I seldom get to see what is happening as the command execution is happening very quickly.

The overall slow-down seems to happen after the initial set of tests start to get executed and requests start to get queued to the hub.

Kendall

schmidtkp avatar Feb 01 '16 16:02 schmidtkp

@schmidtkp have you tried updating your grid to 2.52? I have a subset of nodes on that version that seem to be acting like normal. I'm about to deploy that update to the rest of my nodes (100+). I'll post back here if I encounter issues.

StephenCavender avatar Feb 22 '16 15:02 StephenCavender

@StephenCavender I have not upgraded our test grid to 2.52 yet. Little gun-shy :-). Can't afford to disrupt our test efforts just to test if it works or not. I have a very small window to perform upgrades and I have to be dead sure they work beforehand.

Did you experience a performance degradation with your grid post 2.48.2 as well?

I'd be curious to know your outcome of a full upgrade - good or bad.

schmidtkp avatar Feb 22 '16 15:02 schmidtkp

@barancev I've created another grid using v2.52.0 and I can definitely observe latency from when a test is initiated (run from IntelliJ using the built-in TestNG runner and a TestNG XML file) to the point I see a browser instance created/opened. This elapsed time is approximately 10-15 seconds. I measured this 10 times. There is also latency from the time the browser instance is created/opened/maximized until I can see the URL get request. Again, this is approximately another 10-15 seconds.

In my grid running v2.48.2 the latency for both measurements from above is 1-3 seconds respectively.

schmidtkp avatar Feb 26 '16 20:02 schmidtkp

@StephenCavender Did you upgrade your (100+ node) grid to 2.52 yet? Any noticeable performance issues observed?

schmidtkp avatar Feb 26 '16 20:02 schmidtkp

@schmidtkp Versions between 2.48.2 and 2.51 caused us issues. We had abundant timeouts. We upgrade the rest of our nodes to 2.52. A few people reported issues but they were using old language bindings. 2.52 has been stable so far for us.

StephenCavender avatar Mar 01 '16 01:03 StephenCavender

@StephenCavender Thanks for the feedback. I don't question stability (i.e. timeout issues), but rather the performance. It is substantially slower execution wise between 2.48.2 and 2.52.0. I don't even have to formally measure it, it is visible slower severing pages, entering text into a text field, etc. For us, it us unusable at this time.

schmidtkp avatar Mar 01 '16 16:03 schmidtkp

Even 2.52? Tests that I've run are having similar execution times as 2.48.2.

StephenCavender avatar Mar 01 '16 20:03 StephenCavender

@StephenCavender Our tests came to a screeching halt when I deployed 2.49.1 (first timeout fix). The performance of one of our test sets went from 2.5 hrs to over 7 hrs (I didn't bother to let them finish). So many teams where hammering me as to why the performance was so slow for tests that normally finished very quickly that I had to revert our grid back to 2.48.2. I didn't see anything in releases past 2.49.1 that would indicate anything related to performance was addressed, therefore, I have not upgrade as it has too great an impact to our corporate test efforts. Still researching as to what might be the root cause.

schmidtkp avatar Mar 01 '16 20:03 schmidtkp

Risk is too high. I'd be interested to hear what you find and if you're able to fix it.

StephenCavender avatar Mar 02 '16 14:03 StephenCavender

Updated our grid to v2.53.0 and performance is back to expected levels. Still do not know the root cause of the performance degradation initially encountered.

schmidtkp avatar Apr 12 '16 19:04 schmidtkp

Hi All,

I am trying to run selenium grid.

Currently I'm using v3.8.1 with one hub on 1 network and 20+ nodes of different networks registering to that selenium hub.

Its executing fast when hub and node are created on same machine where the application has deployed. Nodes created in other remote machines are comparatively slow.

Slow when we try to access particular Node by passing applicationName in capability instead of HUB selecting the node randomly.

More Info : Windows server 2008, Ruby gem - selenium-webdriver-2.53.4, selenium-server-standalone-3.8.1, Java 8.

Tried with these selenium grid versions - 2.48, 2.49, 2.52, 2.53 and 3.8.1

Any help on this is appreciated. Thank You.

vinutha5 avatar Mar 30 '18 09:03 vinutha5