{"id":5818,"date":"2018-10-27T13:55:00","date_gmt":"2018-10-27T13:55:00","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=5818"},"modified":"2020-03-30T02:29:50","modified_gmt":"2020-03-30T02:29:50","slug":"aws-lambda-experiment-results","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/aws-lambda-experiment-results\/","title":{"rendered":"AWS Lambda Experiment results"},"content":{"rendered":"<p>I set up an AWS lambda to update video metadata for about 75% of <a href=\"https:\/\/www.findlectures.com\">FindLectures.com<\/a>. For version two, I want to provide an option to sort based on confidence intervals within a topic (i.e. based on the number of up\/downvotes, how likely is this video to be good).<\/p>\n<p>The architecture of the update was as follows:<\/p>\n<ul>\n<li>For every video that could be updated, make a record in DynamoDB<\/li>\n<li>For each insert to DynamoDB, trigger one lambda<\/li>\n<li>For a given video, run youtube-dl to get just video metadata<\/li>\n<li>Save the video metadata to S3<\/li>\n<\/ul>\n<p>Ultimately this did not work as well as I hoped. I inserted 150,000 rows into DynamoDB. AWS ran max 15 concurrent lambdas, and ultimately I only got 3,000 successful runs of the job. There wasn&#8217;t any evidence of where the concurrency problem lies (the lamdbda &amp; account max are at 1000, and I gave DynamoDB more readers, just in case).<\/p>\n<p>Ultimately this experiment was nearly free:<\/p>\n<pre>AWS Lambda - Compute Free Tier - 400,000 GB-Seconds - US East (Northern Virginia) 42,760.113 seconds $0.00\n\nAWS Lambda Request $0.00\nAWS Lambda - Requests Free Tier - 1,000,000 Requests - US East (Northern Virginia) 17,651 Requests $0.00\n\nAmazon Simple Storage Service Requests-Tier1 $0.08\n$0.005 per 1,000 PUT, COPY, POST, or LIST requests 16,945 Requests $0.08\n\nAmazon Simple Storage Service Requests-Tier2 $0.00\n$0.004 per 10,000 GET and all other requests 777 Requests $0.00\n\nAmazon Simple Storage Service TimedStorage-ByteHrs $0.10\n$0.023 per GB - first 50 TB \/ month of storage used 4.350 GB-Mo$0.10\n<\/pre>\n<p>Lessons learned:<\/p>\n<ul>\n<li>If you naively use non batch APIs (e.g. to upload \/ retreive from DynamoDB) you lose a ton of time, even inside the AWS datacenters<\/li>\n<li>You need to replicate the AWS environment as much as you can for your own testing. E.g. your first step should be to get a sample JSON payload from DynamoDB.<\/li>\n<li>There are other tools to help replicate AWS locally (<a href=\"https:\/\/github.com\/intoli\/exodus\">Exodus bundler<\/a>, for getting binaries for the AWS Linux, and <a href=\"https:\/\/github.com\/lambci\/docker-lambda\">Docker containers<\/a>)<\/li>\n<li>The free tier sounds like a lot of requests, but note that it is also metered by time, which is easier to hit in an ETL process like this.<\/li>\n<li>Lambdas with DynamoDB are a really powerful form of stored procedures &#8211; any language, outside of a database transaction.<\/li>\n<li>If you choose to upload a zip of your lambda, you can run just about any binary, so long as it runs on Amazon linux and doesn&#8217;t write to any filesystem other than \/tmp<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Lessons learned from an early AWS Lambda prototype<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[8,22],"tags":[71,334],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"Lessons learned from an early AWS Lambda prototype\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"gary\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.garysieling.com\/blog\/aws-lambda-experiment-results\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Gary Sieling - Software Engineer\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"AWS Lambda Experiment results - Gary Sieling\" \/>\n\t\t<meta property=\"og:description\" content=\"Lessons learned from an early AWS Lambda prototype\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.garysieling.com\/blog\/aws-lambda-experiment-results\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2018-10-27T13:55:00+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-03-30T02:29:50+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"AWS Lambda Experiment results - Gary Sieling\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Lessons learned from an early AWS Lambda prototype\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/aws-lambda-experiment-results\\\/#blogposting\",\"name\":\"AWS Lambda Experiment results - Gary Sieling\",\"headline\":\"AWS Lambda Experiment results\",\"author\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\"},\"datePublished\":\"2018-10-27T13:55:00+00:00\",\"dateModified\":\"2020-03-30T02:29:50+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/aws-lambda-experiment-results\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/aws-lambda-experiment-results\\\/#webpage\"},\"articleSection\":\"Devops, Proof of Concepts, aws, lambda\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/aws-lambda-experiment-results\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.garysieling.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/devops\\\/#listItem\",\"name\":\"Devops\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/devops\\\/#listItem\",\"position\":2,\"name\":\"Devops\",\"item\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/devops\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/aws-lambda-experiment-results\\\/#listItem\",\"name\":\"AWS Lambda Experiment results\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/aws-lambda-experiment-results\\\/#listItem\",\"position\":3,\"name\":\"AWS Lambda Experiment results\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/devops\\\/#listItem\",\"name\":\"Devops\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\",\"name\":\"Gary Sieling\",\"description\":\"Software Engineer\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/\",\"name\":\"gary\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/aws-lambda-experiment-results\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0be925276d848ffe98a6a9dc8cf33e67?s=96&d=identicon&r=g\",\"width\":96,\"height\":96,\"caption\":\"gary\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/aws-lambda-experiment-results\\\/#webpage\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/aws-lambda-experiment-results\\\/\",\"name\":\"AWS Lambda Experiment results - Gary Sieling\",\"description\":\"Lessons learned from an early AWS Lambda prototype\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/aws-lambda-experiment-results\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"datePublished\":\"2018-10-27T13:55:00+00:00\",\"dateModified\":\"2020-03-30T02:29:50+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/\",\"name\":\"Gary Sieling\",\"description\":\"Software Engineer\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"AWS Lambda Experiment results - Gary Sieling","description":"Lessons learned from an early AWS Lambda prototype","canonical_url":"https:\/\/www.garysieling.com\/blog\/aws-lambda-experiment-results\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.garysieling.com\/blog\/aws-lambda-experiment-results\/#blogposting","name":"AWS Lambda Experiment results - Gary Sieling","headline":"AWS Lambda Experiment results","author":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"publisher":{"@id":"https:\/\/www.garysieling.com\/blog\/#organization"},"datePublished":"2018-10-27T13:55:00+00:00","dateModified":"2020-03-30T02:29:50+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.garysieling.com\/blog\/aws-lambda-experiment-results\/#webpage"},"isPartOf":{"@id":"https:\/\/www.garysieling.com\/blog\/aws-lambda-experiment-results\/#webpage"},"articleSection":"Devops, Proof of Concepts, aws, lambda"},{"@type":"BreadcrumbList","@id":"https:\/\/www.garysieling.com\/blog\/aws-lambda-experiment-results\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.garysieling.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/devops\/#listItem","name":"Devops"}},{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/devops\/#listItem","position":2,"name":"Devops","item":"https:\/\/www.garysieling.com\/blog\/category\/devops\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/aws-lambda-experiment-results\/#listItem","name":"AWS Lambda Experiment results"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/aws-lambda-experiment-results\/#listItem","position":3,"name":"AWS Lambda Experiment results","previousItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/devops\/#listItem","name":"Devops"}}]},{"@type":"Organization","@id":"https:\/\/www.garysieling.com\/blog\/#organization","name":"Gary Sieling","description":"Software Engineer","url":"https:\/\/www.garysieling.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author","url":"https:\/\/www.garysieling.com\/blog\/author\/gary\/","name":"gary","image":{"@type":"ImageObject","@id":"https:\/\/www.garysieling.com\/blog\/aws-lambda-experiment-results\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/0be925276d848ffe98a6a9dc8cf33e67?s=96&d=identicon&r=g","width":96,"height":96,"caption":"gary"}},{"@type":"WebPage","@id":"https:\/\/www.garysieling.com\/blog\/aws-lambda-experiment-results\/#webpage","url":"https:\/\/www.garysieling.com\/blog\/aws-lambda-experiment-results\/","name":"AWS Lambda Experiment results - Gary Sieling","description":"Lessons learned from an early AWS Lambda prototype","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.garysieling.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.garysieling.com\/blog\/aws-lambda-experiment-results\/#breadcrumblist"},"author":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"creator":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"datePublished":"2018-10-27T13:55:00+00:00","dateModified":"2020-03-30T02:29:50+00:00"},{"@type":"WebSite","@id":"https:\/\/www.garysieling.com\/blog\/#website","url":"https:\/\/www.garysieling.com\/blog\/","name":"Gary Sieling","description":"Software Engineer","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.garysieling.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Gary Sieling - Software Engineer","og:type":"article","og:title":"AWS Lambda Experiment results - Gary Sieling","og:description":"Lessons learned from an early AWS Lambda prototype","og:url":"https:\/\/www.garysieling.com\/blog\/aws-lambda-experiment-results\/","article:published_time":"2018-10-27T13:55:00+00:00","article:modified_time":"2020-03-30T02:29:50+00:00","twitter:card":"summary_large_image","twitter:title":"AWS Lambda Experiment results - Gary Sieling","twitter:description":"Lessons learned from an early AWS Lambda prototype"},"aioseo_meta_data":{"post_id":"5818","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2023-02-04 17:17:41","updated":"2026-07-06 02:29:39","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.garysieling.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.garysieling.com\/blog\/category\/devops\/\" title=\"Devops\">Devops<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tAWS Lambda Experiment results\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.garysieling.com\/blog"},{"label":"Devops","link":"https:\/\/www.garysieling.com\/blog\/category\/devops\/"},{"label":"AWS Lambda Experiment results","link":"https:\/\/www.garysieling.com\/blog\/aws-lambda-experiment-results\/"}],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/5818"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=5818"}],"version-history":[{"count":1,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/5818\/revisions"}],"predecessor-version":[{"id":6428,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/5818\/revisions\/6428"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=5818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=5818"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=5818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}