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 2022/12/28 04:22:48 UTC

[GitHub] [doris] spaces-X opened a new pull request, #15429: [Enhancement](jemalloc):support heap dump by http requst at runtime

spaces-X opened a new pull request, #15429:
URL: https://github.com/apache/doris/pull/15429

   
   # Proposed changes
   
   
   ## Problem summary
   
   1. Support heap dump in jemalloc by http requst at runtime
   2. Add the use of jemalloc heap profiling in the `debug-tool.md` doc
   ## Checklist(Required)
   
   1. Does it affect the original behavior: 
       - [ ] Yes
       - [ ] No
       - [ ] I don't know
   3. Has unit tests been added:
       - [ ] Yes
       - [ ] No
       - [ ] No Need
   4. Has document been added or modified:
       - [ ] Yes
       - [ ] No
       - [ ] No Need
   5. Does it need to update dependencies:
       - [ ] Yes
       - [ ] No
   6. Are there any changes that cannot be rolled back:
       - [ ] Yes (If Yes, please explain WHY)
       - [ ] No
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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


[GitHub] [doris] hello-stephen commented on pull request #15429: [Enhancement](jemalloc):support heap dump by http requst at runtime

Posted by GitBox <gi...@apache.org>.
hello-stephen commented on PR #15429:
URL: https://github.com/apache/doris/pull/15429#issuecomment-1366428888

   TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 34.96 seconds
    load time: 642 seconds
    storage size: 17122955933 Bytes
    https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20221228072308_clickbench_pr_69926.html


-- 
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


[GitHub] [doris] github-actions[bot] commented on a diff in pull request #15429: [Enhancement](jemalloc):support heap dump by http requst at runtime

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on code in PR #15429:
URL: https://github.com/apache/doris/pull/15429#discussion_r1058047997


##########
be/src/http/action/jeprofile_actions.cpp:
##########
@@ -0,0 +1,81 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "http/action/jeprofile_actions.h"
+
+#include <jemalloc/jemalloc.h>
+
+#include <ctime>
+#include <fstream>
+#include <mutex>
+#include <sstream>
+
+#include "common/config.h"
+#include "common/object_pool.h"
+#include "http/ev_http_server.h"
+#include "http/http_channel.h"
+#include "http/http_handler.h"
+#include "http/http_headers.h"
+#include "http/http_request.h"
+#include "util/file_utils.h"
+
+namespace doris {
+
+static std::mutex kJeprofileActionMutex;
+class JeHeapAction : public HttpHandler {
+public:
+    JeHeapAction() {}
+    virtual ~JeHeapAction() {}
+
+    virtual void handle(HttpRequest* req) override;
+};
+
+void JeHeapAction::handle(HttpRequest* req) {
+    std::lock_guard<std::mutex> lock(kJeprofileActionMutex);
+#ifndef USE_JEMALLOC
+    std::string str = "jemalloc heap dump is not available without setting USE_JEMALLOC";
+    HttpChannel::send_reply(req, str);
+#else
+    std::stringstream tmp_jeprof_file_name;
+    std::time_t now = std::time(0);

Review Comment:
   warning: use nullptr [modernize-use-nullptr]
   
   ```suggestion
       std::time_t now = std::time(nullptr);
   ```
   



##########
be/src/http/action/jeprofile_actions.cpp:
##########
@@ -0,0 +1,81 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "http/action/jeprofile_actions.h"
+
+#include <jemalloc/jemalloc.h>
+
+#include <ctime>
+#include <fstream>
+#include <mutex>
+#include <sstream>
+
+#include "common/config.h"
+#include "common/object_pool.h"
+#include "http/ev_http_server.h"
+#include "http/http_channel.h"
+#include "http/http_handler.h"
+#include "http/http_headers.h"
+#include "http/http_request.h"
+#include "util/file_utils.h"
+
+namespace doris {
+
+static std::mutex kJeprofileActionMutex;
+class JeHeapAction : public HttpHandler {
+public:
+    JeHeapAction() {}
+    virtual ~JeHeapAction() {}
+
+    virtual void handle(HttpRequest* req) override;

Review Comment:
   warning: 'virtual' is redundant since the function is already declared 'override' [modernize-use-override]
   
   ```suggestion
       void handle(HttpRequest* req) override;
   ```
   



##########
be/src/http/action/jeprofile_actions.cpp:
##########
@@ -0,0 +1,81 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "http/action/jeprofile_actions.h"
+
+#include <jemalloc/jemalloc.h>
+
+#include <ctime>
+#include <fstream>
+#include <mutex>
+#include <sstream>
+
+#include "common/config.h"
+#include "common/object_pool.h"
+#include "http/ev_http_server.h"
+#include "http/http_channel.h"
+#include "http/http_handler.h"
+#include "http/http_headers.h"
+#include "http/http_request.h"
+#include "util/file_utils.h"
+
+namespace doris {
+
+static std::mutex kJeprofileActionMutex;
+class JeHeapAction : public HttpHandler {
+public:
+    JeHeapAction() {}
+    virtual ~JeHeapAction() {}

Review Comment:
   warning: use '= default' to define a trivial destructor [modernize-use-equals-default]
   
   ```suggestion
       virtual ~JeHeapAction() = default;
   ```
   



##########
be/src/http/action/jeprofile_actions.cpp:
##########
@@ -0,0 +1,81 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "http/action/jeprofile_actions.h"
+
+#include <jemalloc/jemalloc.h>
+
+#include <ctime>
+#include <fstream>
+#include <mutex>
+#include <sstream>
+
+#include "common/config.h"
+#include "common/object_pool.h"
+#include "http/ev_http_server.h"
+#include "http/http_channel.h"
+#include "http/http_handler.h"
+#include "http/http_headers.h"
+#include "http/http_request.h"
+#include "util/file_utils.h"
+
+namespace doris {
+
+static std::mutex kJeprofileActionMutex;
+class JeHeapAction : public HttpHandler {
+public:
+    JeHeapAction() {}
+    virtual ~JeHeapAction() {}

Review Comment:
   warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override]
   
   ```suggestion
       ~JeHeapAction() override {}
   ```
   



##########
be/src/http/action/jeprofile_actions.cpp:
##########
@@ -0,0 +1,81 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "http/action/jeprofile_actions.h"
+
+#include <jemalloc/jemalloc.h>
+
+#include <ctime>
+#include <fstream>
+#include <mutex>
+#include <sstream>
+
+#include "common/config.h"
+#include "common/object_pool.h"
+#include "http/ev_http_server.h"
+#include "http/http_channel.h"
+#include "http/http_handler.h"
+#include "http/http_headers.h"
+#include "http/http_request.h"
+#include "util/file_utils.h"
+
+namespace doris {
+
+static std::mutex kJeprofileActionMutex;
+class JeHeapAction : public HttpHandler {
+public:
+    JeHeapAction() {}

Review Comment:
   warning: use '= default' to define a trivial default constructor [modernize-use-equals-default]
   
   ```suggestion
       JeHeapAction() = default;
   ```
   



-- 
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


[GitHub] [doris] yiguolei merged pull request #15429: [Enhancement](jemalloc):support heap dump by http request at runtime

Posted by GitBox <gi...@apache.org>.
yiguolei merged PR #15429:
URL: https://github.com/apache/doris/pull/15429


-- 
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


[GitHub] [doris] github-actions[bot] commented on a diff in pull request #15429: [Enhancement](jemalloc):support heap dump by http requst at runtime

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on code in PR #15429:
URL: https://github.com/apache/doris/pull/15429#discussion_r1058069590


##########
be/src/http/action/jeprofile_actions.cpp:
##########
@@ -0,0 +1,81 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "http/action/jeprofile_actions.h"
+
+#include <jemalloc/jemalloc.h>
+
+#include <ctime>
+#include <fstream>
+#include <mutex>
+#include <sstream>
+
+#include "common/config.h"
+#include "common/object_pool.h"
+#include "http/ev_http_server.h"
+#include "http/http_channel.h"
+#include "http/http_handler.h"
+#include "http/http_headers.h"
+#include "http/http_request.h"
+#include "util/file_utils.h"
+
+namespace doris {
+
+static std::mutex kJeprofileActionMutex;
+class JeHeapAction : public HttpHandler {
+public:
+    JeHeapAction() = default;
+    virtual ~JeHeapAction() = default;

Review Comment:
   warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override]
   
   ```suggestion
       ~JeHeapAction() override = default;
   ```
   



-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #15429: [Enhancement](jemalloc):support heap dump by http requst at runtime

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #15429:
URL: https://github.com/apache/doris/pull/15429#issuecomment-1366466134

   PR approved by at least one committer and no changes requested.


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #15429: [Enhancement](jemalloc):support heap dump by http requst at runtime

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #15429:
URL: https://github.com/apache/doris/pull/15429#issuecomment-1366466158

   PR approved by anyone and no changes requested.


-- 
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