You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by ji...@apache.org on 2022/05/03 14:48:24 UTC

[incubator-doris] 01/01: [fix]Add http header size parameter

This is an automated email from the ASF dual-hosted git repository.

jiafengzheng pushed a commit to branch new-jetty-http-header-size
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git

commit b43b071ebf8a5bb9c26c88ec669cb3f899356fc5
Author: jiafeng.zhang <zh...@gmail.com>
AuthorDate: Fri Apr 29 18:52:14 2022 +0800

    [fix]Add http header size parameter
    
    Add the http header size parameter to avoid failure due to too many fields when users import using stream load. The normal default is 8192, and 10K is given here.
---
 docs/en/admin-manual/config/fe-config.md                      |  6 ++++++
 docs/zh-CN/admin-manual/config/fe-config.md                   |  6 ++++++
 fe/fe-core/src/main/java/org/apache/doris/PaloFe.java         |  1 +
 fe/fe-core/src/main/java/org/apache/doris/common/Config.java  |  5 +++++
 .../src/main/java/org/apache/doris/httpv2/HttpServer.java     | 11 ++++++++++-
 5 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/docs/en/admin-manual/config/fe-config.md b/docs/en/admin-manual/config/fe-config.md
index 606d439f0c..0f304d0cc8 100644
--- a/docs/en/admin-manual/config/fe-config.md
+++ b/docs/en/admin-manual/config/fe-config.md
@@ -209,6 +209,12 @@ Default:100 * 1024 * 1024  (100MB)
 
 This is the maximum number of bytes of the file uploaded by the put or post method, the default value: 100MB
 
+### jetty_server_max_http_header_size
+
+Default:10240  (10K)
+
+http header size configuration parameter, the default value is 10K
+
 ### frontend_address
 
 Status: Deprecated, not recommended use. This parameter may be deleted later Type: string Description: Explicitly set the IP address of FE instead of using *InetAddress.getByName* to get the IP address. Usually in *InetAddress.getByName* When the expected results cannot be obtained. Only IP address is supported, not hostname. Default value: 0.0.0.0
diff --git a/docs/zh-CN/admin-manual/config/fe-config.md b/docs/zh-CN/admin-manual/config/fe-config.md
index b7025e8367..50b6754d78 100644
--- a/docs/zh-CN/admin-manual/config/fe-config.md
+++ b/docs/zh-CN/admin-manual/config/fe-config.md
@@ -207,6 +207,12 @@ workers 线程池默认不做设置,根据自己需要进行设置
 
 这个是 put 或 post 方法上传文件的最大字节数,默认值:100MB
 
+### jetty_server_max_http_header_size
+
+默认值:10240  (10K)
+
+http header size 配置参数
+
 ### `default_max_filter_ratio`
 
 默认值:0
diff --git a/fe/fe-core/src/main/java/org/apache/doris/PaloFe.java b/fe/fe-core/src/main/java/org/apache/doris/PaloFe.java
index 9c171404e3..91daef9eb5 100755
--- a/fe/fe-core/src/main/java/org/apache/doris/PaloFe.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/PaloFe.java
@@ -146,6 +146,7 @@ public class PaloFe {
             httpServer.setWorkers(Config.jetty_server_workers);
             httpServer.setMaxThreads(Config.jetty_threadPool_maxThreads);
             httpServer.setMinThreads(Config.jetty_threadPool_minThreads);
+            httpServer.setMaxHttpHeaderSize (Config.jetty_server_max_http_header_size);
             httpServer.start();
             
             qeService.start();
diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/Config.java b/fe/fe-core/src/main/java/org/apache/doris/common/Config.java
index 7b5e1e9978..37a60ddd8b 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/common/Config.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/common/Config.java
@@ -358,6 +358,11 @@ public class Config extends ConfigBase {
      */
     @ConfField public static int jetty_server_max_http_post_size = 100 * 1024 * 1024;
 
+    /**
+     * http header size configuration parameter, the default value is 10K
+     */
+    @ConfField public static int jetty_server_max_http_header_size = 10240;
+
     /**
      * Mini load disabled by default
      */
diff --git a/fe/fe-core/src/main/java/org/apache/doris/httpv2/HttpServer.java b/fe/fe-core/src/main/java/org/apache/doris/httpv2/HttpServer.java
index 020f9a9fe3..b130718fc6 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/httpv2/HttpServer.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/httpv2/HttpServer.java
@@ -41,10 +41,18 @@ public class HttpServer extends SpringBootServletInitializer {
     private int selectors;
     private int maxHttpPostSize ;
     private int workers;
-
+    private int maxHttpHeaderSize;
     private int minThreads;
     private int maxThreads;
 
+    public int getMaxHttpHeaderSize() {
+        return maxHttpHeaderSize;
+    }
+
+    public void setMaxHttpHeaderSize(int maxHttpHeaderSize) {
+        this.maxHttpHeaderSize = maxHttpHeaderSize;
+    }
+
     public int getMinThreads() { return minThreads; }
 
     public void setMinThreads(int minThreads) { this.minThreads = minThreads; }
@@ -92,6 +100,7 @@ public class HttpServer extends SpringBootServletInitializer {
         properties.put("server.jetty.selectors", this.selectors);
         properties.put("server.jetty.threadPool.maxThreads", this.maxThreads);
         properties.put("server.jetty.threadPool.minThreads", this.minThreads);
+        properties.put("server.max-http-header-size", this.maxHttpHeaderSize);
         //Worker thread pool is not set by default, set according to your needs
         if(this.workers > 0) {
             properties.put("server.jetty.workers", this.workers);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org