OPTION(mon_compact_on_trim, OPT_BOOL, true) // compact (a prefix) when we trim old states
OPTION(mon_osd_cache_size, OPT_INT, 10) // the size of osdmaps cache, not to rely on underlying store's cache
+OPTION(mon_cpu_threads, OPT_INT, 4)
OPTION(mon_tick_interval, OPT_INT, 5)
OPTION(mon_session_timeout, OPT_INT, 300) // must send keepalive or subscribe
OPTION(mon_subscribe_interval, OPT_DOUBLE, 24*3600) // for legacy clients only
con_self(m ? m->get_loopback_connection() : NULL),
lock("Monitor::lock"),
timer(cct_, lock),
+ cpu_tp(cct, "Monitor::cpu_tp", "cpu_tp", g_conf->mon_cpu_threads),
has_ever_joined(false),
logger(NULL), cluster_logger(NULL), cluster_logger_registered(false),
monmap(map),
timer.init();
new_tick();
+ cpu_tp.start();
+
// i'm ready!
messenger->add_dispatcher_tail(this);
timer.shutdown();
+ cpu_tp.stop();
+
remove_all_sessions();
if (logger) {
#include <cmath>
#include "mon/MonOpRequest.h"
+#include "common/WorkQueue.h"
#define CEPH_MON_PROTOCOL 13 /* cluster internal */
ConnectionRef con_self;
Mutex lock;
SafeTimer timer;
+ ThreadPool cpu_tp; ///< threadpool for CPU intensive work
/// true if we have ever joined a quorum. if false, we are either a
/// new cluster, a newly joining monitor, or a just-upgraded