DNS resolver cache configuration.
---
+ garbage_collector: Automatically use garbage collector to periodically clear cache.
storage: Cache storage of the DNS resolver.
size_max: Maximum size of the cache.
ttl_min: Minimum time-to-live for the cache entries.
prefill: Prefill the cache periodically by importing zone data obtained over HTTP.
"""
+ garbage_collector: bool = True
storage: CheckedPath = CheckedPath("/var/cache/knot-resolver")
size_max: SizeUnit = SizeUnit("100M")
ttl_min: TimeUnit = TimeUnit("5s")
hostname: Internal DNS resolver hostname. Default is machine hostname.
nsid: Name Server Identifier (RFC 5001) which allows DNS clients to request resolver to send back its NSID along with the reply to a DNS request.
workers: The number of running kresd (Knot Resolver daemon) workers. If set to 'auto', it is equal to number of CPUs available.
- use_cache_gc: Use (start) kres-cache-gc (cache garbage collector) automatically.
backend: Forces the manager to use a specific service supervisor.
watchdog: Disable systemd watchdog, enable with defaults or set new configuration. Can only be used with 'systemd' backend.
rundir: Directory where the resolver can create files and which will be it's cwd.
hostname: Optional[str] = None
nsid: Optional[str] = None
workers: Union[Literal["auto"], IntPositive] = IntPositive(1)
- use_cache_gc: bool = True
backend: BackendEnum = "auto"
watchdog: Union[bool, WatchDogSchema] = True
rundir: UncheckedPath = UncheckedPath(".")
hostname: str
nsid: Optional[str]
workers: IntPositive
- use_cache_gc: bool
backend: BackendEnum = "auto"
watchdog: Union[bool, WatchDogSchema]
rundir: UncheckedPath = UncheckedPath(".")
await self._ensure_number_of_children(config, int(config.server.workers))
await self._rolling_restart(config)
- if self._is_gc_running() != config.server.use_cache_gc:
- if config.server.use_cache_gc:
+ if self._is_gc_running() != config.cache.garbage_collector:
+ if config.cache.garbage_collector:
logger.debug("Starting cache GC")
await self._start_gc(config)
else: