Skip to content

Commit

Permalink
update granule size configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
gernest committed Feb 12, 2024
1 parent 0a80afe commit a4ca5d5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
16 changes: 11 additions & 5 deletions docs/2-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,28 @@ By default there is no limit.
## Granule Size
Size in bytes for indexes+parts that when reached they are compacted and stored in disk.

By default `256MB` is used. You need to adjust this depending on expected traffick.
By default `16MB` is used. You need to adjust this depending on your deployment resources.

> Unless otherwise `256MB` is a very conservative balance. This option is for power users.
> Unless otherwise `16MB` is a very conservative balance. This option is for power users.
> You can have production deployments sticking with the defaults.
When in memory index+`arrow.Record` reaches this size, we convert the arrow
record to parquet file with compression enabled, then the resulting file is stored in durable key/value store with configured retention period.

So, While `16MB` is in memory, what actually goes to disk is smaller than this value. We also compress the index before storing it as well.


*env*
: `VINCE_GRANULE_SIZE` example `VINCE_GRANULE_SIZE=268435456`
: `VINCE_GRANULE_SIZE` example `VINCE_GRANULE_SIZE=16777216`

*flag*
: `--granuleSize` example `--granuleSize=268435456`
: `--granuleSize` example `--granuleSize=16777216`

*file*
: `granuleSize`

```json
{"granuleSize":"268435456"}
{"granuleSize":"16777216"}
```

## Geo IP DB
Expand Down
2 changes: 1 addition & 1 deletion lsm/lsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ type Options struct {
}

const (
compactSize = 2 << 20
compactSize = 16 << 20
)

func DefaultLSMOptions() Options {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func app() *cli.Command {
&cli.IntFlag{
Name: "granuleSize",
Usage: "Maximum size of block to persist",
Value: 256 << 20, //256 MB
Value: 16 << 20, //256 MB
Sources: cli.EnvVars("VINCE_GRANULE_SIZE"),
},
&cli.StringFlag{
Expand Down

0 comments on commit a4ca5d5

Please sign in to comment.