You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/07/05 05:26:36 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #6149: Switch SpringBoot built-in container to jetty

morningman commented on a change in pull request #6149:
URL: https://github.com/apache/incubator-doris/pull/6149#discussion_r663644182



##########
File path: fe/fe-core/src/main/java/org/apache/doris/httpv2/HttpServer.java
##########
@@ -63,11 +73,18 @@ public void start(String dorisHome) {
         properties.put("spring.http.encoding.charset", "UTF-8");
         properties.put("spring.http.encoding.enabled", true);
         properties.put("spring.http.encoding.force", true);
-        properties.put("spring.servlet.multipart.max-file-size", this.maxFileSize);
-        properties.put("spring.servlet.multipart.max-request-size", this.maxRequestSize);
+        //enable jetty config
+        properties.put("server.jetty.acceptors", this.acceptors);
+        properties.put("server.jetty.max-http-post-size", this.maxHttpPostSize);
+        properties.put("server.jetty.selectors", this.selectors);
+        //Worker thread pool is not set by default, set according to your needs
+        if(this.workers <= 0) {

Review comment:
       ```suggestion
           if(this.workers > 0) {
   ```

##########
File path: fe/fe-core/src/main/java/org/apache/doris/common/Config.java
##########
@@ -326,10 +326,26 @@
     @ConfField public static int http_backlog_num = 1024;
 
     /**
-     *Maximum file limit for single upload of web request, default value: 100MB
+     * Jetty container default configuration
+     * Jetty's thread architecture model is very simple, divided into three thread pools:
+     * acceptors,selectors and workers. Acceptors are responsible for accepting new connections,
+     * and then hand over to selectors to process the unpacking of the HTTP message protocol,
+     * and finally workers process the request. The first two thread pools adopt a non-blocking model,
+     * and one thread can handle the read and write of many sockets, so the number of thread pools is small.
+     *
+     * For most projects, only 1-2 acceptors threads are needed, and 2 to 4 selectors threads are sufficient.
+     * Workers are obstructive business logic, often have more database operations, and require a large number of threads. T
+     * he specific number depends on the proportion of QPS and IO events of the application. The higher the QPS,
+     * the more threads are required, the higher the proportion of IO,
+     * the more threads waiting, and the more total threads required.
+     */
+    @ConfField public static int jetty_server_acceptors = 2;
+    @ConfField public static int jetty_server_selectors = 4;
+    @ConfField public static int jetty_server_workers = 0;
+    /**
+     * jetty Maximum number of bytes in put or post method,default:2G
      */
-    @ConfField public static String http_max_file_size = "100MB";
-    @ConfField public static String http_max_request_size = "100MB";
+    @ConfField public static int jetty_server_max_http_post_size = 2 * 1024 * 1024 * 1024;

Review comment:
       `jetty_server_max_http_post_size` is only for UploadAction, which is used for user to upload demo data from Web UI. So the file size should be small. I think the default 100MB is enough, otherwise, the user may upload large file to occupy the FE node's disk.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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