Skip to content

Commit

Permalink
Add request/response header size for JettyServer
Browse files Browse the repository at this point in the history
  • Loading branch information
minyk committed Mar 6, 2024
1 parent 2e7b95c commit f4bbc6f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,20 @@ object KyuubiConf {
.timeConf
.createWithDefaultString("PT5S")

val FRONTEND_REST_JETTY_HTTP_REQUEST_HEADER_SIZE: ConfigEntry[Int] =
buildConf("kyuubi.frontend.rest.jetty.http.request.header.size")
.doc("Request header size in bytes.")
.version("1.8.1")
.intConf
.createWithDefault(6144)

val FRONTEND_REST_JETTY_HTTP_RESPONSE_HEADER_SIZE: ConfigEntry[Int] =
buildConf("kyuubi.frontend.rest.jetty.http.response.header.size")
.doc("Reponse header size in bytes.")
.version("1.8.1")
.intConf
.createWithDefault(6144)

val FRONTEND_WORKER_KEEPALIVE_TIME: ConfigEntry[Long] =
buildConf("kyuubi.frontend.worker.keepalive.time")
.doc("(deprecated) Keep-alive time (in milliseconds) for an idle worker thread")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ class KyuubiRestFrontendService(override val serverable: Serverable)
host,
port,
conf.get(FRONTEND_REST_MAX_WORKER_THREADS),
conf.get(FRONTEND_REST_JETTY_STOP_TIMEOUT))
conf.get(FRONTEND_REST_JETTY_STOP_TIMEOUT),
conf.get(FRONTEND_REST_JETTY_HTTP_REQUEST_HEADER_SIZE),
conf.get(FRONTEND_REST_JETTY_HTTP_RESPONSE_HEADER_SIZE))
super.initialize(conf)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ object JettyServer {
host: String,
port: Int,
poolSize: Int,
stopTimeout: Long): JettyServer = {
stopTimeout: Long,
maxRequestSize: Int,
maxResponseSize: Int): JettyServer = {
val pool = new QueuedThreadPool(poolSize)
pool.setName(name)
pool.setDaemon(true)
Expand All @@ -95,6 +97,8 @@ object JettyServer {

val serverExecutor = new ScheduledExecutorScheduler(s"$name-JettyScheduler", true)
val httpConf = new HttpConfiguration()
httpConf.setRequestHeaderSize(maxRequestSize)
httpConf.setResponseHeaderSize(maxResponseSize)
val connector = new ServerConnector(
server,
null,
Expand Down

0 comments on commit f4bbc6f

Please sign in to comment.