views:

360

answers:

1

I have been looking at the usage reports from Amazons S3 service and noticed that there is a DataTransfer-out-bytes charge for GetObject operations (ok i understand this one) and also a DataTransfer-out-bytes charge for HeadBucket operations.

What is HeadBucket, when is this request made?

cheers

+3  A: 

That's a HEAD request to a bucket:

HEAD /my-s3-bucket

Which will basically just tell you that a bucket exists (200 OK), or not (404 Not Found).

For Example:

# curl -v -X HEAD http://s3.amazonaws.com/fooXXXX

* About to connect() to s3.amazonaws.com port 80 (#0)
*   Trying 72.21.211.144... connected
* Connected to s3.amazonaws.com (72.21.211.144) port 80 (#0)
> HEAD /fooXXXX HTTP/1.1
> User-Agent: curl/7.18.2 (i486-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.10
> Host: s3.amazonaws.com
> Accept: */*
> 
< HTTP/1.1 404 Not Found
< x-amz-request-id: A21BF750F080A267
< x-amz-id-2: SPQ7yX6Ln0Zgp0YULT/64ag9077nNnN25jH8PMLGMm/SbXPZ+FF3qFuiOyBfiktP
< Content-Type: application/xml
< Transfer-Encoding: chunked
< Date: Thu, 23 Apr 2009 13:39:50 GMT
< Server: AmazonS3

Vs.

# curl -v -X HEAD http://s3.amazonaws.com/s3hub

* About to connect() to s3.amazonaws.com port 80 (#0)
*   Trying 72.21.207.135... connected
* Connected to s3.amazonaws.com (72.21.207.135) port 80 (#0)
> HEAD /s3hub HTTP/1.1
> User-Agent: curl/7.18.2 (i486-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.10
> Host: s3.amazonaws.com
> Accept: */*
> 
< HTTP/1.1 200 OK
< x-amz-id-2: E6OvrEMD35HpJjlBg0kB90H/uaQDX8qk0oXb+baOtDKIoMXmNwgIRSX2rDE5Urlb
< x-amz-request-id: DAAAA11524A4A557
< Date: Thu, 23 Apr 2009 13:43:01 GMT
< Content-Type: application/xml
< Transfer-Encoding: chunked
< Server: AmazonS3
<
Mark Renouf
Ok thanks - so why is there a data transfer cost associated with this if it is simply to check if the bucket exists? I am using a 3rd party AMI and assume that this is making the head request. Is it likely that it is listing the bucket also before writing a file to the bucket?
undefined
Lots of things show up on the usage report. All operations are not charged the same rate, and some are free. Some have a per-request cost as well. Have a look at: http://aws.amazon.com/s3/#pricing
Mark Renouf
Actually, I'm looking at my usage report now and I see a "Requests-Tier2" charge for each HeadBucket (as expected, that's $0.01/10,000). But I also see a DataTransfer-Out-Bytes and it's higher than I would expect. (For instance, in one hour for one HeadBucket, I have 200kB?!). I would put in a request to AWS support asking about that. Please post an updated here.
Mark Renouf