Closed Bug 1471201 Opened 3 years ago Closed 3 years ago

Increase Keep-Alive connection drop timeout


(Testing :: geckodriver, defect, P3)



(firefox63 fixed)

Tracking Status
firefox63 --- fixed


(Reporter: ato, Assigned: ato)




(1 file)

It was reported in various recent geckodriver issues, including but
not limited to,
that various (Selenium?) WebDriver clients do not have proper support
for HTTP/1.1 Keep-Alive connections.

Whilst increasing the inactive connection drop timeout duration
will not resolve the above problem (patches are needed in clients),
the default five second timeout that hyper operates with is probably
too low for regular WebDriver use.

whimboo did some investigation of this in
and there is some more background from me in
Priority: -- → P3
The question is, what would a good timeout duration be?

As I understand it the connection is kept alive for as long as it
remains active within the current five second period.  The problem
arises when the client opens a connection, issues a command, then
doesn’t do anything before the timeout elapses.  To slightly rephrase
the question: For how long would we expect a client to not provide
any data?
Blocks: 1466818
I actually don't have an idea right now. As already said on IRC if people see that when using eg. `time.sleep()` calls in their Selenium tests, they should first change those to make use of the `Wait` methods.

But something we have to count in for the timeout is clearly the network latency, which in nearly all of the cases shouldn't be that high. 

I would suggest we wait a bit longer and see how enabling keep-alive affects users.
See my comment
about why this change will not fundamentally fix the BadStatusLine
exceptions we are seeing reported in the Selenium Python client.

Due to _the nature_ of how WebDriver works it would benefit users
for the connection to persist longer.  WebDriver tests are usually
rather slow and the lifetime of continuous operations tends to be
longer than your average web document request.  Having to make fewer
HTTP connections for the duration of a test seems like a potential
performance win.
Assignee: nobody → ato
In our meeting on Monday we agreed we would increase the HTTPD
Keep-Alive timeout duration to 60 seconds:
Apparently the default Keep-Alive timeout in a more recent version
of hyper is 90 seconds.  I propose we use that number so that when
we upgrade to this newer version in the future, we will get the
hyper default without having to change this value twice.
Comment on attachment 8989966 [details]
Bug 1471201 - Increase webdriver HTTPD Keep-Alive timeout to 90s.
Attachment #8989966 - Flags: review?(dburns) → review+
Pushed by
Increase webdriver HTTPD Keep-Alive timeout to 90s. r=automatedtester
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.