Skip to content

Commit aa9a567

Browse files
committed
modify
1 parent 21ce137 commit aa9a567

4 files changed

Lines changed: 4 additions & 13 deletions

File tree

conf/pika.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ thread-pool-size : 12
3131
# This parameter is used to control whether to separate fast and slow commands.
3232
# When slow-cmd-pool is set to yes, fast and slow commands are separated.
3333
# When set to no, they are not separated.
34-
slow-cmd-pool : yes
34+
slow-cmd-pool : no
3535

3636
# Enable thread pool borrowing mechanism, which allows threads to help each other when one pool is busy
3737
# and another is idle. This can improve resource utilization and reduce command latency under uneven load.
@@ -66,7 +66,7 @@ slow-cmd-thread-pool-size : 1
6666
admin-thread-pool-size : 2
6767

6868
# Slow cmd list e.g. hgetall, mset
69-
slow-cmd-list : keys
69+
slow-cmd-list :
7070

7171
# List of commands considered as administrative. These commands will be handled by the admin thread pool. Modify this list as needed.
7272
# Default commands: info, ping, monitor

src/pika_admin.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2730,7 +2730,7 @@ void ConfigCmd::ConfigSet(std::shared_ptr<DB> db) {
27302730
g_pika_conf->SetThreadPoolSize(static_cast<int>(thread_pool_size));
27312731
res_.AppendStringRaw("+OK\r\n");
27322732
} else if (set_item == "slow-cmd-thread-pool-size") {
2733-
if (pstd::string2int(value.data(), value.size(), &ival) == 0 || ival <= 0 || ival > 1024) {
2733+
if (pstd::string2int(value.data(), value.size(), &ival) == 0 || ival <= 0 || ival > 24) {
27342734
res_.AppendStringRaw("-ERR Invalid argument \'" + value + "\' for CONFIG SET 'slow-cmd-thread-pool-size'\r\n");
27352735
return;
27362736
}

src/pika_client_conn.cc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -428,15 +428,6 @@ bool PikaClientConn::ReadCmdInCache(const net::RedisCmdArgsType& argv, const std
428428
time_stat_->process_done_ts_ = pstd::NowMicros();
429429
(*cmdstat_map)[argv[0]].cmd_count.fetch_add(1);
430430
(*cmdstat_map)[argv[0]].cmd_time_consuming.fetch_add(time_stat_->total_time());
431-
432-
uint64_t duration_us = time_stat_->total_time();
433-
ThreadPoolMetrics* metrics = (task_pool_type_ == TaskPoolType::kSlowCmdPool)
434-
? g_pika_server->GetSlowPoolMetrics()
435-
: g_pika_server->GetFastPoolMetrics();
436-
if (metrics) {
437-
metrics->RecordLatency(duration_us);
438-
metrics->tasks_completed.fetch_add(1, std::memory_order_relaxed);
439-
}
440431
resp_array.emplace_back(std::make_shared<std::string>(std::move(c_ptr->res().message())));
441432
TryWriteResp();
442433
}

src/pika_server.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ void PikaServer::ScheduleClientPool(net::TaskFunc func, void* arg, bool is_slow_
836836
return;
837837
}
838838
// if slow cmd thread pool disabled
839-
if(!g_pika_conf->slow_cmd_pool()) {
839+
if (!g_pika_conf->slow_cmd_pool()) {
840840
pika_client_processor_->SchedulePool(func, arg);
841841
return;
842842
}

0 commit comments

Comments
 (0)