问题
I have configured a bucket on Amazon and I use CloudFront. I upload images and videos on it.
Even though my videos are max 15 sec and I compress them (with AVAssetExportSession
in AVAssetExportPreset640x480
format + shouldOptimizeForNetworkUse
set to true
) before sending them, it seems too long to upload (sometimes more than 1,5 min).
I was wondering if I should configure several buckets in several locations in the world in order to upload the user video to the nearest bucket and reduce the upload time.
Any other suggestion is very welcome.
回答1:
Few things you can try:
You can enable "S3 Transfer acceleration" on you s3 bucket. CloudFront is helpful when downloading/accessing images. This will help in uploading. This gives more benefit when bucket location is far off from uploading location.
Second solution can be as u suggested.. And then you can create rules on bucket to automatically transfer to another Global bucket. But this makes upload asynchronus i.e. even though you have uploaded video into the bucket; still some users might not see video for some time. And this global bucket should be in region which is closes to your MOST users. Also, you need to use CloudFront here which connects to global bucket.
回答2:
I would like to answer your query part "I was wondering if I should configure several buckets in several locations in the world in order to upload the user video to the nearest bucket and reduce the upload time."
Actually there is no need to create multiple buckets in different regions because firstly you can not have duplicate bucket names, now even if you create buckets with different names based on the regions , it will be really a bad idea to manage all videos on a central region.
Now coming to the solution : You can Enable Transfer acceleration on S3 bucket : S3 Bucket Transfer Acceleration
来源:https://stackoverflow.com/questions/45254734/awss3-what-are-the-best-strategies-of-bucket-location-for-video-uploading