You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2013/04/15 22:46:26 UTC

[19/50] git commit: TS-1067 Add a new config option, proxy.config.ssl.number.threads, and code

TS-1067 Add a new config option, proxy.config.ssl.number.threads, and code


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

Branch: refs/heads/3.3.x
Commit: 3da95a18b65eccb4e40459bf0ad150ee504bbfe2
Parents: 9c2993a
Author: Leif Hedstrom <zw...@apache.org>
Authored: Wed Mar 27 12:08:43 2013 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Mon Apr 15 14:45:43 2013 -0600

----------------------------------------------------------------------
 mgmt/RecordsConfig.cc |    2 ++
 proxy/Main.cc         |   23 +++++++++++++----------
 2 files changed, 15 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3da95a18/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 6926a40..bf9e56a 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -281,6 +281,8 @@ RecordElement RecordsConfig[] = {
   ,
   {RECT_CONFIG, "proxy.config.udp.send_retries", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
+  {RECT_CONFIG, "proxy.config.udp.threads", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
 
   //##############################################################################
   //#

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3da95a18/proxy/Main.cc
----------------------------------------------------------------------
diff --git a/proxy/Main.cc b/proxy/Main.cc
index addbeeb..05c3bc4 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -97,11 +97,6 @@ extern "C" int plock(int);
 //
 // Global Data
 //
-#define DEFAULT_NUMBER_OF_THREADS         ink_number_of_processors()
-#define DEFAULT_NUMBER_OF_UDP_THREADS     1
-#define DEFAULT_NUMBER_OF_SSL_THREADS     0
-#define DEFAULT_NUM_ACCEPT_THREADS        0
-#define DEFAULT_NUM_TASK_THREADS          0
 #define DEFAULT_HTTP_ACCEPT_PORT_NUMBER   0
 #define DEFAULT_COMMAND_FLAG              0
 #define DEFAULT_LOCK_PROCESS              0
@@ -123,11 +118,13 @@ static void * mgmt_restart_shutdown_callback(void *, char *, int data_len);
 static int version_flag = DEFAULT_VERSION_FLAG;
 
 static int const number_of_processors = ink_number_of_processors();
-static int num_of_net_threads = DEFAULT_NUMBER_OF_THREADS;
+static int num_of_net_threads = number_of_processors;
+static int num_of_udp_threads = 0;
+static int num_accept_threads  = 0;
+static int num_task_threads = 0;
+
 extern int num_of_cluster_threads;
-static int num_of_udp_threads = DEFAULT_NUMBER_OF_UDP_THREADS;
-static int num_accept_threads  = DEFAULT_NUM_ACCEPT_THREADS;
-static int num_task_threads = DEFAULT_NUM_TASK_THREADS;
+
 #if TS_HAS_TESTS
 static int run_test_hook = 0;
 #endif
@@ -1639,7 +1636,13 @@ main(int argc, char **argv)
     HttpProxyPort::loadDefaultIfEmpty();
 
     cacheProcessor.start();
-    udpNet.start(num_of_udp_threads);
+
+    // UDP net-threads are turned off by default.
+    if (!num_of_udp_threads)
+      TS_ReadConfigInteger(num_of_udp_threads, "proxy.config.ssl.number.threads");
+    if (num_of_udp_threads)
+      udpNet.start(num_of_udp_threads);
+
     sslNetProcessor.start(getNumSSLThreads());
 
 #ifndef INK_NO_LOG