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 2016/04/27 22:34:18 UTC
[trafficserver] 04/05: Workaround for TS-4207
This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch 6.1.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git
commit 3609dae2024f8613f040b5b163774355921a6464
Author: Thomas Jackson <ja...@apache.org>
AuthorDate: Wed Apr 6 16:48:00 2016 -0700
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
(cherry picked from commit 4561dc5a6098d45b8d536df8bfb282b120b17181)
---
iocore/hostdb/MultiCache.cc | 2 +-
iocore/hostdb/P_HostDBProcessor.h | 3 ++-
mgmt/RecordsConfig.cc | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
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;
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
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index f3a2566..ed71b5c 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -1044,7 +1044,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)
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.