2013年6月25日火曜日

s3 の Reduced Redundancy Storage に書き込む

S3に多少のロストが許容できるようなそれほど重要でない情報を少し安く保存する、という手段として、Reduced Redundancy Storage(RSS)として書き込む、という方法があります。

以下は3年前のブログなので、改めて触れるまでも無く大多数の方はご存知でしょうが…
http://aws.typepad.com/aws/2010/05/new-amazon-s3-reduced-redundancy-storage-rrs.html

ノーマルオプション(Standard)では 99.999999999% の可用性が保証されているのに対し、RSSオプションでは 99.99% の可用性で、もし10,000ファイルをS3に置いた場合、1年の間に1つかそれ以上のファイルがロストする、という計算。ただしその分価格が33%割安、となります。
あまり長期保存しないファイルを一時的に置く、万が一ロストしても構わない、という場合RSSを選択するとかなりお得になります。


◯rubyのaws-sdkでreduced_redundancyを有効にする
http://aws.amazon.com/jp/sdkforruby/
require 'aws-sdk'

s3 = AWS::S3.new({})
bucket = s3.buckets[s3_bucket]
bucket.objects[s3path].write(Pathname.new(filepath), :reduced_redundancy => true)

◯pythonのaws-sdkでreduced_redundancyを有効にする
http://aws.amazon.com/sdkforpython/
import boto

s3 = boto.connect_s3()
bucket = s3.lookup(s3_bucket)
key = bucket.new_key(s3path)
key.set_contents_from_filename(filepath, reduced_redundancy=True)

◯Fluentdのout_s3でreduced_redundancyを有効にする。
現バージョン(2013/6/25現在)ではreduced_redundancyに対応していないので、以下のような修正を行う必要があります。
https://github.com/moaikids/fluent-plugin-s3/commit/183708f6a9a5c2eb12e8d64a9f02233c25cb3a9d

0 件のコメント:

コメントを投稿