diff options
author | Razvan Becheriu <razvan@isc.org> | 2020-04-02 18:49:27 +0200 |
---|---|---|
committer | Razvan Becheriu <razvan@isc.org> | 2020-04-14 21:20:29 +0200 |
commit | 0ab220a3e31b29da97ee628ddbc8423e87c558f7 (patch) | |
tree | 4542402068de42b527679874f842642db535dfed /src/bin/dhcp6/dhcp6_srv.cc | |
parent | [#1005] Improved doxygen comments (diff) | |
download | kea-0ab220a3e31b29da97ee628ddbc8423e87c558f7.tar.xz kea-0ab220a3e31b29da97ee628ddbc8423e87c558f7.zip |
[#893] added multi-threading parameters
Diffstat (limited to 'src/bin/dhcp6/dhcp6_srv.cc')
-rw-r--r-- | src/bin/dhcp6/dhcp6_srv.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index abcfe4b25c..6d0be0cfbe 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -204,6 +204,8 @@ namespace dhcp { const std::string Dhcpv6Srv::VENDOR_CLASS_PREFIX("VENDOR_CLASS_"); +int Dhcpv6Srv::srv_thread_count_ = -1; + Dhcpv6Srv::Dhcpv6Srv(uint16_t server_port, uint16_t client_port) : io_service_(new IOService()), server_port_(server_port), client_port_(client_port), serverid_(), shutdown_(true), @@ -523,12 +525,13 @@ void Dhcpv6Srv::run_one() { try { bool read_pkt = true; - // Do not read more packets from socket if there are enough - // packets to be processed in the packet thread pool queue - const int max_queue_size = CfgMgr::instance().getCurrentCfg()->getServerMaxThreadQueueSize(); + // Do not read more packets from socket if there are enough packets to + // be processed in the packet thread pool queue + // max_queue_size = 0 means no limit + const int max_queue_size = CfgMgr::instance().getCurrentCfg()->getPktThreadQueueSize(); const int thread_count = MultiThreadingMgr::instance().getPktThreadPoolSize(); size_t pkt_queue_size = MultiThreadingMgr::instance().getPktThreadPool().count(); - if (thread_count && (pkt_queue_size >= thread_count * max_queue_size)) { + if (thread_count && max_queue_size && (pkt_queue_size >= thread_count * max_queue_size)) { read_pkt = false; } |