Skip to content

Commit

Permalink
upload defaults to 2 threads and 256 MiB [#22]
Browse files Browse the repository at this point in the history
  • Loading branch information
bdon committed Oct 20, 2022
1 parent 0565eba commit e17d8d7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pmtiles/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@ import (

func Upload(logger *log.Logger, args []string) error {
cmd := flag.NewFlagSet("upload", flag.ExitOnError)
buffer_size := cmd.Int("buffer-size", 8, "Upload chunk size in megabytes")
max_concurrency := cmd.Int("max-concurrency", 5, "Number of upload threads")
max_concurrency := cmd.Int("max-concurrency", 2, "Number of upload threads")

cmd.Parse(args)
source := cmd.Arg(0)
bucketURL := cmd.Arg(1)
destination := cmd.Arg(2)

if source == "" || bucketURL == "" || destination == "" {
return fmt.Errorf("USAGE: upload [-buffer-size B] [-max-concurrency M] INPUT s3://BUCKET?region=region DESTINATION")
return fmt.Errorf("USAGE: upload [-max-concurrency M] INPUT s3://BUCKET?region=region DESTINATION")
}

logger.Println(source, bucketURL, destination)
Expand All @@ -45,10 +44,10 @@ func Upload(logger *log.Logger, args []string) error {
bar := progressbar.Default(filestat.Size())

nChunks := int64(0)
buffer := make([]byte, 16*1024*1024)
buffer := make([]byte, 8*1024)

opts := &blob.WriterOptions{
BufferSize: *buffer_size * 1000 * 1000,
BufferSize: 256 * 1024 * 1024,
MaxConcurrency: *max_concurrency,
}

Expand Down

0 comments on commit e17d8d7

Please sign in to comment.