You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ja...@apache.org on 2016/04/07 20:59:09 UTC
trafficserver git commit: Workaround for TS-4207
Repository: trafficserver
Updated Branches:
refs/heads/master f0ce965e3 -> 4561dc5a6
Workaround for TS-4207
Bump the default hostdb size in records config (and add better error logging on hostdb)
Since adding an additional 120 to each entry requires a larger cache, we'll bump the default size in the config. In addition I've added the required size to the error log instead of making the user guess
this closes #553
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/4561dc5a
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/4561dc5a
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/4561dc5a
Branch: refs/heads/master
Commit: 4561dc5a6098d45b8d536df8bfb282b120b17181
Parents: f0ce965
Author: Thomas Jackson <ja...@apache.org>
Authored: Wed Apr 6 16:48:00 2016 -0700
Committer: Thomas Jackson <ja...@apache.org>
Committed: Thu Apr 7 11:58:31 2016 -0700
----------------------------------------------------------------------
iocore/hostdb/MultiCache.cc | 2 +-
iocore/hostdb/P_HostDBProcessor.h | 3 ++-
mgmt/RecordsConfig.cc | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4561dc5a/iocore/hostdb/MultiCache.cc
----------------------------------------------------------------------
diff --git a/iocore/hostdb/MultiCache.cc b/iocore/hostdb/MultiCache.cc
index 536338d..ddb59da 100644
--- a/iocore/hostdb/MultiCache.cc
+++ b/iocore/hostdb/MultiCache.cc
@@ -203,7 +203,7 @@ MultiCacheBase::initialize(Store *astore, char *afilename, int aelements, int ab
astore->free(*store);
delete store;
store = NULL;
- Warning("Configured store too small, unable to reconfigure");
+ Warning("Configured store too small (actual=%d required=%d), unable to reconfigure", got * STORE_BLOCK_SIZE, blocks * STORE_BLOCK_SIZE);
return -3;
}
totalsize = (STORE_BLOCK_SIZE)*blocks;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4561dc5a/iocore/hostdb/P_HostDBProcessor.h
----------------------------------------------------------------------
diff --git a/iocore/hostdb/P_HostDBProcessor.h b/iocore/hostdb/P_HostDBProcessor.h
index 22b095d..d4f3ba0 100644
--- a/iocore/hostdb/P_HostDBProcessor.h
+++ b/iocore/hostdb/P_HostDBProcessor.h
@@ -217,10 +217,11 @@ struct HostDBCache : public MultiCache<HostDBInfo> {
// This accounts for an average of 2 HostDBInfo per DNS cache (for round-robin etc.)
// In addition, we can do a padding for additional SRV records storage.
+ // In addition, we add 120 for hostname storage (since we now always do that)
virtual size_t
estimated_heap_bytes_per_entry() const
{
- return sizeof(HostDBInfo) * 2 + 512 * hostdb_srv_enabled;
+ return sizeof(HostDBInfo) * 2 + 512 * hostdb_srv_enabled + 120;
}
// Map to contain all of the host file overrides, initialize it to empty
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4561dc5a/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 8efca86..d448afe 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -1048,7 +1048,7 @@ static const RecordElement RecordsConfig[] =
,
{RECT_CONFIG, "proxy.config.hostdb.storage_path", RECD_STRING, TS_BUILD_CACHEDIR, RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
,
- {RECT_CONFIG, "proxy.config.hostdb.storage_size", RECD_INT, "33554432", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
+ {RECT_CONFIG, "proxy.config.hostdb.storage_size", RECD_INT, "45375488", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
,
// # in minutes (all three)
// # 0 = obey, 1 = ignore, 2 = min(X,ttl), 3 = max(X,ttl)