Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How much will it cost to convert all the Sentinel-2 JPEG2000 to COG ?

Let's see how much it will cost to translate all the Sentinel-2 JPEG2000 to COGs using AWS Lambda https://github.com/developmentseed/sentinel-2-cog (Note at this scale AWS Lambda might not be the cheapest option).

How many S2 scenes do we have on AWS?

$ curl https://sat-api.developmentseed.org/collections/sentinel-2-l1c/items | jq -r '.meta.found'
5 633 438

Lambda config

  • Memory: 2048
  • RunTime: 30 to 50 seconds (30 seconds for partial scene).

Sentinel-2 Info

  • 12 bands

Cost $

Number of individual files

5 633 438 * 12 = 67 601 256

Run Time

67 601 256 * 40s = 2 704 050 240 seconds*

*we assume a 40 seconds mean time.

Go/seconds

2048/1024 * 2 704 050 240 = 5 408 100 480 Go-s

Go-s price (first 400 000 are free)

(5 408 100 480 - 400 000) * 0.00001667 = 90 146.36 $

Invocation price (0.20 per 1M, first Million is free)

(67 601 256 - 1 000 000) / 1 000 000 * 0.20 = 13.32 $

90 146.36 + 13.32 = 90 159.68 $

Total Cost: 90 159.68 $

How long will it take ?

67 601 256 / 10 000 (Concurrent Execution Limit) * 40 sec = 270 405seconds = 4506 minutes = 75 hours = 3.13 days

@vincentsarago
Copy link
Author

vincentsarago commented May 3, 2019

This was made as an example to show how fast/cheap AWS Lambda is. I've ignored the data transfer + data storage cost on purpose.

@wouellette
Copy link

wouellette commented Oct 25, 2019

Thanks for the benchmark! That seems to be a cost-killer compared to alternatives. Will definitely give it a go

@shahbhavin
Copy link

shahbhavin commented Feb 19, 2020

If someone has already converted it is it possible to share that converted COG data to one of centralize s3 bucket to use?

@vincentsarago
Copy link
Author

vincentsarago commented Feb 20, 2020

@shahbhavin There is some work happening right now but nothing officially released yet!

@shahbhavin
Copy link

shahbhavin commented Mar 9, 2020

Do you know when is it tentatively available officially?

@plant99
Copy link

plant99 commented Oct 9, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment