Giter Club home page Giter Club logo

graviton-aws-lambda-ffmpeg-test's Introduction

Test fixture for Graviton2/Intel AWS Lambda ffMpeg conversion

This stack makes it easy to compare Graviton2 (ARM64) and Intel (X68_64/AMD64) architecture performance on AWS Lambda for CPU-intensive video file conversions using ffMpeg.

The stack sets up a S3 bucket and two Lambda functions. Both functions take any file uploaded to the S3 bucket, resample it using ffMpeg, and output the time for the ffMpeg job (ignoring lambda startup and s3 file download time).

Prerequisites

  • GNU make or compatible makefile runner
  • aws command line tools (optionally AWS SAM to look for logs easily)
  • Node.js 14 or later

How to deploy

Deploy the stack to your aws account (replace DEPLOYMENT_BUCKET value with your bucket, optionally setting the max allowed memory size as well):

make deploy MEMORY_SIZE=10240 DEPLOYMENT_BUCKET=my-cf-deployment-bucket

by default the stack name will be graviton-test, you can change that by setting STACK_NAME during deployment, similar to the parameters above.

How to run a test

Get the upload bucket name for the stack

make outputs

Upload a video to the bucket for conversion (get the upload bucket name from the previous command)

aws s3 cp video-file.mp4 s3://UPLOAD_BUCKET_NAME

Look for logs in cloudwatch, or using AWS SAM:

sam logs -n ArmConvertFileFunction --stack-name graviton-test
sam logs -n IntelConvertFileFunction --stack-name graviton-test

Test output

Each function logs to its own cloudwatch logs, with a JSON format outputing the uploaded key, max available memory size for lambda

  • Graviton 2/ arm function
{
  key: 'pexels-i-am-sorin-6172942.mp4',
  memorySize: '10240',
  arch: 'arm64',
  time: 53565,
  fileSize: 184974533
}
  • Intel/X86 function
{
  key: 'pexels-i-am-sorin-6172942.mp4',
  memorySize: '10240',
  arch: 'x86_64',
  time: 43454,
  fileSize: 184974533
}

Published test results

graviton-aws-lambda-ffmpeg-test's People

Contributors

gojko avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.