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

Reduce an initial size of datastore. #136

Closed
sttyru opened this issue Aug 22, 2017 · 4 comments
Closed

Reduce an initial size of datastore. #136

sttyru opened this issue Aug 22, 2017 · 4 comments

Comments

@sttyru
Copy link

sttyru commented Aug 22, 2017

Hello!

My issue linked with that request but different :)

I want to run tiedot in a httpd mode at x64 VDS with reduced resources, such as disk space ( is no more dozen megabytes). In that regard, I want to reduce an initial size of datastore. At the moment, almost empty storage have a size in 384 Megabytes (it's contains only a one collection with two records). Can I to reduce disk space utilization by extremelly low (e.g. 20 Megabytes) and at the same time save a working condition and impressive performance?

Maybe somewhere is available builded bundle with minimal requirements? Or I'll need to rebuild it after I will change some values (e.g. constants)?

Thank you!

@HouzuoGuo
Copy link
Owner

Hello!

To me that was the single most important lesson on "today's constant is tomorrow's variable".

Check out this discussion for tips on altering hash table constants, although the discussion tries to increase hash table size, but using similar technique you can also reduce the hash table size:
#129

Adjusting collection data file is way easier than hash table, only one line requires an adjustment:
https://github.com/HouzuoGuo/tiedot/blob/master/data/collection64.go#L6

Making hash table's size smaller will slightly reduce performance, but feel free to do so until there's a good performance/file size balance.

@sttyru
Copy link
Author

sttyru commented Aug 23, 2017

Thank you so much for your speedy reply! 👍

I will to try to change a value and to rebuild a bundle from sources. In my sorry, I can't found a page describing of building process of software. Does this action require some special settings?

@HouzuoGuo
Copy link
Owner

No worries at all.

tiedot does not use any fancy un-official tool for building, go build alone is sufficient.

By the way, after having adjusted the hashtable and collection constants, please run all tests go test -v ./... in data/ package, to ensure that parameters are working.

@HouzuoGuo
Copy link
Owner

Feel free to come back if you have more questions.

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