Comments (7)
I just make it work with a db.Shrink() at the end, it works fine but I don't have clues of why the AutoShrink don't work.
from buntdb.
Hi,
I'm sorry to hear that your running into issues. I would like to reproduce this issue on my side.
Do you update your config using the db.WriteConfig
function? If so, could you provide your configuration code?
from buntdb.
Are you still running into this issue? I wasn't able to reproduce it.
from buntdb.
Iām closing this for now but feel free to reopen if you are still running into problems. Thanks!
from buntdb.
func TestAutoShrink2(t *testing.T) {
dbpath := "/tmp/test_2.db"
if db, err := buntdb.Open(dbpath); err == nil {
db.SetConfig(buntdb.Config{
AutoShrinkDisabled: true, // not work
AutoShrinkMinSize: 1, // not work
AutoShrinkPercentage: 30,
})
for i := 0; i < 20; i++ {
writeCache2(db)
time.Sleep(time.Second * 5)
}
}
}
func writeCache2(db *buntdb.DB) {
for i := 0; i < 10000; i++ {
log.Println("--> ", i)
val := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
db.Update(func(tx *buntdb.Tx) error {
tx.Set(fmt.Sprintf("%s%d", "test", i), val, &buntdb.SetOptions{Expires: true, TTL: time.Hour})
return nil
})
}
}
the db file size is sustained growth ... without Shrink
I would it like file-rotatelogs
from buntdb.
from buntdb.
Are you wanting to disable AutoShrink?
Your code is disabling the AutoShrink. This will make the database continue grow until db.Shrink()
is called.
from buntdb.
Related Issues (20)
- Python bindings
- Enhancement: add new method GetWithTTL to return value together with TTL
- What happens if two funcs write to the db at the exact same time? HOT 1
- Get size of db on disk
- Does the data.db file support rewrite like redis AOF? HOT 2
- Dependencies update due?
- Feature Request: Delete inside iterator
- Question: cost/benefit of supporting generic types; and persisting secondary indexes
- Is it necessary to (defer) db.Close()?
- Expiry works only during runtime and is lost on shrink HOT 6
- index, or getting with different keys doesn't work HOT 1
- tx.Ascend doesn't work correctly HOT 1
- Does buntdb needs Go 1.18+ due to btree dependency? HOT 1
- Question: What is the format of .db file? HOT 1
- I wonder if we can find closest lat long for a given latlon from spatial index using nearby
- [Feature Request] Is there a way to limit memroy usage?
- Is there any plan to support index on MessagePack? HOT 1
- How to renew the ttl?
- Question: Is buntdb goroutine-safe? HOT 1
- Will "group by" be supported in this lib?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from buntdb.