davisp commented on issue #610: Optimize ddoc cache
URL: https://github.com/apache/couchdb/pull/610#issuecomment-313493656
 
 
   @chewbranca I managed to figure out a decent way to avoid the unnecessary 
second fabric calls in the two cases you were worried about. Now the first 
client that opens an entry will kick off a process that will insert the 
corresponding cache entry if no entry existed before. I.e., if we call 
ddoc_cache:open(DbName, DDocId) and there's no entry for it, we'll take the 
result and insert it for the revid specific version as well (assuming there's 
not already an existing entry). And vice versa when opening a revid specific 
version.
   
   
https://github.com/apache/couchdb/pull/610/commits/85b53855255be0a4166bbb14697c010ff4468d20
   
   Also, for your comment on the revid specific entries I spent some time 
trying to figure out a decent way to be clever using latest=true or something 
but in the end I went entirely different. Now if a cache entry is not accessed 
within its refresh period it will voluntarily drop out of the cache. So this 
will apply for all entries which I think is good to help when someone wants to 
scan a bunch of views periodically. We'll end up dropping all of the unused 
entries which could help with memory pressure if someone has big design 
documents without much activity on more than a few.
   
   
https://github.com/apache/couchdb/pull/610/commits/32cd254d7e7c678a10a9302e48e9c6f064701701
   
   For the configurability, I added a refresh timeout config option and 
documented it in the default.ini as per usual. I also added notes for max_size 
as well.
   
   
https://github.com/apache/couchdb/pull/610/commits/9151fb59a8f8553a95af23fa58ef67a76f069b80
   
   And thanks for the good eye on clearing the waiters list.
   
   
https://github.com/apache/couchdb/pull/610/commits/7c376bd6efc372cd7f107989fd14e40e8ab7a7e6
   
   The only other thing you really noted was the comment update but I think 
that was just due to a misunderstanding so I'm assuming you're good my comment 
there.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to