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

Count function using up lot of memory #94

Open
kaustubh-murumkar opened this issue May 24, 2023 · 1 comment
Open

Count function using up lot of memory #94

kaustubh-murumkar opened this issue May 24, 2023 · 1 comment

Comments

@kaustubh-murumkar
Copy link

We are using badgerhold in a REST API project for holding around 200-300 records. With only these amount of records our application hits it memory limit of 1GiB. We have observed a lot of OOMKilled errors on our containers.

This might possibly be a duplicate of #86 , and comments in that thread refer to the memory usage section of the documentation. But it will be more helpful if some examples are provided for the Options struct and how to use them. Also is there a way to optimise the count calls for simpler trivial queries.

@timshannon
Copy link
Owner

Badgerhold is a query engine on top of the badger. The most efficient way to get a count is by querying badger directly, which you have access to: https://pkg.go.dev/github.com/timshannon/badgerhold?utm_source=godoc#Store.Badger.

However, as mentioned in #86, that may or may not provide enough relief from memory pressures.

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

2 participants