-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-21176] [Web UI] Limit number of selector threads for admin ui proxy servlets to 8 #18437
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,8 @@ import scala.language.implicitConversions | |
| import scala.xml.Node | ||
|
|
||
| import org.eclipse.jetty.client.api.Response | ||
| import org.eclipse.jetty.client.HttpClient | ||
| import org.eclipse.jetty.client.http.HttpClientTransportOverHTTP | ||
| import org.eclipse.jetty.proxy.ProxyServlet | ||
| import org.eclipse.jetty.server._ | ||
| import org.eclipse.jetty.server.handler._ | ||
|
|
@@ -208,6 +210,13 @@ private[spark] object JettyUtils extends Logging { | |
| rewrittenURI.toString() | ||
| } | ||
|
|
||
| override def newHttpClient(): HttpClient = { | ||
| // Use the Jetty logic to calculate the number of selector threads (#CPUs/2), | ||
| // but limit it to 8 max. | ||
| val numSelectors = math.max(1, math.min(8, Runtime.getRuntime().availableProcessors()/2)) | ||
|
||
| return new HttpClient(new HttpClientTransportOverHTTP(numSelectors), null) | ||
| } | ||
|
|
||
| override def filterServerResponseHeader( | ||
| clientRequest: HttpServletRequest, | ||
| serverResponse: Response, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also explain why we are limiting the number of selectors in the comment above?