]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
server: add conf mapsize to log message
authorDaniel Salzman <daniel.salzman@nic.cz>
Fri, 6 Aug 2021 13:36:22 +0000 (15:36 +0200)
committerDaniel Salzman <daniel.salzman@nic.cz>
Mon, 9 Aug 2021 12:02:30 +0000 (14:02 +0200)
src/knot/conf/base.c
src/knot/conf/base.h
src/knot/server/server.c

index 921b1e0e3e7d189ce817678538a77700a3fadfb9..b1cd4f9c763b2319d6ad469ae4f12d5865a8dc7c 100644 (file)
@@ -244,9 +244,10 @@ int conf_new(
        init_list(out->query_modules);
 
        // Set the DB api.
+       out->mapsize = max_conf_size;
        out->api = knot_db_lmdb_api();
        struct knot_db_lmdb_opts lmdb_opts = KNOT_DB_LMDB_OPTS_INITIALIZER;
-       lmdb_opts.mapsize = max_conf_size;
+       lmdb_opts.mapsize = out->mapsize;
        lmdb_opts.maxreaders = CONF_MAX_DB_READERS;
        lmdb_opts.flags.env = KNOT_DB_LMDB_NOTLS;
 
index 9cb1a4c7cfd1cd61617ca8cf4a521d7d77ab13cb..62b6ee22b893e919f56acd2638434c67c4775f1c 100644 (file)
@@ -93,6 +93,8 @@ typedef struct {
        yp_item_t *schema;
        /*! Configuration database. */
        knot_db_t *db;
+       /*! LMDB mapsize. */
+       size_t mapsize;
 
        /*! Read-only transaction for config access. */
        knot_db_txn_t read_txn;
index 90973edf8e4256a076a521df1f9b85c549a196ea..02e166c54f088371bff2a42b0371bc4ae45ba8ae 100644 (file)
@@ -1148,12 +1148,13 @@ int server_reconfigure(conf_t *conf, server_t *server)
        if (!(server->state & ServerRunning)) {
                log_info("Knot DNS %s starting", PACKAGE_VERSION);
 
+               size_t mapsize = conf->mapsize / (1024 * 1024);
                if (conf->filename != NULL) {
-                       log_info("loaded configuration file '%s'",
-                                conf->filename);
+                       log_info("loaded configuration file '%s', mapsize %zu MiB",
+                                conf->filename, mapsize);
                } else {
-                       log_info("loaded configuration database '%s'",
-                                knot_db_lmdb_get_path(conf->db));
+                       log_info("loaded configuration database '%s', mapsize %zu MiB",
+                                knot_db_lmdb_get_path(conf->db), mapsize);
                }
 
                /* Configure server threads. */