Skip to content

Commit

Permalink
Update slot definition and remove DuckDB driver cpuThreadRatio
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspersjo committed Jul 1, 2024
1 parent df35d1d commit 921948f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion admin/provisioner/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (p *KubernetesProvisioner) Provision(ctx context.Context, opts *ProvisionOp
Names: names,
Host: strings.Split(host, "//")[1], // Remove protocol
CPU: 1 * opts.Slots,
MemoryGB: 2 * opts.Slots,
MemoryGB: 8 * opts.Slots,
StorageBytes: 40 * int64(opts.Slots) * int64(datasize.GB),
Slots: opts.Slots,
Annotations: opts.Annotations,
Expand Down
2 changes: 1 addition & 1 deletion admin/provisioner/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (p *StaticProvisioner) Provision(ctx context.Context, opts *ProvisionOption
Host: target.Host,
Audience: target.Audience,
CPU: 1 * opts.Slots,
MemoryGB: 2 * opts.Slots,
MemoryGB: 8 * opts.Slots,
StorageBytes: int64(opts.Slots) * 40 * int64(datasize.GB),
}, nil
}
Expand Down
7 changes: 3 additions & 4 deletions runtime/drivers/duckdb/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ import (
)

const (
cpuThreadRatio float64 = 0.5
poolSizeMin int = 2
poolSizeMax int = 5
poolSizeMin int = 2
poolSizeMax int = 5
)

// config represents the DuckDB driver config
Expand Down Expand Up @@ -104,7 +103,7 @@ func newConfig(cfgMap map[string]any) (*config, error) {
if cfg.ThreadsOverride != 0 {
threads = cfg.ThreadsOverride
} else if cfg.CPU > 0 {
threads = int(cpuThreadRatio * float64(cfg.CPU))
threads = cfg.CPU
if threads <= 0 {
threads = 1
}
Expand Down

0 comments on commit 921948f

Please sign in to comment.