Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize ddoc cache #610

Merged
merged 2 commits into from
Aug 1, 2017
Merged

Optimize ddoc cache #610

merged 2 commits into from
Aug 1, 2017

Commits on Jul 25, 2017

  1. Remove duplicated eviction messages

    This is an old merge artifact that was duplicating the event
    notifications twice per design document update.
    davisp committed Jul 25, 2017
    Configuration menu
    Copy the full SHA
    22fe0b5 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2017

  1. Rewrite ddoc_cache to improve performance

    There were a couple issues with the previous ddoc_cache implementation
    that made it possible to tip over the ddoc_cache_opener process. First,
    there were a lot of messages flowing through a single gen_server. And
    second, the cache relied on periodically evicting entries to ensure
    proper behavior in not caching an entry forever after it had changed on
    disk.
    
    The new version makes two important changes. First, entries now have an
    associated process that manages the cache entry. This process will
    periodically refresh the entry and if the entry has changed or no longer
    exists the process will remove its entry from cache.
    
    The second major change is that the cache entry process directly mutates
    the related ets table entries so that our performance is not dependent
    on the speed of ets table mutations. Using a custom entry that does no
    work the cache can now sustain roughly one million operations a second
    with a twenty thousand clients fighting over a cache limited to one
    thousand items. In production this means that cache performance will
    likely be rate limited by other factors like loading design documents
    from disk.
    davisp committed Jul 26, 2017
    Configuration menu
    Copy the full SHA
    a1fadde View commit details
    Browse the repository at this point in the history