diff options
author | Adam Kocoloski <adam@cloudant.com> | 2012-02-06 22:02:32 -0500 |
---|---|---|
committer | Robert Newson <robert.newson@cloudant.com> | 2012-11-14 17:13:19 +0000 |
commit | 7bd071836a08722cb14479261507aec1d071e2d2 (patch) | |
tree | ba66b121310f309f07889e1054f10e2319ffa704 /couchjs/c_src/SConscript | |
parent | 7967c2f7b71a03a5b8eb9f2c72e7b5959f8fc4eb (diff) |
Add an index keyed on LRU for faster candidate ID
Our current implementation for closing an LRU DB involves a full scan
of a public ets table. This scan blocks all other activity in
couch_server and can become a serious bottleneck when the LRU cache hit
rate drops too low. In the worst-case all_dbs_active scenario we end up
with O(N**2) algorithmic complexity.
This patch adds a new index keyed on LRU for faster access to the least
recently used databases. It also moves the ets table to a dict on the
couch_server heap. The downside is an increased message rate inbound on
the couch_server, as clients are no longer allowed to update the LRU
data structures without sending a message.
BugzID: 12879
Conflicts:
apps/couch/src/couch_server.erl
Diffstat (limited to 'couchjs/c_src/SConscript')
0 files changed, 0 insertions, 0 deletions