Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebDriver holds many TCP ports #1452

Closed
Marrowbones opened this issue Jan 7, 2016 · 1 comment
Closed

WebDriver holds many TCP ports #1452

Marrowbones opened this issue Jan 7, 2016 · 1 comment
Assignees
Labels
C-java Java Bindings I-performance Something could be faster

Comments

@Marrowbones
Copy link

Hello,

Apologies if this isn't the right way to ask this, but I can't find much more information elsewhere.

We have written a Java WebDriver application that we run many concurrent instances of, each of which runs many multi-step Selenium tests. As the number of concurrent tests has inreased, we've occassionally been hitting "java.net.SocketException: No buffer space" exceptions. We've applied relevant OS level patches for similar problems, so it's not (just) that.

On further investigation, it seems that each WebDriver test holds dozens of ports open... and even after the driver has shut down cleanly, these are held in TIME_WAIT for some time.

Is this expected behaviour? It's causing us quite a few resource problems, with thousands of sockets stuck in TIME_WAIT.

For info, there seems to be many java > browser/driver and browser/driver connections, as well as (the more expected) browser > webpage sockets. Chrome seems to have less of the driver > Java connections than Firefox, but still has lots of the others. But generally it seems that every WebDriver interaction results in at least 3 sockets being hogged (Java > browser, browser > Java, browser <> webpage), sometimes more (example below)

Is this all expected? Might it be amended in future?

Cheers,
Marc

...
TCP 127.0.0.1:7055 COMPUTERNAME:64378 TIME_WAIT
TCP 127.0.0.1:7055 COMPUTERNAME:64380 TIME_WAIT
TCP 127.0.0.1:7055 COMPUTERNAME:64385 TIME_WAIT
TCP 127.0.0.1:7055 COMPUTERNAME:64409 ESTABLISHED
[firefox.exe]

...
TCP 127.0.0.1:64384 COMPUTERNAME:7055 TIME_WAIT
TCP 127.0.0.1:64386 COMPUTERNAME:7055 TIME_WAIT
TCP 127.0.0.1:64387 COMPUTERNAME:7055 TIME_WAIT
TCP 127.0.0.1:64409 COMPUTERNAME:7055 ESTABLISHED
[java.exe]

...
TCP 10.111.34.81:56076 webserver-02:8080 TIME_WAIT
TCP 10.111.34.81:56079 webserver-02:8080 ESTABLISHED
[firefox.exe]
TCP 10.111.34.81:56080 webserver-02:8080 ESTABLISHED
[firefox.exe]
TCP 10.111.34.81:56081 webserver-02:8080 ESTABLISHED
[firefox.exe]

@barancev barancev added the C-java Java Bindings label Jan 22, 2016
@barancev barancev added the I-performance Something could be faster label Sep 7, 2017
@barancev
Copy link
Member

barancev commented May 8, 2018

This issue has been resolved in Java binding by migration to OkHttp library (if target driver supports keep-alive).

For other bindings see #5758

@barancev barancev closed this as completed May 8, 2018
@lock lock bot locked and limited conversation to collaborators Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C-java Java Bindings I-performance Something could be faster
Projects
None yet
Development

No branches or pull requests

3 participants