Lambda@Edge and AWS EC2 latency comparison










1















Currently, I have built an application on EC2 instances in multiple regions. The problems are when one instance per region need to patch/maintain, and we need more effort to handle if something fails.



I decide to use Lambda@Edge instead of EC2 and question is:



  1. Lambda@Edge is better than these EC2 instances?

  2. Need to make sure that Lambda@Edge would be reachable with the same latency or better than EC2. Have any official docs to prove this?

Thanks










share|improve this question


























    1















    Currently, I have built an application on EC2 instances in multiple regions. The problems are when one instance per region need to patch/maintain, and we need more effort to handle if something fails.



    I decide to use Lambda@Edge instead of EC2 and question is:



    1. Lambda@Edge is better than these EC2 instances?

    2. Need to make sure that Lambda@Edge would be reachable with the same latency or better than EC2. Have any official docs to prove this?

    Thanks










    share|improve this question
























      1












      1








      1


      0






      Currently, I have built an application on EC2 instances in multiple regions. The problems are when one instance per region need to patch/maintain, and we need more effort to handle if something fails.



      I decide to use Lambda@Edge instead of EC2 and question is:



      1. Lambda@Edge is better than these EC2 instances?

      2. Need to make sure that Lambda@Edge would be reachable with the same latency or better than EC2. Have any official docs to prove this?

      Thanks










      share|improve this question














      Currently, I have built an application on EC2 instances in multiple regions. The problems are when one instance per region need to patch/maintain, and we need more effort to handle if something fails.



      I decide to use Lambda@Edge instead of EC2 and question is:



      1. Lambda@Edge is better than these EC2 instances?

      2. Need to make sure that Lambda@Edge would be reachable with the same latency or better than EC2. Have any official docs to prove this?

      Thanks







      amazon-web-services amazon-ec2 aws-lambda aws-lambda-edge






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 14 '18 at 4:07









      Manh NguyenManh Nguyen

      92




      92






















          1 Answer
          1






          active

          oldest

          votes


















          2














          If the issue you're facing is one of patching and maintenance of instances then yes, Lambda or Lambda@Edge will absolutely remove that issue.



          If the issue is latency and you want to keep your instances you could create an Amazon Cloudfront Distribution that would go in front of your instances and serve cached content to your users - that might be the easiest way to start out.



          Lambda@Edge would have the same latency as Cloudfront. Lambda functions that are deployed to CloudFront edge locations have a couple of limitations.






          share|improve this answer

























          • Thanks. But have any related docs to describes it? Ex: 1. <30ms request processing time 2. <10 ms latency from worldwide users

            – Manh Nguyen
            Nov 14 '18 at 6:51












          • @ManhNguyen you can't really guarantee latency since the client plays a part in that. I don't think any CDN can guarantee latency like that. I really doubt you'll get <10ms latency worldwide. You can see the page here as an example of CDN endpoint latency: s3-accelerate-speedtest.s3-accelerate.amazonaws.com/en/… In terms of request processing time yes <30ms to pass it off to your lambda function but the time after that depends on how long your function takes. Serving directly from the cache instead of invoking a lambda will certainly complete in <30ms.

            – Randall Hunt
            Nov 14 '18 at 9:59












          • you can see a quick test here: cloudharmony.com/speedtest-for-aws:cloudfront

            – Randall Hunt
            Nov 14 '18 at 10:02










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53293064%2flambdaedge-and-aws-ec2-latency-comparison%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          If the issue you're facing is one of patching and maintenance of instances then yes, Lambda or Lambda@Edge will absolutely remove that issue.



          If the issue is latency and you want to keep your instances you could create an Amazon Cloudfront Distribution that would go in front of your instances and serve cached content to your users - that might be the easiest way to start out.



          Lambda@Edge would have the same latency as Cloudfront. Lambda functions that are deployed to CloudFront edge locations have a couple of limitations.






          share|improve this answer

























          • Thanks. But have any related docs to describes it? Ex: 1. <30ms request processing time 2. <10 ms latency from worldwide users

            – Manh Nguyen
            Nov 14 '18 at 6:51












          • @ManhNguyen you can't really guarantee latency since the client plays a part in that. I don't think any CDN can guarantee latency like that. I really doubt you'll get <10ms latency worldwide. You can see the page here as an example of CDN endpoint latency: s3-accelerate-speedtest.s3-accelerate.amazonaws.com/en/… In terms of request processing time yes <30ms to pass it off to your lambda function but the time after that depends on how long your function takes. Serving directly from the cache instead of invoking a lambda will certainly complete in <30ms.

            – Randall Hunt
            Nov 14 '18 at 9:59












          • you can see a quick test here: cloudharmony.com/speedtest-for-aws:cloudfront

            – Randall Hunt
            Nov 14 '18 at 10:02















          2














          If the issue you're facing is one of patching and maintenance of instances then yes, Lambda or Lambda@Edge will absolutely remove that issue.



          If the issue is latency and you want to keep your instances you could create an Amazon Cloudfront Distribution that would go in front of your instances and serve cached content to your users - that might be the easiest way to start out.



          Lambda@Edge would have the same latency as Cloudfront. Lambda functions that are deployed to CloudFront edge locations have a couple of limitations.






          share|improve this answer

























          • Thanks. But have any related docs to describes it? Ex: 1. <30ms request processing time 2. <10 ms latency from worldwide users

            – Manh Nguyen
            Nov 14 '18 at 6:51












          • @ManhNguyen you can't really guarantee latency since the client plays a part in that. I don't think any CDN can guarantee latency like that. I really doubt you'll get <10ms latency worldwide. You can see the page here as an example of CDN endpoint latency: s3-accelerate-speedtest.s3-accelerate.amazonaws.com/en/… In terms of request processing time yes <30ms to pass it off to your lambda function but the time after that depends on how long your function takes. Serving directly from the cache instead of invoking a lambda will certainly complete in <30ms.

            – Randall Hunt
            Nov 14 '18 at 9:59












          • you can see a quick test here: cloudharmony.com/speedtest-for-aws:cloudfront

            – Randall Hunt
            Nov 14 '18 at 10:02













          2












          2








          2







          If the issue you're facing is one of patching and maintenance of instances then yes, Lambda or Lambda@Edge will absolutely remove that issue.



          If the issue is latency and you want to keep your instances you could create an Amazon Cloudfront Distribution that would go in front of your instances and serve cached content to your users - that might be the easiest way to start out.



          Lambda@Edge would have the same latency as Cloudfront. Lambda functions that are deployed to CloudFront edge locations have a couple of limitations.






          share|improve this answer















          If the issue you're facing is one of patching and maintenance of instances then yes, Lambda or Lambda@Edge will absolutely remove that issue.



          If the issue is latency and you want to keep your instances you could create an Amazon Cloudfront Distribution that would go in front of your instances and serve cached content to your users - that might be the easiest way to start out.



          Lambda@Edge would have the same latency as Cloudfront. Lambda functions that are deployed to CloudFront edge locations have a couple of limitations.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 21 '18 at 7:13

























          answered Nov 14 '18 at 5:55









          Randall HuntRandall Hunt

          7,05442436




          7,05442436












          • Thanks. But have any related docs to describes it? Ex: 1. <30ms request processing time 2. <10 ms latency from worldwide users

            – Manh Nguyen
            Nov 14 '18 at 6:51












          • @ManhNguyen you can't really guarantee latency since the client plays a part in that. I don't think any CDN can guarantee latency like that. I really doubt you'll get <10ms latency worldwide. You can see the page here as an example of CDN endpoint latency: s3-accelerate-speedtest.s3-accelerate.amazonaws.com/en/… In terms of request processing time yes <30ms to pass it off to your lambda function but the time after that depends on how long your function takes. Serving directly from the cache instead of invoking a lambda will certainly complete in <30ms.

            – Randall Hunt
            Nov 14 '18 at 9:59












          • you can see a quick test here: cloudharmony.com/speedtest-for-aws:cloudfront

            – Randall Hunt
            Nov 14 '18 at 10:02

















          • Thanks. But have any related docs to describes it? Ex: 1. <30ms request processing time 2. <10 ms latency from worldwide users

            – Manh Nguyen
            Nov 14 '18 at 6:51












          • @ManhNguyen you can't really guarantee latency since the client plays a part in that. I don't think any CDN can guarantee latency like that. I really doubt you'll get <10ms latency worldwide. You can see the page here as an example of CDN endpoint latency: s3-accelerate-speedtest.s3-accelerate.amazonaws.com/en/… In terms of request processing time yes <30ms to pass it off to your lambda function but the time after that depends on how long your function takes. Serving directly from the cache instead of invoking a lambda will certainly complete in <30ms.

            – Randall Hunt
            Nov 14 '18 at 9:59












          • you can see a quick test here: cloudharmony.com/speedtest-for-aws:cloudfront

            – Randall Hunt
            Nov 14 '18 at 10:02
















          Thanks. But have any related docs to describes it? Ex: 1. <30ms request processing time 2. <10 ms latency from worldwide users

          – Manh Nguyen
          Nov 14 '18 at 6:51






          Thanks. But have any related docs to describes it? Ex: 1. <30ms request processing time 2. <10 ms latency from worldwide users

          – Manh Nguyen
          Nov 14 '18 at 6:51














          @ManhNguyen you can't really guarantee latency since the client plays a part in that. I don't think any CDN can guarantee latency like that. I really doubt you'll get <10ms latency worldwide. You can see the page here as an example of CDN endpoint latency: s3-accelerate-speedtest.s3-accelerate.amazonaws.com/en/… In terms of request processing time yes <30ms to pass it off to your lambda function but the time after that depends on how long your function takes. Serving directly from the cache instead of invoking a lambda will certainly complete in <30ms.

          – Randall Hunt
          Nov 14 '18 at 9:59






          @ManhNguyen you can't really guarantee latency since the client plays a part in that. I don't think any CDN can guarantee latency like that. I really doubt you'll get <10ms latency worldwide. You can see the page here as an example of CDN endpoint latency: s3-accelerate-speedtest.s3-accelerate.amazonaws.com/en/… In terms of request processing time yes <30ms to pass it off to your lambda function but the time after that depends on how long your function takes. Serving directly from the cache instead of invoking a lambda will certainly complete in <30ms.

          – Randall Hunt
          Nov 14 '18 at 9:59














          you can see a quick test here: cloudharmony.com/speedtest-for-aws:cloudfront

          – Randall Hunt
          Nov 14 '18 at 10:02





          you can see a quick test here: cloudharmony.com/speedtest-for-aws:cloudfront

          – Randall Hunt
          Nov 14 '18 at 10:02

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53293064%2flambdaedge-and-aws-ec2-latency-comparison%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Barbados

          How to read a connectionString WITH PROVIDER in .NET Core?

          Node.js Script on GitHub Pages or Amazon S3