rename dns_cache_max_size to dns_cache_max_entries

This commit is contained in:
Kirill Nikiforov 2024-02-29 02:32:13 +03:00
parent 2cc0da863e
commit 2744fc0c2d
7 changed files with 12 additions and 12 deletions

View File

@ -200,9 +200,9 @@ Type: Bool
Default: 0
## dns_cache_max_size
## dns_cache_max_entries
Internal DNS cache max size in bytes.
Internal DNS cache max entries.
:::note
ClickHouse also has a reverse cache, so the actual memory usage could be twice as much.
@ -210,7 +210,7 @@ ClickHouse also has a reverse cache, so the actual memory usage could be twice a
Type: UInt64
Default: 1048576
Default: 10000
## dns_cache_update_period

View File

@ -33,6 +33,6 @@ Result:
**See also**
- [disable_internal_dns_cache setting](../../operations/server-configuration-parameters/settings.md#disable_internal_dns_cache)
- [dns_cache_max_size setting](../../operations/server-configuration-parameters/settings.md#dns_cache_max_size)
- [dns_cache_max_entries setting](../../operations/server-configuration-parameters/settings.md#dns_cache_max_entries)
- [dns_cache_update_period setting](../../operations/server-configuration-parameters/settings.md#dns_cache_update_period)
- [dns_max_consecutive_failures setting](../../operations/server-configuration-parameters/settings.md#dns_max_consecutive_failures)

View File

@ -68,7 +68,7 @@ RELOAD FUNCTION [ON CLUSTER cluster_name] function_name
Clears ClickHouses internal DNS cache. Sometimes (for old ClickHouse versions) it is necessary to use this command when changing the infrastructure (changing the IP address of another ClickHouse server or the server used by dictionaries).
For more convenient (automatic) cache management, see disable_internal_dns_cache, dns_cache_max_size, dns_cache_update_period parameters.
For more convenient (automatic) cache management, see disable_internal_dns_cache, dns_cache_max_entries, dns_cache_update_period parameters.
## DROP MARK CACHE

View File

@ -1774,7 +1774,7 @@ try
}
else
{
DNSResolver::instance().setCacheMaxSize(server_settings.dns_cache_max_size);
DNSResolver::instance().setCacheMaxEntries(server_settings.dns_cache_max_entries);
/// Initialize a watcher periodically updating DNS cache
dns_cache_updater = std::make_unique<DNSCacheUpdater>(

View File

@ -289,10 +289,10 @@ void DNSResolver::setDisableCacheFlag(bool is_disabled)
impl->disable_cache = is_disabled;
}
void DNSResolver::setCacheMaxSize(const UInt64 cache_max_size)
void DNSResolver::setCacheMaxEntries(const UInt64 cache_max_entries)
{
impl->cache_address.setMaxSizeInBytes(cache_max_size);
impl->cache_host.setMaxSizeInBytes(cache_max_size);
impl->cache_address.setMaxSizeInBytes(cache_max_entries);
impl->cache_host.setMaxSizeInBytes(cache_max_entries);
}
String DNSResolver::getHostName()

View File

@ -52,8 +52,8 @@ public:
/// Disables caching
void setDisableCacheFlag(bool is_disabled = true);
/// Set a limit of cache size in bytes
void setCacheMaxSize(const UInt64 cache_max_size);
/// Set a limit of entries in cache
void setCacheMaxEntries(const UInt64 cache_max_entries);
/// Drops all caches
void dropCache();

View File

@ -81,7 +81,7 @@ namespace DB
M(UInt64, mmap_cache_size, DEFAULT_MMAP_CACHE_MAX_SIZE, "A cache for mmapped files.", 0) \
\
M(Bool, disable_internal_dns_cache, false, "Disable internal DNS caching at all.", 0) \
M(UInt64, dns_cache_max_size, (1024 * 1024), "Internal DNS cache max size in bytes.", 0) \
M(UInt64, dns_cache_max_entries, 10000, "Internal DNS cache max entries.", 0) \
M(Int32, dns_cache_update_period, 15, "Internal DNS cache update period in seconds.", 0) \
M(UInt32, dns_max_consecutive_failures, 10, "Max DNS resolve failures of a hostname before dropping the hostname from ClickHouse DNS cache.", 0) \
\