trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [19/50] git commit: TS-1067 Add a new config option, proxy.config.ssl.number.threads, and code
Date Mon, 15 Apr 2013 21:19:48 GMT
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/bfc78c73
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/bfc78c73
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/bfc78c73

Branch: refs/heads/3.3.x
Commit: bfc78c736da2336fc05b83faab2a4381229b6e21
Parents: a544466
Author: Leif Hedstrom <zwoop@apache.org>
Authored: Wed Mar 27 12:08:43 2013 -0700
Committer: Leif Hedstrom <zwoop@apache.org>
Committed: Tue Apr 2 13:53:42 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/bfc78c73/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/bfc78c73/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


Mime
View raw message