S3 simple storage

S3 is a web based storage service geared for CloudFront (CDN) and file serving.

Performance

Speed in EC2 is about 8MBytes/sec for both reads and writes. While not as fast as EBS volumes, this is more than enough for most scenarios. Also, it possible to open many simultaneous connections without significant slow downs because S3 is distributed. The API library you use to communicate with S3 can also have an impact on performance, this is especially true for libraries that cache files (see the note on S3 filesystems).

API

S3 based filesystems

There are a number of S3 based filesystems, all based on fuse. A file system is probably the most convenient way to use S3, but at the cost of some overhead. For most applications, operations such as listing the files are unnecessary and expensive. The upside is that S3 filesystems employ caching which minimizes the overhead and may even give a performance boost over direct API calls. Performance varies greatly from application to application, so be sure to test your specific application.

S3FS?

s3fs is currently the most advanced free S3 based filesystem, which doesn't really mean much as they all suck. s3fs will not work well with rsync, even in version 1.30 (even though they claim is does), it is not even remotely POSIX compliant and in general should not be trusted for anything but simple read/write. Performance is decent, around 8MB/sec on EC2 per single file but with parallel connections it should be enough for most things. <strike>Cache only works for writes, not for reads!</strike> Additionally, s3fs can not (as yet) seek to the middle of a file without caching it first, so application that use seeking on large files should expect a significant initial delay while s3fs is fetching the entire file from S3.

IAM and S3FS?

At the bare minimum, s3fs will need all read privileges on bucket items, the s3:ListAllMyBuckets permission on all buckets and all read/list permissions on the bucket itself. E.G. for r/w access to a bucket:
{
  "Statement": [
    {
      "Effect":"Allow",
      "Action": "*",
      "Resource": "arn:aws:s3:::bucketname/*"
    },
    {
      "Effect": "Allow",
      "Action": [ "s3:ListBucket", "s3:ListBucketVersions", "s3:GetBucketLocation", "s3:GetBucketPolicy", "s3:GetBucketAcl"],
      "Resource": "arn:aws:s3:::bucketname"
    },
    {
      "Effect": "Allow",
      "Action": "s3:ListAllMyBuckets",
      "Resource": "arn:aws:s3:::*"
    }
  ]
}

-- AvishaiIshShalom - 08 Apr 2010
Topic revision: r4 - 26 Mar 2011 - 08:09:47 - AvishaiIshShalom
 

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback