trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [1/2] trafficserver git commit: TS-3484 Make inactivity_cop frequency (schedule) configurable
Date Sat, 02 May 2015 02:52:46 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master 566194cc9 -> fc8eeb6e4


TS-3484 Make inactivity_cop frequency (schedule) configurable


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/ad77de62
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/ad77de62
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/ad77de62

Branch: refs/heads/master
Commit: ad77de622bfd717efbd279bdb0cc1315a6fa78a9
Parents: 566194c
Author: Leif Hedstrom <zwoop@apache.org>
Authored: Fri Apr 3 09:04:19 2015 -0600
Committer: Leif Hedstrom <zwoop@apache.org>
Committed: Fri May 1 20:51:00 2015 -0600

----------------------------------------------------------------------
 doc/reference/configuration/records.config.en.rst | 6 ++++++
 iocore/net/UnixNet.cc                             | 7 ++++++-
 mgmt/RecordsConfig.cc                             | 2 ++
 3 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ad77de62/doc/reference/configuration/records.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/records.config.en.rst b/doc/reference/configuration/records.config.en.rst
index 9243747..a9a2c68 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -303,6 +303,12 @@ Network
    `proxy.process.net.default_inactivity_timeout_applied` metric
    is incremented.
 
+.. ts:cv:: CONFIG proxy.config.net.inactivity_check_frequency INT 1
+
+   How frequent (in seconds) to check for inactive connections. If you deal
+   with a lot of concurrent connections, increasing this setting can reduce
+   pressure on the system.
+
 .. ts:cv:: LOCAL proxy.local.incoming_ip_to_bind STRING 0.0.0.0 [::]
 
    Controls the global default IP addresses to which to bind proxy server ports. The value
is a space separated list of IP addresses, one per supported IP address family (currently
IPv4 and IPv6).

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ad77de62/iocore/net/UnixNet.cc
----------------------------------------------------------------------
diff --git a/iocore/net/UnixNet.cc b/iocore/net/UnixNet.cc
index 03c3bec..7ffefff 100644
--- a/iocore/net/UnixNet.cc
+++ b/iocore/net/UnixNet.cc
@@ -61,6 +61,8 @@ public:
     (void)event;
     ink_hrtime now = ink_get_hrtime();
     NetHandler &nh = *get_NetHandler(this_ethread());
+
+    Debug("inactivity_cop_check", "Checking inactivity on Thread-ID #%d", this_ethread()->id);
     total_connections_in = 0;
     // Copy the list and use pop() to catch any closes caused by callbacks.
     forl_LL(UnixNetVConnection, vc, nh.open_list)
@@ -367,7 +369,10 @@ initialize_thread_for_net(EThread *thread)
 
 #ifndef INACTIVITY_TIMEOUT
   InactivityCop *inactivityCop = new InactivityCop(get_NetHandler(thread)->mutex);
-  thread->schedule_every(inactivityCop, HRTIME_SECONDS(1));
+  int cop_freq = 1;
+
+  REC_ReadConfigInteger(cop_freq, "proxy.config.net.inactivity_check_frequency");
+  thread->schedule_every(inactivityCop, HRTIME_SECONDS(cop_freq));
 #endif
 
   thread->signal_hook = net_signal_hook_function;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ad77de62/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index aa499dc..c655c20 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -826,6 +826,8 @@ static const RecordElement RecordsConfig[] =
   ,
   {RECT_CONFIG, "proxy.config.net.default_inactivity_timeout", RECD_INT, "86400", RECU_DYNAMIC,
RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
+  {RECT_CONFIG, "proxy.config.net.inactivity_check_frequency", RECD_INT, "1", RECU_NULL,
RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
 
   //##############################################################################
   //#


Mime
View raw message