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

Badger or Nuts? #31

Closed
DzigaV opened this issue Jul 18, 2022 · 3 comments
Closed

Badger or Nuts? #31

DzigaV opened this issue Jul 18, 2022 · 3 comments

Comments

@DzigaV
Copy link

DzigaV commented Jul 18, 2022

@darkweak I've just seen this PR, which adds support for Nuts: #30

Is Nuts now recommended over Badger? If so, how is it enabled in the CaddyFile?

A related question: are Badger and Nuts in-memory by default?

@darkweak
Copy link
Collaborator

Hey @DzigaV, you can follow the README on the branch https://github.com/caddyserver/cache-handler/tree/feat/dependencies/bump-to-souin-v1.6.14#example-configurations.
To enable it you have to set the etcd directive with the configuration and use the etcd configuration naming https://pkg.go.dev/go.etcd.io/etcd/clientv3#Config e.g. :

cache {
    etcd {
        configuration {
            Endpoints 192.168.1.123 192.168.1.124
            AutoSyncInterval 10s
        }
    }
}

@DzigaV DzigaV closed this as completed Jul 27, 2022
@mholt
Copy link
Member

mholt commented Jul 27, 2022

Which do you recommend @darkweak ?

@darkweak
Copy link
Collaborator

darkweak commented Aug 1, 2022

@DzigaV I updated the example documentation that should be used on the cache-handler repository in this PR https://github.com/darkweak/souin/tree/feat/core/configurable-timeout-on-backend-and-cache-access/plugins/caddy.
Let me know if some parts are not well explained.

@mholt I recommend to use Olric and Badger first but in some edge cases Olric has desyncs in a K8s cluster (@eth-limo got this issue). So, in a K8s environment I recommend etcd if you need some distributed storage (but it takes more resources than Olric). And sometimes Badger run into a cache pollution and serves mismatched contents when your RAM limit is too low (when you try to store some huge responses in the Badger cache it gets corrupted, this was discover by @mattvb91). I recommend to use nutsdb on this case.
But for 90% use cases Badger and Olric are good to use and lighter than the alternatives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants