Skip to content

Commit

Permalink
Reduce kvstore sync interval
Browse files Browse the repository at this point in the history
Summary: As in title. improve performance in SPR

Reviewed By: GirasoleY

Differential Revision: D15914234

fbshipit-source-id: 51283faa098f2c8a28ea0f88cb26f07bd8ebbce0
  • Loading branch information
Nanda Kishore Salem authored and facebook-github-bot committed Jun 20, 2019
1 parent f694459 commit 95b842b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion openr/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ main(int argc, char** argv) {
"tcp://{}:{}", FLAGS_listen_addr, FLAGS_kvstore_rep_port)},
monitorSubmitUrl,
maybeIpTos,
Constants::kStoreSyncInterval,
std::chrono::seconds(FLAGS_kvstore_sync_interval_s),
Constants::kMonitorSubmitInterval,
std::unordered_map<std::string, openr::thrift::PeerSpec>{},
FLAGS_enable_legacy_flooding,
Expand Down
4 changes: 4 additions & 0 deletions openr/common/Flags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,10 @@ DEFINE_int32(
kvstore_key_ttl_ms,
openr::Constants::kKvStoreDbTtl.count(), // 5 min
"TTL of a key (in ms) in the Kvstore");
DEFINE_int32(
kvstore_sync_interval_s,
openr::Constants::kStoreSyncInterval.count(),
"Kvstore periodic random node sync interval in seconds");
DEFINE_int32(
kvstore_ttl_decrement_ms,
openr::Constants::kTtlDecrement.count(),
Expand Down
1 change: 1 addition & 0 deletions openr/common/Flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ DECLARE_int32(kvstore_zmq_hwm);
DECLARE_int32(kvstore_flood_msg_per_sec);
DECLARE_int32(kvstore_flood_msg_burst_size);
DECLARE_int32(kvstore_key_ttl_ms);
DECLARE_int32(kvstore_sync_interval_s);
DECLARE_int32(kvstore_ttl_decrement_ms);

DECLARE_bool(enable_secure_thrift_server);
Expand Down
2 changes: 2 additions & 0 deletions openr/scripts/run_openr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ KEY_PREFIX_FILTERS=""
KVSTORE_FLOOD_MSG_BURST_SIZE=0
KVSTORE_FLOOD_MSG_PER_SEC=0
KVSTORE_KEY_TTL_MS=300000
KVSTORE_SYNC_INTERVAL_S=60
KVSTORE_TTL_DECREMENT_MS=1
KVSTORE_ZMQ_HWM=65536
LINK_FLAP_INITIAL_BACKOFF_MS=1000
Expand Down Expand Up @@ -200,6 +201,7 @@ ARGS="\
--kvstore_flood_msg_burst_size=${KVSTORE_FLOOD_MSG_BURST_SIZE} \
--kvstore_flood_msg_per_sec=${KVSTORE_FLOOD_MSG_PER_SEC} \
--kvstore_key_ttl_ms=${KVSTORE_KEY_TTL_MS} \
--kvstore_sync_interval_s=${KVSTORE_SYNC_INTERVAL_S} \
--kvstore_ttl_decrement_ms=${KVSTORE_TTL_DECREMENT_MS} \
--kvstore_zmq_hwm=${KVSTORE_ZMQ_HWM} \
--link_flap_initial_backoff_ms=${LINK_FLAP_INITIAL_BACKOFF_MS} \
Expand Down

0 comments on commit 95b842b

Please sign in to comment.