Posts Tagged ‘amazon’

Amazon CloudFront and S3 maximum cost

Thursday, May 19th, 2011

When using utility computing platforms such as Amazon CloudFront, S3, EC2, or similar platforms from other companies, you are charged according to how much usage you or other people make of the files and services you publicly expose.

If you configure your files or services to be private only to you then you can easily control the cost. But when you make them accessible to the public (e.g. by hosting your website images on CloudFront) your costs are determined by people you have never met.

The costs tend to work out pretty cheap under normal usage, and these utility computing platforms are a great idea in theory. But what if the usage isn’t normal? What if someone decides to launch a DDOS attack on you by downloading huge amounts of data from your CloudFront or S3 account for example? I’ve no doubt that Amazon could handle the load, but could your bank account, or business cope?

cloud maximum cost worst case scenario

I’m not singling out Amazon here; the same applies for any ‘pay for computing power / bandwidth’ service. It is just that Amazon’s services set the benchmark for other similar companies so their platform provides a good example to base my calculations on.

The chances of such an attack happening to you are probably small, but the impact could be large, so it is worth doing the calculations before signing up.

Calculating the Amazon CloudFront worst case scenario

In order to calculate the worst case scenario we first need to understand how the pricing works. Amazon provides a page of pricing information on their website. You are charged for both bandwidth used, and the number of HTTP requests. The bandwidth cost varies depending on where in the world the data is downloaded from.

There are also some minor costs for file storage if you use S3 to store your data, and for loading the data if you use a custom origin server – but these are likely to be very minor costs so I will only use the bandwidth and number of requests for my calculations.

Next we need to know the maximum amount of bandwidth and requests that can be be used with your default account. Although it isn’t very easy to spot, there is a default limit listed on that pricing page of 1000 requests per second and 1000 megabits (megabits not megabytes – 1000 megabits = 125 megabytes) per second. That is a lot of data for any small hobby or business site but Amazon can cope with it. They even provide a request form if you need a higher limit.

Using these values you can see that in an hour the maximum number of requests is 3,600,000 and the maximum bandwidth usage is about 450 gigabytes.

The most expensive region to download data from is Japan so I will base my calculation on the data being downloaded at the maximum number of requests and bandwidth from the Japan prices (starting at $0.201/GB and $0.0095 per 10,000 requests as of May 2011). Of course in reality it would be impossible for someone to hit you with the maximum load, but that doesn’t matter – I’m calculating the theoretical worst case scenario here.

As the bandwidth pricing is tiered (as you move up the usage tiers the cost goes down) it is a bit hard to calculate the cost using a calculator. Amazon does provide its own cost calculator but I didn’t fancy using it for each data point so I’m using Excel instead. I’m using their cost calculator only to cross check my values to make sure that they are correct to an acceptable margin of error.

If you ever want to calculate tiered pricing then the SUMPRODUCT function in Excel is what will make it easy (once you figure out its cryptic syntax that is).

CloudFront worst case hour by hour cost for the first day

The first graph shows the theoretical worst case scenario cost for the first 24 hours of this imagionary DDOS attack on your account.

amazon cloudfront maximum cost per hour

After the first hour 0.45TB and 3,600,000 requests could have been charged to your account at a cost of nearly $94. By the end of the day the cost is just over $2200.

If an attack like this started how long would it take you to notice? Unless you sign up to a 3rd party monitoring service you wouldn’t find out about the problem until you next signed into the Amazon Web Services (AWS) console.

Even if you try to check everyday you can be hit with a big cost while you are asleep, on a plane, at dinner, or with friends. For a big business $2200 might be nothing, but how many hobbies website builders who are using AWS could say the same?

CloudFront worst case day by day cost for the first month

The next graph shows the maximum cost over 30 days. The subtle curve is the effect of the tiered pricing kicking in reducing the bandwidth cost each time you pass the next tier.

amazon cloudfront maximum cost per day

After a week your cost is over $11,000, at two weeks it is nearly $22,000, and after 30 days it could be over $42,000. About $40,000 of that is the bandwidth cost and only $2,000 is the requests cost. At the end of 30 days a maximum of 324TB of data could have been downloaded (theoretically).

Would Amazon spot and stop the bandwidth usage?

If this happened to you would Amazon (or similar companies) warn you?

I can’t find anything in their information that suggests they would. I’m not even sure if they’d notice. Although the bandwidth usage and number of hits might be huge for you, it’s peanuts for Amazon. Remember I’m basing these figures on their default throttled account. You can request much higher usage limits if you want.

Would you get a refund if this happened? Again I don’t know as their information mentions nothing about this. It does say that use are you are soely responsible for the use of your content, which may mean that if it is misued (e.g. DDOS attack) it is your responsibility to pay. You can understand that from Amazon’s point of view they will still incur costs for their own bandwidth whether the bandwidth usage is beneficial to you or not.

It would be good to see Amazon (and similar companies) clarifying their policies about whether they will offer any assistance in the event of an attack.

What do people pay for normal CloudFront / S3 usage?

There are many people posting about their AWS bills. Most of the stories I’ve read are about people saying how small their bill is. Here is a list of accounts I’ve found, some are using CloudFront, and some S3 (prices are mostly per month).

$0.12 – for a couple of days usage.
$0.86 – to host static files for a month.
$1.00 – a month to host static files.
$1.00 – a month at most for website data.
$1.22 – in a month for website images.
$1.30 – to make site go faster .
$1.50 – to host nutritional leaflet each month.
$1.69 – for a months image hosting to make site faster.
$1.81 – to serve blog images for a month.
$2.00 – for image hosting a month.
$5.00 – to make large site faster with CloudFront.
$5.00 – a month to make site ‘Reddit/Digg proof’.
$70.00 – a month on S3/CloudFront worked out cheaper than their dedicated server.
$440.40 – for storing images produced by a MySpace application.
$500,000 – a year saved by SmugMug by using S3.

Has this problem been mentioned before?

This problem has been mentioned many times on Amazon’s Web Services forums, so Amazon are aware of the issue, but as far as I’m aware no one has ever (until now!) produced worst case data for excessive usage.

Taking this thread as an example.

  • 2006 5th May – Someone requests feature to limit cost / bandwidth
  • 2006 5th May – Amazon reply to say that this ‘is in the works’. The plan is to enable you to cap the monthly charges.
  • 2006 – Other’s join in the conversation saying they would like the bill capping feature.
  • 2006 14th September – Amazon say the feature is ‘forthcoming’ but that they have no update on timing.
  • 2007/2008 – More people request the feature or updates from Amazon.
  • 2008 3rd June – Amazon reply saying it is still on their list of things to add but that they don’t expect to release it this year.
  • 2008 – A few more customers request the feature.
  • 2008 25th October – Amazon reply again saying it is still on the list, but they have no date to announce.
  • 2008/2009 – A few more customers request bill capping on AWS.
  • 2009 23rd March – Amazon reply and say the feature has been calendered to appear late this year or early next year.
  • 2009 3rd June – Amazon reconfirm the late this year / early next year timeframe in reply to another poster.
  • 2009/2010 – Many more replies from customer requesting some kind of cost limiting feature.

What can Amazon do?

Firstly they could make it possible to reduce the allowed bandwidth and number of hits. As the connection is already throttled, and as it is possible to increase the values, I’m sure it wouldn’t be that hard for them to allow you to reduce the limits.

And secondly they could allow you to configure a cost limit per day/week/month. Perhaps with a warning when 70% of your bandwidth is used up for example. This is what many metered web hosts do if you are near their limit.

A combination of both of these would probably be a good solution for most people who are worried about their potential bills.

Also as I previously mentioned it would be good for them to have clear public policies of what would happen if your account were hit by a DDOS attack leading to an unusually large bill.

What can I do?

If you are concerened you can add your voice to the discussions happening on the AWS forums, or try to contact Amazon directly to request these cost control features.

You can sign up for a 3rd party AWS monitoring service, which could notify you if the costs go abover a certain amount.

And finally

I’ll stress again that this problem is by no means unique to Amazon. In fact I’m not aware of any utility comuting provider that allows you an easy way to limit your costs, or throttle your usage. Therefore it won’t help you if you to change to another similar company.

I’m not saying that you shouldn’t use these services; in fact they are very useful and usually work well with good reliability. Just be aware of the risks.

Most importantly check your AWS account very regularly to monitor your costs.

Update: 11th May 2012

Amazon have now introduced automatic billing alerts. These won’t stop your charges from going up, but at least you will be notified if your pre-set limit is reached. See http://aws.amazon.com/about-aws/whats-new/2012/05/10/announcing-aws-billing-alerts/.

Update: 8th June 2012

They have now introduced a billing data API http://aws.typepad.com/aws/2012/06/new-programmatic-access-to-aws-billing-data.html.

Still no way of forcibly capping the charges to a pre-determined amount, but they are at least providing more ways to monitor the charges.

Samsung N140 netbook real world review

Thursday, December 3rd, 2009

I’m going to review it based my real world experiences of using it.

The Samsung N140 comes in a fairly compact box. If you are used to buying standard sized laptops then you’ll notice the difference in size and weight of the box straight away.

samsung n140 box

Inside the box is the N140 itself. At the time I bought mine there was a black version and a white version. I went for the black one. The exterior is made of shiny black plastic that soon accumulates smudge marks. When closed you can see the silver trim that goes round the N140. The silver trim is one of the few physical differences between the N140 and the N110.

I got the Windows XP version. If you buy it now then you’ll probably have to buy it with Windows 7. The N140 specs are fairly standard for a netbook. It has 1gb of RAM, 160gb hard drive, a 10-inch screen, and an Intel Atom N270 CPU. The big plus over many similar netbooks is its claimed 9-hour battery life for WinXP (7.5 hours for Windows 7).

samsung n140 netbook closed

Also in the box are the battery, mains adaptor, a DVD, some basic manuals, and a soft zip-up case.

samsung n140 box contents

To get up and running you’ll need to plug the battery in, plug the mains charger in, and then turn it on using the slide switch on the front. The battery does bulge out of the bottom of the case but I have actually found the shape makes the netbook easier to hold when carrying it around, especially when it is in its case.

Setting up the Samsung N140 takes about an hour, as the initialisation process requires multiple reboots. You’ll have to decide how you want to split the 160gb hard disk space between the c: and d: drives (which requires a reboot). I went for a 51gb c: drive and a 91gb d: drive.

It needs another reboot to create a backup image of the initial OS contents onto the hard drive in case a full restore is needed. And I seem to recall that there were a few more reboots that were needed before the N140 was finally ready to use.

When it was finally ready to go I spent another hour or so installing my usual anti-virus and security software (Avast, Spyware Blaster, Rapport).

Samsung N140 Keyboard

I’m used to touch typing on a full sized keyboard and have had no problems touch typing on the N140 keyboard that is 90% of the size of a full keyboard. It is a much larger and more comfortable keyboard than others found in similar sized netbooks.

My only criticisms of the keyboard are that:

  1. The right hand shift key is in the wrong place. It is too far to the right of the keyboard so I find I keep on pressing the ‘\’ instead of shift.
  2. The Home and End keys aren’t dedicated keys. You need to press the function key to use them. I use the Home and End keys all the time so I do find this a bit annoying.

samsung n140 netbook open

Samsung N140 Screen

The screen resolution is 1024×600, the standard for a netbook. The image is sharp and the screen brightness is reasonable – the image doesn’t go as bright as my Sony Vaio but it is good enough for general use and usable outdoors.

One advantage the N140 has over the N110 is that the screen is matte rather than glossy. This vastly reduces the reflections you get in the screen and makes it easier to use the N140 outside.

If you are used to a desktop monitor then you may find the 600-pixel height to be a bit cramped. You may find it useful to turn off the Windows taskbar or learn how to make your applications go full screen. For example Internet Explorer and Firefox can be made full screen by pressing F11 – which makes browsing the web much more pleasant.

The one problem with the screen is that its angle of backward tilt is limited. The angle is fine if you are using the N140 at a desk. However if you are sitting in a chair with the N140 on your lap – as you might well do with a lightweight netbook – then you might find that the screen doesn’t go as far back as you’d like.

samsung n140 screen tilt angle

Battery life

The area where the N140 stands out is its battery life. It has a claimed battery life of 9 hours and I find that when I use it for real (using several applications, WiFi, and with the screen brightness turned up) it certainly lasts at least 6 to 7 hours. If you were to reduce the screen brightness and turn on the power saving mode then I’m sure you’ll get more usage time out of the battery.

The battery is great as you can go out for a day with the N140 without needing the power supply. You can work on it for several hours, and whereas a standard laptop would be running out of juice, the N140 reports that its battery still has plenty left in it.

Weight and size

The weight is reported as being 1.33kg with the battery. Its size is standard for a netbook. I can easily slip it into my rucksack and still have plenty of room left for whatever else I want to carry. The weight is low enough so you can carry it around all day. I’ve even gone hill walking with it on my back!

Other features

The N140 has a built in webcam, microphone, and speakers, which makes this a great device to use with Skype. A headphone and a microphone socket are on the side should you need them.

There are three USB ports, two on the right side and one on the left. Also on the left side is a VGA output and network port.

WiFi and bluetooth are built into the model that I have and I’ve found the WiFi to be very reliable. The button to disable the WiFi and Bluetooth (for airplane usage) is a soft key rather than being a dedicated switch so you’d need to turn the N140 on in order to disable them.

At the front is an SD card slot and finally on the right is a Kensington security slot.

The trackpad is a reasonable size for a netbook like this and is perfectly usable.

I tend to use a wireless mouse myself as I’m not a fan of trackpads – I’ve bought a Trust wireless mini mouse with a micro sized receiver which takes up one of the USB ports. The receiver is small enough that I can put the N140 into its case without having to remove the receiver.

The power supply is compact and works on multiple voltages. I’ve had no problems using it on both 240v UK power supplies and 100v power supplies abroad.

Samsung N140 real world usage

After having used the Samsung N140 regularly for two months here are my findings on how it copes with the kind of computing tasks I do. Please note that I’m basing my findings on an N140 that has been upgraded to 2gb of RAM rather than the 1gb that mine shipped with. In the background I have Avast anti-virus and Spybot Search and Destroy running all the time.

  • Word processing – I’m regularly editing documents using Word 97 with no problems. Currently I’m writing this blog entry and have Firefox and ACDSee running in the background as well. OpenOffice runs fine as well but is slower than Word.
  • Internet – No problems with multi-tabbed browsing in Firefox, Internet Explorer or Chrome. When I’m browsing I’ll often have the Thunderbird email client, a word processor such as Word 97, and the FileZilla FTP client in the background at the same time.
  • Photo editing – ACDSee and PaintShop Pro 5 can happily be running at the same time when I’m editing my photos.
  • iTunes – Syncing with my iPod Touch and downloading new songs or applications from the iTunes store is fast enough, even if I have other apps in the background.
  • Syncing photos from my camera – Syncing photos from my camera is speedy.
  • Videos – Ripping a DVD (using an external DVD drive) at 50% compression takes about 90-120 minutes for a 90 minute film. The VideoLAN player is capable of playing the resulting film on the N140. I’d suggest you: 1) Enable the ‘Increase the priority of the process’ option by going to Tools->Preferences, clicking ‘All’ in the ‘Show settings’ option, and then going to ‘Advanced’. 2) Put the N140 on fast mode. 3) Video is one area where the N140 can’t cope well if multi-tasking with other applications. If you are doing video ripping, or playing then I’d recommend you close down your other applications.

Conclusion

In conclusion the Samsung N140 is a great machine for computing when away from home or if you are happy to have a smaller screen.

The battery life is amongst the best available right now. The combination of screen, keyboard, and good CPU power (for a netbook) make this a very useful device.

I’d recommend upgrading the RAM to 2gb if you intend to run multiple programs at the same time.

I’ve had mine for two months now and when away from home have no regrets about leaving my main laptop behind.


Adding spacing round an iframe in WordPress

Wednesday, March 5th, 2008

It was whilst writing a review of the book ‘boo hoo’ that I spotted a problem with embedding iframes in WordPress postings. As I was reviewing a book I wanted to add an Amazon Product link. These product links are in the form of iframes. An example of the HTML is below. I added the align="right" myself as I wanted the text to flow around the iframe.

<iframe src="http://rcm-uk.amazon.co.uk/e/cm?t=advancedhtml-
21&o=2&p=8&l=as1&asins=0099418371&fc1=000000&IS2=1
&lt1=_blank&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr"
style="width:120px;height:240px;" scrolling="no"
marginwidth="0" marginheight="0"
frameborder="0" align="right"></iframe>

You can see from the image that in WordPress (in the default theme anyway) there is no spacing between the left edge of the image and the text. This looks wrong so I wanted to find a solution to this.

Amazon iframe problem

It seems that there are no padding tags that you can add to an iframe unless you use style sheets. I wanted a simple solution that I could just embed in the HTML. The solution that I chose was to put the iframe in a table and set the cellspacing attribute of the table to the required amount padding. Instead of using align in the iframe I am now using it in the table. The HTML and result of this change are shown below.

<table border="0" cellspacing="10" align="right"><tr><td>
<iframe src="http://rcm-uk.amazon.co.uk/e/cm?t=rmlcouk-
21&o=2&p=8&l=as1&asins=0099418371&fc1=000000&IS2=1
&lt1=_blank&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr"
style="width:120px;height:240px;" scrolling="no"
marginwidth="0" marginheight="0"
frameborder="0"></iframe>
</td></tr></table>

Amazon iframe fix

You’ll probably agree that the Amazon product links looks much better with the extra spacing.

Sony Cyber-shot W80 digital camera review

Thursday, January 24th, 2008

I’ve been using the Sony Cyber-shot for over two months now, long enough to know what’s good and bad about it.

It is a 7.2 megapixel camera featuring 3 times optical zoom. It has a slightly higher spec than the Sony W55. The extras it has over the W55 are optical stabilisation technology and a microphone. It was about £30 more expensive than the W55 at £140 but I needed a camera with a microphone as I wanted to take some basic videos as well as taking photos.

Sony Cybershot W80 digital camera front

The internal memory is so small that it is not even worth bothering with so you’ll need to budget for a memory stick pro duo card. I got a 4gb card for less that £15 from Amazon’s marketplace.

Before using the camera you’ll need to charge the battery. It charges from an external charger rather than internally which means that if you are travelling you will have to take an extra bit of kit with you. The battery life is very good. I’ve gone out on many a day, taken around 150 photos and some video and the battery still has plenty left in it. Sony say it can take over 300 photos on a single charge.

The quality of the photos are really good for a camera in this price range. You can see reduced sized photos that I’ve taken with this camera at http://www.londonphotoproject.co.uk/blog/. These are all taken with the ‘auto’ setting. There are a variety of different settings for taking photos at night, in snow, at the beach and more. You can also adjust many of the parameters such as ISO, EV and focusing. I haven’t experimented with these as ‘auto’ seems to get the settings right.

The various settings are adjusted with a wheel. I have a slight critisism here, it is very easy for the wheel to get turned without you knowing if you keep the camera in your pocket. It would be good if the wheel could be locked in place.

Sony Cyber-shot W80 digital camera back

It performs well when taking photos at night or in low levels of light, the flash is powerful and adjusts to the light level correctly.

It is not just the quality of photos that matters, the speed at which the camera becomes ready to take photos after being switched on and after taking a photo has been taken is important. This camera is fast at turning on and the turnaround time between taking each photo (shutter lag) is very good too.

I mentioned that one of the reasons for me buying this camera was its video features. If you set the video to ‘fine’ then it will record video at 30fps. The microphone makes a difference as videos with sound are much more engaging than those without sound.

Good points

  1. High quality photos. See some of my day photos and night photos taken with this camera.
  2. Low shutter lag
  3. Video capabilities with microphone

Bad points

  1. External battery charger
  2. Easy to move settings wheel without meaning to when camera is in your pocket.

Overall rating

This camera isn’t perfect but for its price I’m definitely glad I bought it. You can buy it from Amazon here. I’d give it 9/10.

Update January 2011: I wrote this review nearly three years ago, but the Sony W80 is still the camera I use every day. All the photos up to this date on reviewmylife were taken with the W80. I am thinking of getting a better camera at some point in the next year. I’ll again get a compact camera, but perhaps with higher end features. i.e. better zoom, better night photo support, better optical stabilisation. I’ll probably get a Sony again, and if/when I do I’ll review it here.

Playing with Amazon’s aStore

Sunday, August 5th, 2007

I’ve been playing with Amazon’s new aStore. Instead of adding each individual book link (that takes your viewer straight to Amazon’s main site), you can create an ‘aStore’ within your own site. You get to choose which books appear with a few simple clicks and you can customise the look of the page. Your website reader can browse your books and add them to the shopping basket all whilst remaining on your site.

There are three ways you can integrate the aStore into your site.

  1. Link to store direct on Amazon, simple to use but not very integrated – e.g. http://astore.amazon.co.uk/advancedhtml-21.
  2. You can embed the aStore in a frame – only useful if frames will fit in with your site.
  3. Embedded in any page using an iframe. e.g. http://www.advancedhtml.co.uk/htmlbooks.htm

I’ve gone for the 3rd option as this is the one that looks most integrated with Advanced HTML. There is one side effect. As you can see from the HTML code below the default height is set at 4000 pixels.

 <iframe src="http://astore.amazon.co.uk/advancedhtml-21"
 mce_src="http://astore.amazon.co.uk/advancedhtml-21"
 width="90%" height="4000"
 frameborder="0" scrolling="no"></iframe>

It causes your web page hosting the aStore to be very tall. There is a good reason for this; if you move to a specific product page, the product reviews are shown in the iframe. If you change the height to be less than 4000 then some of your product links may have truncated reviews.

I’ve decided to leave the height at 4000, and just make sure that any page which has the aStore doesn’t have any content after the iframe.