mirror of
1
Fork 0
gotosocial/internal/config
kim 00adf18c24
[feature] simpler cache size configuration (#2051)
* add automatic cache max size generation based on ratios of a singular fixed memory target

Signed-off-by: kim <grufwub@gmail.com>

* remove now-unused cache max-size config variables

Signed-off-by: kim <grufwub@gmail.com>

* slight ratio tweak

Signed-off-by: kim <grufwub@gmail.com>

* remove unused visibility config var

Signed-off-by: kim <grufwub@gmail.com>

* add secret little ratio config trick

Signed-off-by: kim <grufwub@gmail.com>

* fixed a word

Signed-off-by: kim <grufwub@gmail.com>

* update cache library to remove use of TTL in result caches + slice cache

Signed-off-by: kim <grufwub@gmail.com>

* update other cache usages to use correct interface

Signed-off-by: kim <grufwub@gmail.com>

* update example config to explain the cache memory target

Signed-off-by: kim <grufwub@gmail.com>

* update env parsing test with new config values

Signed-off-by: kim <grufwub@gmail.com>

* do some ratio twiddling

Signed-off-by: kim <grufwub@gmail.com>

* add missing header

* update envparsing with latest defaults

Signed-off-by: kim <grufwub@gmail.com>

* update size calculations to take into account result cache, simple cache and extra map overheads

Signed-off-by: kim <grufwub@gmail.com>

* tweak the ratios some more

Signed-off-by: kim <grufwub@gmail.com>

* more nan rampaging

Signed-off-by: kim <grufwub@gmail.com>

* fix envparsing script

Signed-off-by: kim <grufwub@gmail.com>

* update cache library, add sweep function to keep caches trim

Signed-off-by: kim <grufwub@gmail.com>

* sweep caches once a minute

Signed-off-by: kim <grufwub@gmail.com>

* add a regular job to sweep caches and keep under 80% utilisation

Signed-off-by: kim <grufwub@gmail.com>

* remove dead code

Signed-off-by: kim <grufwub@gmail.com>

* add new size library used to libraries section of readme

Signed-off-by: kim <grufwub@gmail.com>

* add better explanations for the mem-ratio numbers

Signed-off-by: kim <grufwub@gmail.com>

* update go-cache

Signed-off-by: kim <grufwub@gmail.com>

* library version bump

Signed-off-by: kim <grufwub@gmail.com>

* update cache.result{} size model estimation

Signed-off-by: kim <grufwub@gmail.com>

---------

Signed-off-by: kim <grufwub@gmail.com>
2023-08-03 11:34:35 +02:00
..
gen [feature] Use Read/Write lock for config (#1969) 2023-07-10 12:56:14 +01:00
testdata [feature] Add a request ID and include it in logs (#1476) 2023-02-17 12:02:29 +01:00
config.go [feature] simpler cache size configuration (#2051) 2023-08-03 11:34:35 +02:00
config_test.go [feature] support configuring database caches (#1246) 2022-12-11 13:03:15 +00:00
defaults.go [feature] simpler cache size configuration (#2051) 2023-08-03 11:34:35 +02:00
flags.go [feature] Allow users to skip http client tls verification for testing purposes (with appropriately loud warnings) (#2052) 2023-08-01 18:50:17 +01:00
global.go [chore] Improve copyright header handling (#1608) 2023-03-12 16:00:57 +01:00
helpers.gen.go [feature] simpler cache size configuration (#2051) 2023-08-03 11:34:35 +02:00
state.go [feature] Use Read/Write lock for config (#1969) 2023-07-10 12:56:14 +01:00
util.go [feature] enable + document explicit IP dialer allowing/denying (#1950) 2023-07-07 16:17:39 +02:00
validate.go [chore] Improve copyright header handling (#1608) 2023-03-12 16:00:57 +01:00
validate_test.go [chore] Improve copyright header handling (#1608) 2023-03-12 16:00:57 +01:00