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/07/11 19:19:57 UTC
[1/3] git commit: TS-1966 Add new configuration option to control
ProxyAllocator size
Updated Branches:
refs/heads/master 14e212a01 -> 38e5b4bca
TS-1966 Add new configuration option to control ProxyAllocator size
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/1b8ad632
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/1b8ad632
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/1b8ad632
Branch: refs/heads/master
Commit: 1b8ad632a235f93ec7a6bcf5fb766e635e20de65
Parents: e67b683
Author: Leif Hedstrom <zw...@apache.org>
Authored: Wed Jul 3 18:44:55 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Jul 11 11:18:29 2013 -0600
----------------------------------------------------------------------
iocore/cache/P_CacheInternal.h | 2 +-
iocore/eventsystem/EventSystem.cc | 1 +
iocore/eventsystem/I_Event.h | 10 ++++++----
iocore/eventsystem/I_ProxyAllocator.h | 4 ++--
iocore/eventsystem/ProxyAllocator.cc | 2 ++
mgmt/RecordsConfig.cc | 12 ++++++++++--
mgmt/RecordsConfig.h | 4 ++--
mgmt/api/INKMgmtAPI.cc | 2 +-
8 files changed, 25 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b8ad632/iocore/cache/P_CacheInternal.h
----------------------------------------------------------------------
diff --git a/iocore/cache/P_CacheInternal.h b/iocore/cache/P_CacheInternal.h
index 9afb3ac..576c361 100644
--- a/iocore/cache/P_CacheInternal.h
+++ b/iocore/cache/P_CacheInternal.h
@@ -640,7 +640,7 @@ free_CacheVC(CacheVC *cont)
#ifdef DEBUG
SET_CONTINUATION_HANDLER(cont, &CacheVC::dead);
#endif
- THREAD_FREE_TO(cont, cacheVConnectionAllocator, this_ethread(), MAX_CACHE_VCS_PER_THREAD);
+ THREAD_FREE_TO(cont, cacheVConnectionAllocator, this_ethread(), thread_freelist_size);
return EVENT_DONE;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b8ad632/iocore/eventsystem/EventSystem.cc
----------------------------------------------------------------------
diff --git a/iocore/eventsystem/EventSystem.cc b/iocore/eventsystem/EventSystem.cc
index b8e1bdc..be6063a 100644
--- a/iocore/eventsystem/EventSystem.cc
+++ b/iocore/eventsystem/EventSystem.cc
@@ -36,6 +36,7 @@ ink_event_system_init(ModuleVersion v)
ink_release_assert(!checkModuleVersion(v, EVENT_SYSTEM_MODULE_VERSION));
int config_max_iobuffer_size = DEFAULT_MAX_BUFFER_SIZE;
+ REC_EstablishStaticConfigInt32(thread_freelist_size, "proxy.config.allocator.thread_freelist_size");
REC_ReadConfigInteger(config_max_iobuffer_size, "proxy.config.io.max_buffer_size");
max_iobuffer_size = buffer_size_to_index(config_max_iobuffer_size, DEFAULT_BUFFER_SIZES - 1);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b8ad632/iocore/eventsystem/I_Event.h
----------------------------------------------------------------------
diff --git a/iocore/eventsystem/I_Event.h b/iocore/eventsystem/I_Event.h
index 13d6800..7a37ea0 100644
--- a/iocore/eventsystem/I_Event.h
+++ b/iocore/eventsystem/I_Event.h
@@ -275,9 +275,11 @@ public:
extern ClassAllocator<Event> eventAllocator;
#define EVENT_ALLOC(_a, _t) THREAD_ALLOC(_a, _t)
-#define EVENT_FREE(_p, _a, _t) \
- _p->mutex = NULL; \
- if (_p->globally_allocated) ::_a.free(_p); \
- else THREAD_FREE_TO(_p, _a, _t, MAX_EVENTS_PER_THREAD)
+#define EVENT_FREE(_p, _a, _t) \
+ _p->mutex = NULL; \
+ if (_p->globally_allocated) \
+ ::_a.free(_p); \
+ else \
+ THREAD_FREE_TO(_p, _a, _t, thread_freelist_size)
#endif /*_Event_h_*/
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b8ad632/iocore/eventsystem/I_ProxyAllocator.h
----------------------------------------------------------------------
diff --git a/iocore/eventsystem/I_ProxyAllocator.h b/iocore/eventsystem/I_ProxyAllocator.h
index a221d63..dc3b965 100644
--- a/iocore/eventsystem/I_ProxyAllocator.h
+++ b/iocore/eventsystem/I_ProxyAllocator.h
@@ -35,7 +35,7 @@
class EThread;
-#define MAX_ON_THREAD_FREELIST 512
+extern int thread_freelist_size;
struct ProxyAllocator
{
@@ -104,6 +104,6 @@ void thread_freeup(Allocator &a, ProxyAllocator &l);
#endif /* defined(TS_USE_FREELIST */
-#define THREAD_FREE(_p, _a, _t) THREAD_FREE_TO(_p, _a, _t, MAX_ON_THREAD_FREELIST)
+#define THREAD_FREE(_p, _a, _t) THREAD_FREE_TO(_p, _a, _t, thread_freelist_size)
#endif /* _ProxyAllocator_h_ */
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b8ad632/iocore/eventsystem/ProxyAllocator.cc
----------------------------------------------------------------------
diff --git a/iocore/eventsystem/ProxyAllocator.cc b/iocore/eventsystem/ProxyAllocator.cc
index 061c148..53a8d60 100644
--- a/iocore/eventsystem/ProxyAllocator.cc
+++ b/iocore/eventsystem/ProxyAllocator.cc
@@ -22,6 +22,8 @@
*/
#include "I_EventSystem.h"
+int thread_freelist_size = 512;
+
void*
thread_alloc(Allocator &a, ProxyAllocator &l)
{
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b8ad632/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 8a2193b..8383a8b 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -57,9 +57,9 @@ RecordElement RecordsConfig[] = {
{RECT_CONFIG, "proxy.config.manager_binary", RECD_STRING, "traffic_manager", RECU_NULL, RR_REQUIRED, RECC_NULL, NULL, RECA_NULL}
, // required for traffic_cop
{RECT_CONFIG, "proxy.config.cli_binary", RECD_STRING, "traffic_line", RECU_NULL, RR_REQUIRED, RECC_NULL, NULL, RECA_NULL}
- , // required for mrtg
+ ,
{RECT_CONFIG, "proxy.config.watch_script", RECD_STRING, "traffic_cop", RECU_NULL, RR_REQUIRED, RECC_NULL, NULL, RECA_NULL}
- , // required for mrtg
+ ,
{RECT_CONFIG, "proxy.config.proxy_binary_opts", RECD_STRING, "-M", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.start_script", RECD_STRING, "start", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
@@ -1873,6 +1873,14 @@ RecordElement RecordsConfig[] = {
//############
//#
+ //# Per-thread freelist / allocator controls
+ //#
+ //############
+ {RECT_CONFIG, "proxy.config.allocator.thread_freelist_size", RECD_INT, "512", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
+ ,
+
+ //############
+ //#
//# Eric's super cool remap processor
//#
//############
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b8ad632/mgmt/RecordsConfig.h
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.h b/mgmt/RecordsConfig.h
index d7c2625..ef94973 100644
--- a/mgmt/RecordsConfig.h
+++ b/mgmt/RecordsConfig.h
@@ -38,7 +38,7 @@ enum RecordRequiredType {
// Retain this struct for ease of CVS merging
struct RecordElement
{
- RecT type; // type of the record (CONFIG, PROCESS, etc)
+ RecT type; // type of the record (CONFIG, PROCESS, etc)
const char *name; // name of the record
RecDataT value_type; // type of the record value (INT, FLOAT, etc)
const char *value; // default value for the record
@@ -46,7 +46,7 @@ struct RecordElement
RecordRequiredType required; // is records required to be in records.config?
RecCheckT check;
const char *regex;
- RecAccessT access; // access level of the record
+ RecAccessT access; // access level of the record
};
void LibRecordsConfigInit(); // initializes RecordsConfigIndex
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b8ad632/mgmt/api/INKMgmtAPI.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/INKMgmtAPI.cc b/mgmt/api/INKMgmtAPI.cc
index a278ffd..29597e7 100644
--- a/mgmt/api/INKMgmtAPI.cc
+++ b/mgmt/api/INKMgmtAPI.cc
@@ -2510,7 +2510,7 @@ TSSetHostname(TSString hostname)
TSInt val = 0;
/* Here we should handle these cases:
- * rmserver.cfg - different API currently, records.config, mrtg, and hostname_FQ
+ * rmserver.cfg - different API currently, records.config, and hostname_FQ
*/
if (TSRecordGetInt("proxy.local.cluster.type", &val) == TS_ERR_OKAY) { //If error??
[2/3] git commit: TS-1966 Cleanup identation first
Posted by zw...@apache.org.
TS-1966 Cleanup identation first
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/e67b6833
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/e67b6833
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/e67b6833
Branch: refs/heads/master
Commit: e67b68334cf09734207dbeba9de5b87e4ba9f5a8
Parents: 14e212a
Author: Leif Hedstrom <zw...@apache.org>
Authored: Wed Jul 3 14:54:06 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Jul 11 11:18:29 2013 -0600
----------------------------------------------------------------------
proxy/Main.cc | 70 ++++++++++++++++++++----------------------------------
1 file changed, 26 insertions(+), 44 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e67b6833/proxy/Main.cc
----------------------------------------------------------------------
diff --git a/proxy/Main.cc b/proxy/Main.cc
index ac74a4d..e0b1689 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -175,26 +175,18 @@ const Version version = {
};
static const ArgumentDescription argument_descriptions[] = {
- {"lock_memory", 'l', "Lock process in memory (must be root)",
- "I", &lock_process, "PROXY_LOCK_PROCESS", NULL},
- {"net_threads", 'n', "Number of Net Threads", "I", &num_of_net_threads,
- "PROXY_NET_THREADS", NULL},
- {"cluster_threads", 'Z', "Number of Cluster Threads", "I",
- &num_of_cluster_threads, "PROXY_CLUSTER_THREADS", NULL},
- {"udp_threads", 'U', "Number of UDP Threads", "I",
- &num_of_udp_threads, "PROXY_UDP_THREADS", NULL},
- {"accept_thread", 'a', "Use an Accept Thread", "T", &num_accept_threads,
- "PROXY_ACCEPT_THREAD", NULL},
- {"accept_till_done", 'b', "Accept Till Done", "T", &accept_till_done,
- "PROXY_ACCEPT_TILL_DONE", NULL},
- {"httpport", 'p', "Port descriptor for HTTP Accept", "S*",
- &http_accept_port_descriptor, "PROXY_HTTP_ACCEPT_PORT", NULL},
- {"cluster_port", 'P', "Cluster Port Number", "I", &cluster_port_number,
- "PROXY_CLUSTER_PORT", NULL},
- {"dprintf_level", 'o', "Debug output level", "I", &cmd_line_dprintf_level,
- "PROXY_DPRINTF_LEVEL", NULL},
- {"version", 'V', "Print Version String", "T", &version_flag,
- NULL, NULL},
+ {"lock_memory", 'l', "Lock process in memory (must be root)", "I", &lock_process, "PROXY_LOCK_PROCESS", NULL},
+ {"net_threads", 'n', "Number of Net Threads", "I", &num_of_net_threads, "PROXY_NET_THREADS", NULL},
+ {"cluster_threads", 'Z', "Number of Cluster Threads", "I", &num_of_cluster_threads, "PROXY_CLUSTER_THREADS", NULL},
+ {"udp_threads", 'U', "Number of UDP Threads", "I", &num_of_udp_threads, "PROXY_UDP_THREADS", NULL},
+ {"accept_thread", 'a', "Use an Accept Thread", "T", &num_accept_threads, "PROXY_ACCEPT_THREAD", NULL},
+ {"accept_till_done", 'b', "Accept Till Done", "T", &accept_till_done, "PROXY_ACCEPT_TILL_DONE", NULL},
+ {"httpport", 'p', "Port descriptor for HTTP Accept", "S*", &http_accept_port_descriptor,
+ "PROXY_HTTP_ACCEPT_PORT", NULL},
+ {"cluster_port", 'P', "Cluster Port Number", "I", &cluster_port_number, "PROXY_CLUSTER_PORT", NULL},
+ {"dprintf_level", 'o', "Debug output level", "I", &cmd_line_dprintf_level, "PROXY_DPRINTF_LEVEL", NULL},
+ {"version", 'V', "Print Version String", "T", &version_flag, NULL, NULL},
+
#if TS_HAS_TESTS
{"regression", 'R',
#ifdef DEBUG
@@ -204,6 +196,7 @@ static const ArgumentDescription argument_descriptions[] = {
#endif
"I", ®ression_level, "PROXY_REGRESSION", NULL},
{"regression_test", 'r',
+
#ifdef DEBUG
"Run Specific Regression Test",
#else
@@ -211,36 +204,25 @@ static const ArgumentDescription argument_descriptions[] = {
#endif
"S512", regression_test, "PROXY_REGRESSION_TEST", NULL},
#endif //TS_HAS_TESTS
+
#if TS_USE_DIAGS
- {"debug_tags", 'T', "Vertical-bar-separated Debug Tags", "S1023", error_tags,
- "PROXY_DEBUG_TAGS", NULL},
- {"action_tags", 'B', "Vertical-bar-separated Behavior Tags", "S1023", action_tags,
- "PROXY_BEHAVIOR_TAGS", NULL},
+ {"debug_tags", 'T', "Vertical-bar-separated Debug Tags", "S1023", error_tags, "PROXY_DEBUG_TAGS", NULL},
+ {"action_tags", 'B', "Vertical-bar-separated Behavior Tags", "S1023", action_tags, "PROXY_BEHAVIOR_TAGS", NULL},
#endif
- {"interval", 'i', "Statistics Interval", "I", &show_statistics,
- "PROXY_STATS_INTERVAL", NULL},
- {"remote_management", 'M', "Remote Management", "T",
- &remote_management_flag, "PROXY_REMOTE_MANAGEMENT", NULL},
- {"management_dir", 'd', "Management Directory", "S255",
- &management_directory, "PROXY_MANAGEMENT_DIRECTORY", NULL},
- {"command", 'C', "Maintenance Command to Execute", "S511",
- &command_string, "PROXY_COMMAND_STRING", NULL},
-// {"clear_authdb", 'j', "Clear AuthDB on Startup", "F",
- // &auto_clear_authdb_flag, "PROXY_CLEAR_AUTHDB", NULL},
- {"clear_hostdb", 'k', "Clear HostDB on Startup", "F",
- &auto_clear_hostdb_flag, "PROXY_CLEAR_HOSTDB", NULL},
- {"clear_cache", 'K', "Clear Cache on Startup", "F",
- &cacheProcessor.auto_clear_flag, "PROXY_CLEAR_CACHE", NULL},
+
+ {"interval", 'i', "Statistics Interval", "I", &show_statistics, "PROXY_STATS_INTERVAL", NULL},
+ {"remote_management", 'M', "Remote Management", "T", &remote_management_flag, "PROXY_REMOTE_MANAGEMENT", NULL},
+ {"management_dir", 'd', "Management Directory", "S255", &management_directory, "PROXY_MANAGEMENT_DIRECTORY", NULL},
+ {"command", 'C', "Maintenance Command to Execute", "S511", &command_string, "PROXY_COMMAND_STRING", NULL},
+ {"clear_hostdb", 'k', "Clear HostDB on Startup", "F", &auto_clear_hostdb_flag, "PROXY_CLEAR_HOSTDB", NULL},
+ {"clear_cache", 'K', "Clear Cache on Startup", "F", &cacheProcessor.auto_clear_flag, "PROXY_CLEAR_CACHE", NULL},
{"vingid", 'v', "Vingid Flag", "S255", vingid_flag, "PROXY_VINGID", NULL},
#if defined(linux)
- {"read_core", 'c', "Read Core file", "S255",
- &core_file, NULL, NULL},
+ {"read_core", 'c', "Read Core file", "S255", &core_file, NULL, NULL},
#endif
- {"accept_mss", ' ', "MSS for client connections", "I", &accept_mss,
- NULL, NULL},
- {"poll_timeout", 't', "poll timeout in milliseconds", "I", &net_config_poll_timeout,
- NULL, NULL},
+ {"accept_mss", ' ', "MSS for client connections", "I", &accept_mss, NULL, NULL},
+ {"poll_timeout", 't', "poll timeout in milliseconds", "I", &net_config_poll_timeout, NULL, NULL},
{"help", 'h', "HELP!", NULL, NULL, NULL, usage},
};
[3/3] git commit: Added TS-1966
Posted by zw...@apache.org.
Added TS-1966
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/38e5b4bc
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/38e5b4bc
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/38e5b4bc
Branch: refs/heads/master
Commit: 38e5b4bca12b157c57191667b27c2d5aaaab2cb5
Parents: 1b8ad63
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Jul 11 11:19:49 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Jul 11 11:19:49 2013 -0600
----------------------------------------------------------------------
CHANGES | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/38e5b4bc/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index c220229..4ae1c72 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
Changes with Apache Traffic Server 3.3.5
+ *) [TS-1966] Add new configuration option to control ProxyAllocator size.
+
*) [TS-1151] cop may crash due to uninitialized pointer val
*) [TS-2013] Install the tspush script.