I'm using go aws sdk to put object to s3. It takes about 1 second to upload the file. To test the concurrency, I have an http server that I hit with ab -c10 -n10 http://localhost:8080
and the handler calls this code:
func (service *Service) LogResponseManager(resp gorequest.Response, s3key string) {
uploader := service.S3Manager
defer resp.Body.Close()
params := &s3manager.UploadInput{
Bucket: aws.String("cslogs.sellbrite.com"), // Required
Key: aws.String(s3key), // Required
Body: resp.Body,
ContentType: aws.String("text/plain"),
}
uploader.Upload(params)
}
I'm using the echo server to receive requests and if I were to just sleep 1 second in the handler the time to execute all 10 requests in parallel is just 1 second. However when uploading too s3, the time to execute 10 concurrent requests seems to be adding up in serial, close to 8 seconds. Is the go sdk not executing s3 uploads concurrently?