Skip to content

Instantly share code, notes, and snippets.

@vincentsarago
Created May 2, 2019 20:52
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vincentsarago/0e8c3fba19a4b2b6855bca77f18b88fb to your computer and use it in GitHub Desktop.
Save vincentsarago/0e8c3fba19a4b2b6855bca77f18b88fb to your computer and use it in GitHub Desktop.
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

@wouellette
Copy link

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

@shahbhavin
Copy link

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

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

@shahbhavin
Copy link

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