Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Selenium Grid availability - Add POOL_MAX support to increase thread count for Jetty Server #6772

Closed
lukeis opened this issue Mar 4, 2016 · 8 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 6772

We need to handle so many sessions, so we want to increase the thread count of Jetty
server, otherwise, it can only handle 245 threads.
We followed the method described in the wiki, set the POOL_MAX as VM parameter, but
it didn’t take effect.
And I read the code and saw nothing handled in the hub server.

Solution: Add thread count configuration support in Hub, then we can increase the thread
count handled by Jetty server.
------------------------------------------Hub.java----------------------------------------------------------------------
public void start() throws Exception {
initServer();
server.start();
int _max=Integer.getInteger("POOL_MAX",256).intValue();
((QueuedThreadPool)server.getThreadPool()).setMaxThreads(_max);

  }

Reported by shijunjuan on 2013-12-26 07:51:52

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by barancev on 2013-12-27 10:00:50

  • Labels added: Component-Grid

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

You're right that POOL_MAX currently has no effect on this thread pool. If we're going
to handle this in the Grid code it should be part of the normal grid configuration
(i.e. hub.json), not a system property.

If you want this to happen, please

a. Make sure you've signed the CLA at http://goo.gl/qC50R
2. Create a *patch* against the current master and attach it to this issue (the output
of `git diff` after making the necessary changes is fine).

Reported by jari.bakken on 2014-01-28 20:14:37

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by jari.bakken on 2014-01-28 23:53:23

  • Status changed: NeedsClarification

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Fixing it in configuration is fine. We just saw this property in the wiki https://code.google.com/p/selenium/wiki/Grid2

Could you please help fix it?

Reported by shijunjuan on 2014-01-29 06:15:37

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

diff --git a/java/server/src/org/openqa/grid/web/Hub.java b/java/server/src/org/openqa/grid/web/Hub.java
index 9871f17..cdfc80a 100644
--- a/java/server/src/org/openqa/grid/web/Hub.java
+++ b/java/server/src/org/openqa/grid/web/Hub.java
@@ -36,6 +36,7 @@
 import org.seleniumhq.jetty7.server.Server;
 import org.seleniumhq.jetty7.server.bio.SocketConnector;
 import org.seleniumhq.jetty7.servlet.ServletContextHandler;
+import org.seleniumhq.jetty7.util.thread.QueuedThreadPool;

 import java.net.MalformedURLException;
 import java.net.URL;
@@ -160,6 +161,8 @@ public String getHost() {
   public void start() throws Exception {
     initServer();
     server.start();
+    int _max=Integer.getInteger("POOL_MAX",256).intValue();
+    ((QueuedThreadPool)server.getThreadPool()).setMaxThreads(_max);
   }

   public void stop() throws Exception {

Reported by shijunjuan on 2014-01-29 06:59:07

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Above is my fix, but you could fix it based on your judgement. Thank you!

Reported by shijunjuan on 2014-01-29 06:59:46

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Fixed by revision 04b1676d6c

Reported by barancev on 2014-06-30 08:50:40

  • Status changed: Fixed

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by luke.semerau on 2015-09-17 18:21:53

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 4, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant