GithubHelp home page GithubHelp logo

averagelatencyinsqsqueue's Introduction

Objective

  1. Calculate the average/P90 latency to get an approximate number of messages per queue using the API, GetQueueAttributesCommand

Setup

  1. 1800 standard SQS queues
  2. ~50,000 messages per queue
  3. AWS lambda

NOTE: This setup is done in a controlled environment and may not reflect actual production scenario

Results

Experiment 1

On a lambda function with 512mb resource, polling 1800 queues sequentially (~50000 messages per queue) Number of requests made: 1 per minute * (60 minutes in an hour x 730 hours in a month) = 43800 per month Result: On average, the request takes ~17094 ms, total cost ~$6.21

Experiment 2

On a lambda function with 128mb resource, polling 1800 queues sequentially (~50000 messages per queue) Number of requests made: 1 per minute * (60 minutes in an hour x 730 hours in a month) = 43800 per month Result: On average, the request takes ~52666 ms, total cost ~$4.84

Experiment 3

On a lambda function with 512mb resource, polling 1800 queues in parallel (~50000 messages per queue) Number of requests made: 1 per minute * (60 minutes in an hour x 730 hours in a month) = 43800 per month Result: On average, the request takes ~9947 ms, total cost ~$3.62

Experiment 4

On a lambda function with 128mb resource, polling 1 queue (~50000 messages per queue) Number of requests made: 1800 per minute * (60 minutes in an hour x 730 hours in a month) = 78840000 per month Result: On average, the request takes ~54 ms, total cost ~$9.03

Screenshots

Flamegraph

Flamegraph

Experiment 1 Experiment result 1

Experiment 2 Experiment result 2

Experiment 3 Experiment result 3

Experiment 4 Experiment result 4

FAQ

How many queues were used during the experiment?

aws cloudformation describe-stacks | jq '.Stacks[].Outputs[] | select(.OutputKey | startswith("latencyQueueCdkQueueStack")) | .OutputValue' | wc -l
> 1800

How many messages were used per queue?

50,000 messages per queue

averagelatencyinsqsqueue's People

Watchers

 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.