ergochat / ergo

A modern IRC server (daemon/ircd) written in Go.
https://ergo.chat/
MIT License
2.23k stars 178 forks source link

ircd.db is always getting bigger and bigger #2060

Closed microaaron closed 1 year ago

microaaron commented 1 year ago

Any database operation (such as /ns erase /ns passwd) will not delete obsolete data, which makes ircd.db bigger and bigger.

FiskFan1999 commented 1 year ago

ircd.db is a bunt database and it appears that ergo uses the default AutoShrinkPercentage value of 100

slingamn commented 1 year ago

AutoShrinkMinSize is also relevant; no shrinking is expected until you reach 32 MB.

microaaron commented 1 year ago

Thanks a lot. I found the key codes. https://github.com/ergochat/ergo/blob/378d88fee253961d3dfef76805875982f359a9a3/irc/database.go#L72-L73 https://github.com/tidwall/buntdb/blob/71088bcabfa9b2ab055f47523e7bd130d736afbf/buntdb.go#L148-L152