question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[🐛 Bug]: Performance regression of Selenium 4.4

See original GitHub issue

What happened?

Hi, I upgraded Selenium server to 4.4, and now I constantly get 5x or even over 20x performance decrease in comparison to 4.3.

This happens on our Github Actions build, and is even more significant on my local Linux machine (without Docker).

This is a typical result for set of ~15 tests ( = 15 new session requests followed by few simple commands) on GH Actions: obrazek

Locally, the difference much more significant: from 5 seconds with 4.3.0 to 2 minutes with 4.4.0 (24x slower).

The test run is: https://github.com/OndraM/php-webdriver/actions/runs/2943219537

From what I noted from the Selenium log, with version 4.4, there is always a big delay before line Session request received by the Distributor, for example

13:35:01.350 DEBUG [DefaultChannelPool$IdleChannelDetector.run] - Closed 1 connections out of 1 in 0 ms
13:35:15.392 INFO [LocalDistributor.newSession] - Session request received by the Distributor: 

note the 15 seconds of no logged operation. While with 4.3.0 the events follow almost instantaneously, for example:

13:34:21.646 DEBUG [RequestConverter.channelRead0] - Closing input pipe.
13:34:21.661 INFO [LocalDistributor.newSession] - Session request received by the Distributor: 

For the tests, PHP language bindings for WebDriver are used - but the handshake and everything should be W3C WebDriver compatible, and was working OK with Selenium 4.3.0.

Please let me know if I can provide any more information or somehow help tracing the issue.

How can we reproduce the issue?

Run Github actions on branch https://github.com/OndraM/php-webdriver/tree/test/selenium-4-performance

Or run locally:

  1. git clone -b test/selenium-4-performance git@github.com:OndraM/php-webdriver.git
  2. cd php-webdriver/
  3. composer install
  4. (in new terminal) java -jar selenium-server-4.4.0.jar standalone
  5. (in new terminal) php -S 127.0.0.1:8000 -t tests/functional/web/
  6. vendor/bin/phpunit --filter WebDriverByTest -v --debug

Relevant log output

I enabled the finest log level, here are the test runs:

(Selenium server output is dumped at the end, in the “Prints log” part - search for cat ./logs/selenium-server.log)

Operating System

Ubuntu (Github Actions), Arch (locally)

Selenium version

4.4.0 (jar server), php-webdriver 1.12.1

What are the browser(s) and version(s) where you see this issue?

Chrome 104 (headless)

What are the browser driver(s) and version(s) where you see this issue?

Chromedriver 104.0.5112.79

Are you using Selenium Grid?

4.4.0 in standalone mode

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
AB-xdevcommented, Oct 5, 2022

So while comparing the changes between 4.3.0 and 4.4.0 I noticed that the DEFAULT_RETRY_INTERVAL was changed from 0 to 15 grafik (was done in this commit)

This exactly matches the delay observed in the issue which is always around 15s

So just for fun I set the --session-retry-interval to 0 (as it was before) however the problem was still present. When however setting it to 1 I was able to get a Server/Grid response within 2-3s instead of 15s.

So for now using --session-retry-interval 1 looks like a workaround.

1reaction
cbontecommented, Oct 14, 2022

@brondsem you can provide it with the SE_OPTS environment variable

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is New In Selenium 4 And What Is Deprecated In It?
In this blog, we will see some of the significant enhancements in Selenium 4. Also, we will cover some of the features that...
Read more >
investigating selenium usage challenges and reducing
While prior work uncovers some of the limitations of Selenium based on the experiences of using it, our work analyzes Selenium-related questions and...
Read more >
Upgrade to Selenium 4
Are you still using Selenium 3? This guide will help you upgrade to the latest release! Upgrading to Selenium 4 should be a...
Read more >
WebDriver Entire Setup and Installation with Eclipse
This is the 9th tutorial in Selenium Tutorial Training Series. In this tutorial, we would be discussing about the installation procedure to ...
Read more >
Selenium Documentation | Scholars at Harvard
4.4 SettingUpaSelenium -WebDriverProject . ... For regression testing this provides that responsiveness. ... Customized defect reporting.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found