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/02 23:36:28 UTC
[11/15] 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/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/master
Commit: bfc78c736da2336fc05b83faab2a4381229b6e21
Parents: a544466
Author: Leif Hedstrom <zw...@apache.org>
Authored: Wed Mar 27 12:08:43 2013 -0700
Committer: Leif Hedstrom <zw...@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
Re: [11/15] git commit: TS-1067 Add a new config option, proxy.config.ssl.number.threads,
and code
Posted by Leif Hedstrom <zw...@apache.org>.
On 4/3/13 1:37 AM, Igor Galić wrote:
>
> ----- Original Message -----
>> TS-1067 Add a new config option, proxy.config.ssl.number.threads, and
>> + // 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());
> Code in Main.cc: proxy.config.ssl.number.threads
>
yeah, it's a bad commit message, and bad code :). I'll fix.
Thanks!
-- Leif
Re: [11/15] git commit: TS-1067 Add a new config option,
proxy.config.ssl.number.threads, and code
Posted by Igor Galić <i....@brainsware.org>.
----- Original Message -----
> TS-1067 Add a new config option, proxy.config.ssl.number.threads, and
> code
>
commit message "proxy.config.ssl.number.threads"
>
> 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}
> + ,
Code in RecordsConfig.cc: proxy.config.udp.threads
>
> //##############################################################################
> //#
>
> 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());
Code in Main.cc: proxy.config.ssl.number.threads
> #ifndef INK_NO_LOG
colour me confused.
--
Igor Galić
Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515 2EA5 4B1D 9E08 A097 C9AE