trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [trafficserver] branch 7.1.x updated: Allow disable throttling.
Date Thu, 21 Jun 2018 23:04:56 GMT
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/7.1.x by this push:
     new cf51a2f  Allow disable throttling.
cf51a2f is described below

commit cf51a2f5e1244e12053764d6862a37e9cba1c031
Author: Susan Hinrichs <shinrich@apache.org>
AuthorDate: Thu May 31 13:46:51 2018 -0500

    Allow disable throttling.
    
    (cherry picked from commit 460377fc069b10a0c8e229428afdd9671c8935e8)
---
 doc/admin-guide/files/records.config.en.rst | 2 +-
 iocore/net/P_UnixNet.h                      | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/doc/admin-guide/files/records.config.en.rst b/doc/admin-guide/files/records.config.en.rst
index 40655d1..c755a49 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -407,7 +407,7 @@ Network
    given time. Roughly 10% of these connections are reserved for origin server
    connections, i.e. from the default, only ~9,000 client connections can be
    handled. This should be tuned according to your memory size, and expected
-   work load.
+   work load.  If this is set to 0, the throttling logic is disabled.
 
 .. ts:cv:: CONFIG proxy.config.net.default_inactivity_timeout INT 86400
    :reloadable:
diff --git a/iocore/net/P_UnixNet.h b/iocore/net/P_UnixNet.h
index c2e34b8..68a7b3b 100644
--- a/iocore/net/P_UnixNet.h
+++ b/iocore/net/P_UnixNet.h
@@ -274,7 +274,7 @@ check_net_throttle(ThrottleType t)
 {
   int connections = net_connections_to_throttle(t);
 
-  if (connections >= net_connections_throttle)
+  if (net_connections_throttle != 0 && connections >= net_connections_throttle)
     return true;
 
   return false;
@@ -301,9 +301,11 @@ change_net_connections_throttle(const char *token, RecDataT data_type,
RecData v
   (void)value;
   (void)data;
   int throttle = fds_limit - THROTTLE_FD_HEADROOM;
-  if (fds_throttle < 0)
+  if (fds_throttle == 0) {
+    net_connections_throttle = fds_throttle;
+  } else if (fds_throttle < 0) {
     net_connections_throttle = throttle;
-  else {
+  } else {
     net_connections_throttle = fds_throttle;
     if (net_connections_throttle > throttle)
       net_connections_throttle = throttle;


Mime
View raw message