Latency report: Rebranding and refine Dave dialog (#644)

This patch try to correct the latency report.

1. Rename Redis to Valkey.
2. Remove redundant Dave dialog, and refine the output message.

---------

Signed-off-by: Wenwen Chen <wenwen.chen@samsung.com>
Signed-off-by: hwware <wen.hui.ware@gmail.com>
This commit is contained in:
Wenwen-Chen 2024-06-14 18:56:59 +08:00 committed by GitHub
parent 8a776c3509
commit 4c6bf30f58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -216,9 +216,8 @@ sds createLatencyReport(void) {
* was never enabled so far. */ * was never enabled so far. */
if (dictSize(server.latency_events) == 0 && server.latency_monitor_threshold == 0) { if (dictSize(server.latency_events) == 0 && server.latency_monitor_threshold == 0) {
report = sdscat( report = sdscat(
report, "I'm sorry, Dave, I can't do that. Latency monitoring is disabled in this Redis instance. You may " report, "I'm sorry, Dave, I can't do that. Latency monitoring is disabled in this Valkey instance. You may "
"use \"CONFIG SET latency-monitor-threshold <milliseconds>.\" in order to enable it. If we weren't " "use \"CONFIG SET latency-monitor-threshold <milliseconds>.\" in order to enable it.\n");
"in a deep space mission I'd suggest to take a look at https://redis.io/topics/latency-monitor.\n");
return report; return report;
} }
@ -237,8 +236,7 @@ sds createLatencyReport(void) {
if (ts == NULL) continue; if (ts == NULL) continue;
eventnum++; eventnum++;
if (eventnum == 1) { if (eventnum == 1) {
report = sdscat(report, "Dave, I have observed latency spikes in this Redis instance. You don't mind " report = sdscat(report, "Latency spikes are observed in this Valkey instance.\n\n");
"talking about it, do you Dave?\n\n");
} }
analyzeLatencyForEvent(event, &ls); analyzeLatencyForEvent(event, &ls);
@ -358,18 +356,16 @@ sds createLatencyReport(void) {
} }
if (eventnum == 0 && advices == 0) { if (eventnum == 0 && advices == 0) {
report = sdscat(report, "Dave, no latency spike was observed during the lifetime of this Redis instance, not " report = sdscat(report, "No latency spike was observed during the lifetime of this Valkey instance, not "
"in the slightest bit. I honestly think you ought to sit down calmly, take a stress " "in the slightest bit.\n");
"pill, and think things over.\n");
} else if (eventnum > 0 && advices == 0) { } else if (eventnum > 0 && advices == 0) {
report = report = sdscat(report, "\nThere are latency events logged that are not easy to fix. Please get some "
sdscat(report, "\nWhile there are latency events logged, I'm not able to suggest any easy fix. Please use " "help from Valkey community, providing this report in your help request.\n");
"the Redis community to get some help, providing this report in your help request.\n");
} else { } else {
/* Add all the suggestions accumulated so far. */ /* Add all the suggestions accumulated so far. */
/* Better VM. */ /* Better VM. */
report = sdscat(report, "\nI have a few advices for you:\n\n"); report = sdscat(report, "\nHere is some advice for you:\n\n");
if (advise_better_vm) { if (advise_better_vm) {
report = sdscat(report, "- If you are using a virtual machine, consider upgrading it with a faster one " report = sdscat(report, "- If you are using a virtual machine, consider upgrading it with a faster one "
"using a hypervisior that provides less latency during fork() calls. Xen is known " "using a hypervisior that provides less latency during fork() calls. Xen is known "
@ -382,8 +378,8 @@ sds createLatencyReport(void) {
report = report =
sdscatprintf(report, sdscatprintf(report,
"- There are latency issues with potentially slow commands you are using. Try to enable " "- There are latency issues with potentially slow commands you are using. Try to enable "
"the Slow Log Redis feature using the command 'CONFIG SET slowlog-log-slower-than %llu'. " "the Slow Log Valkey feature using the command 'CONFIG SET slowlog-log-slower-than %llu'. "
"If the Slow log is disabled Redis is not able to log slow commands execution for you.\n", "If the Slow log is disabled Valkey is not able to log slow commands execution for you.\n",
(unsigned long long)server.latency_monitor_threshold * 1000); (unsigned long long)server.latency_monitor_threshold * 1000);
} }
@ -398,20 +394,20 @@ sds createLatencyReport(void) {
if (advise_slowlog_inspect) { if (advise_slowlog_inspect) {
report = sdscat(report, report = sdscat(report,
"- Check your Slow Log to understand what are the commands you are running which are too " "- Check your Slow Log to understand what are the commands you are running which are too "
"slow to execute. Please check https://redis.io/commands/slowlog for more information.\n"); "slow to execute. Please check https://valkey.io/commands/slowlog for more information.\n");
} }
/* Intrinsic latency. */ /* Intrinsic latency. */
if (advise_scheduler) { if (advise_scheduler) {
report = sdscat( report = sdscat(
report, report,
"- The system is slow to execute Redis code paths not containing system calls. This usually means the " "- The system is slow to execute Valkey code paths not containing system calls. This usually means the "
"system does not provide Redis CPU time to run for long periods. You should try to:\n" "system does not provide Valkey CPU time to run for long periods. You should try to:\n"
" 1) Lower the system load.\n" " 1) Lower the system load.\n"
" 2) Use a computer / VM just for Redis if you are running other software in the same system.\n" " 2) Use a computer / VM just for Valkey if you are running other software in the same system.\n"
" 3) Check if you have a \"noisy neighbour\" problem.\n" " 3) Check if you have a \"noisy neighbour\" problem.\n"
" 4) Check with 'redis-cli --intrinsic-latency 100' what is the intrinsic latency in your system.\n" " 4) Check with 'valkey-cli --intrinsic-latency 100' what is the intrinsic latency in your system.\n"
" 5) Check if the problem is allocator-related by recompiling Redis with MALLOC=libc, if you are " " 5) Check if the problem is allocator-related by recompiling Valkey with MALLOC=libc, if you are "
"using Jemalloc. However this may create fragmentation problems.\n"); "using Jemalloc. However this may create fragmentation problems.\n");
} }
@ -423,11 +419,11 @@ sds createLatencyReport(void) {
} }
if (advise_ssd) { if (advise_ssd) {
report = report = sdscat(report,
sdscat(report, "- SSD disks are able to reduce fsync latency, and total time needed for snapshotting " "- SSD disks are able to reduce fsync latency, and total time needed for snapshotting "
"and AOF log rewriting (resulting in smaller memory usage). With extremely high write " "and AOF log rewriting (resulting in smaller memory usage). With extremely high write "
"load SSD disks can be a good option. However Redis should perform reasonably with high " "load SSD disks can be a good option. However Valkey should perform reasonably with high "
"load using normal disks. Use this advice as a last resort.\n"); "load using normal disks. Use this advice as a last resort.\n");
} }
if (advise_data_writeback) { if (advise_data_writeback) {
@ -435,12 +431,12 @@ sds createLatencyReport(void) {
sdscat(report, "- Mounting ext3/4 filesystems with data=writeback can provide a performance boost " sdscat(report, "- Mounting ext3/4 filesystems with data=writeback can provide a performance boost "
"compared to data=ordered, however this mode of operation provides less guarantees, and " "compared to data=ordered, however this mode of operation provides less guarantees, and "
"sometimes it can happen that after a hard crash the AOF file will have a half-written " "sometimes it can happen that after a hard crash the AOF file will have a half-written "
"command at the end and will require to be repaired before Redis restarts.\n"); "command at the end and will require to be repaired before Valkey restarts.\n");
} }
if (advise_disk_contention) { if (advise_disk_contention) {
report = sdscat(report, "- Try to lower the disk contention. This is often caused by other disk intensive " report = sdscat(report, "- Try to lower the disk contention. This is often caused by other disk intensive "
"processes running in the same computer (including other Redis instances).\n"); "processes running in the same computer (including other Valkey instances).\n");
} }
if (advise_no_appendfsync) { if (advise_no_appendfsync) {
@ -464,7 +460,7 @@ sds createLatencyReport(void) {
} }
if (advise_hz && server.hz < 100) { if (advise_hz && server.hz < 100) {
report = sdscat(report, "- In order to make the Redis keys expiring process more incremental, try to set " report = sdscat(report, "- In order to make the Valkey keys expiring process more incremental, try to set "
"the 'hz' configuration parameter to 100 using 'CONFIG SET hz 100'.\n"); "the 'hz' configuration parameter to 100 using 'CONFIG SET hz 100'.\n");
} }
@ -477,19 +473,20 @@ sds createLatencyReport(void) {
if (advise_mass_eviction) { if (advise_mass_eviction) {
report = sdscat(report, "- Sudden changes to the 'maxmemory' setting via 'CONFIG SET', or allocation of " report = sdscat(report, "- Sudden changes to the 'maxmemory' setting via 'CONFIG SET', or allocation of "
"large objects via sets or sorted sets intersections, STORE option of SORT, Redis " "large objects via sets or sorted sets intersections, STORE option of SORT, Valkey "
"Cluster large keys migrations (RESTORE command), may create sudden memory " "Cluster large keys migrations (RESTORE command), may create sudden memory "
"pressure forcing the server to block trying to evict keys. \n"); "pressure forcing the server to block trying to evict keys. \n");
} }
if (advise_disable_thp) { if (advise_disable_thp) {
report = sdscat(report, "- I detected a non zero amount of anonymous huge pages used by your process. This " report =
"creates very serious latency events in different conditions, especially when " sdscat(report, "- I detected a non zero amount of anonymous huge pages used by your process. This "
"Redis is persisting on disk. To disable THP support use the command 'echo never > " "creates very serious latency events in different conditions, especially when "
"/sys/kernel/mm/transparent_hugepage/enabled', make sure to also add it into " "Valkey is persisting on disk. To disable THP support use the command 'echo never > "
"/etc/rc.local so that the command will be executed again after a reboot. Note " "/sys/kernel/mm/transparent_hugepage/enabled', make sure to also add it into "
"that even if you have already disabled THP, you still need to restart the Redis " "/etc/rc.local so that the command will be executed again after a reboot. Note "
"process to get rid of the huge pages already created.\n"); "that even if you have already disabled THP, you still need to restart the Valkey "
"process to get rid of the huge pages already created.\n");
} }
} }