Reduce number of async fetches

This commit is contained in:
David Schwartz
2014-05-05 09:45:00 -07:00
committed by Vinnie Falco
parent 96e8cddfc2
commit 07d0379edd
2 changed files with 6 additions and 1 deletions

View File

@@ -130,7 +130,9 @@ public:
int getDesiredAsyncReadCount ()
{
// We prefer a client not fill our cache
return m_cache.getTargetSize() / 4;
// We don't want to push data out of the cache
// before it's retrieved
return m_cache.getTargetSize() / asyncDivider;
}
NodeObject::Ptr fetch (uint256 const& hash)

View File

@@ -30,6 +30,9 @@ enum
// Expiration time for cached nodes
,cacheTargetSeconds = 300
// Fraction of the cache one query source can take
,asyncDivider = 8
};
}