Skip to content

Commit

Permalink
Merge pull request #4209 from sysown/v2.x_dns_cache_update_message
Browse files Browse the repository at this point in the history
Updated DNS Cache warning message.
  • Loading branch information
renecannao authored May 8, 2023
2 parents e9374a3 + a83921d commit 3dcc531
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/MySQL_Monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4627,8 +4627,8 @@ void* MySQL_Monitor::monitor_dns_cache() {
unsigned int qsize = dns_resolver_queue.size();
unsigned int num_threads = dns_resolver_threads.size();

if (qsize > static_cast<unsigned int>(mysql_thread___monitor_local_dns_resolver_queue_maxsize) / 8) {
proxy_warning("DNS resolver queue too big: %d\n", qsize);
if (qsize > (static_cast<unsigned int>(mysql_thread___monitor_local_dns_resolver_queue_maxsize) / 8)) {
proxy_warning("DNS resolver queue too big: %d. Please refer to https://proxysql.com/documentation/dns-cache/ for further information.\n", qsize);

unsigned int threads_max = num_dns_resolver_max_threads;

Expand Down Expand Up @@ -4669,16 +4669,16 @@ void* MySQL_Monitor::monitor_dns_cache() {
unsigned int qsize = dns_resolver_queue.size();
unsigned int num_threads = dns_resolver_threads.size();

if (qsize > static_cast<unsigned int>(mysql_thread___monitor_local_dns_resolver_queue_maxsize) / 8) {
proxy_warning("DNS resolver queue too big: %d\n", qsize);
if (qsize > (static_cast<unsigned int>(mysql_thread___monitor_local_dns_resolver_queue_maxsize) / 4)) {
proxy_warning("DNS resolver queue too big: %d. Please refer to https://proxysql.com/documentation/dns-cache/ for further information.\n", qsize);

unsigned int threads_max = num_dns_resolver_max_threads;

if (threads_max > num_threads) {
unsigned int new_threads = threads_max - num_threads;

if ((qsize / 8) < new_threads) {
new_threads = qsize / 8; // try to not burst threads
if ((qsize / 4) < new_threads) {
new_threads = qsize / 4; // try to not burst threads
}

if (new_threads) {
Expand Down

0 comments on commit 3dcc531

Please sign in to comment.