apache / doris

Apache Doris is an easy-to-use, high performance and unified analytics database.
https://doris.apache.org
Apache License 2.0
12.54k stars 3.24k forks source link

[Enhancement] task worker pool name should be distinguished in top -H #32321

Open dataroaring opened 7 months ago

dataroaring commented 7 months ago

Search before asking

Description

When a be is running, we can distinguish the thread name of taskworkerpool. The default name is too long.

be/src/agent/task_worker_pool.cpp

Solution

No response

Are you willing to submit PR?

Code of Conduct

Bears0haunt commented 7 months ago

i'd like to try

XEurekaX commented 7 months ago

i'm willing to try

AcKing-Sam commented 7 months ago

@dataroaring Hi, I want to try this issue. I read the source file and did not understand clearly the problem. Could you please make a detailed example? (Like, from what to what?) Thanks! :)

dataroaring commented 7 months ago

@dataroaring Hi, I want to try this issue. I read the source file and did not understand clearly the problem. Could you please make a detailed example? (Like, from what to what?) Thanks! :)

TaskWorkerPool::TaskWorkerPool(std::string_view name, int worker_count, std::function<void(const TAgentTaskRequest& task)> callback) : _callback(std::move(callback)) { auto st = ThreadPoolBuilder(fmt::format("TaskWorkerPool.{}", name)) .set_min_threads(worker_count) .set_max_threads(worker_count) .build(&_thread_pool); CHECK(st.ok()) << name << ": " << st; }

Here TaskWorkerPool.xxx is name of the worker thread. However, when we use top -H in linux, thread num is cut, so we just see TaskWor. We can name it TWP{name}, names also should be short.

133tosakarin commented 7 months ago

i have no experience, can i try?