首页 \ 问答 \ AWS Lambda处理速度更快(AWS Lambda faster process way)

AWS Lambda处理速度更快(AWS Lambda faster process way)

目前,我正在实施基于S3,Lambda和DynamoDB的解决方案。 我的用例是,当在S3上上传新对象时,调用第一个Lambda函数,下载新文件,将其拆分为大约100个(或更多)部分,并为每个部分添加其他信息。 下一步,每个部分将由第二个Lambda函数处理,在某些情况下,将在DynamoDB中执行插入。

我的问题只是关于称为“第二个lambda”的最佳方式。 我的意思是,更快的方式。 我想同时执行100 Lambda函数(如果我要处理100个部分)。

我知道有不同的可能性:

1)我的第一个Lambda函数可以将每个部分作为Kinesis流中的项目推送,我的第二个Lambda函数将做出反应,检索项目并对其进行处理。 在这种情况下,我不知道AWS是否会在每次流中有剩余项目时启动新的Lambda函数。 也许有一些限制......

2)我的第一个Lambda函数可以推送SNS主题中的每个部分,然后我的第二个Lambda将对每个新消息做出反应。 在这种情况下,我对延迟(通过SNS主题发送消息的操作与我的第二个Lambda函数执行的时间之间的时间)有一些疑问。

3)我的第一个Lambda函数可以通过执行API调用并传递信息直接启动第二个。 在这种情况下,我不知道我是否可以同时启动100个Lambda功能。 我想我会被AWS API的速率限制所困扰(我说,我想!)

有人有反馈意见,可能会就我的用例提出建议吗? 再一次,对我来说最重要的是拥有更快的流程方式。

谢谢


Currently, I'm implementing a solution based on S3, Lambda and DynamoDB. My use case is, when a new object is uploaded on S3, a first Lambda function is called, downloads the new file, splits it in around 100(or more) parts and for each of them, adds additional information. Next step, each part will be processed by second Lambda function and in some case an insert will be performed in DynamoDB.

My question is only about the best way to call the "second lambda". I mean, the faster way. I want to execute 100 Lambda function(if I'd 100 parts to process) at the same time.

I know there are different possibilities:

1) My first Lambda function can push each part as an item in a Kinesis stream and my second Lambda function will react, retrieve an item and processed it. In this case I don't know if AWS will launch a new Lambda function each time there is a remaining item in the stream. Maybe there is some limitation...

2) My first Lambda function can push each part in an SNS topic and then my second Lambda will react to each new message. In this case I've some doubts about the latency(time between the action to send a message through the SNS topic and the time to my second Lambda function to be executed).

3) My first Lambda function can launch directly the second one by performing an API call and by passing the information. In this case I have no idea if I can launch 100 Lambdas function at the same time. I think I'll be stuck by a rate limitation against the AWS API(I said, I think!)

Somebody have a feedback and maybe advises regarding my use case? One more time, the most important for me it's to have the faster process way.

Thanks


原文:https://stackoverflow.com/questions/41441771
更新时间:2023-08-04 15:08

最满意答案

1)你必须删除持久性的东西,它不会帮助找到问题,因为它没有使用正确的模板。

2)您所做的更改将使用您的模板而不是yoursite.com/customer/account/login页面生成yoursite.com/customercar/account/login页面。 这是你需要的吗?

3)你使用:

<block type="core/template" name="customercar_form_login" output="toHtml" template="customercar/form/login.phtml" ></block>

这不应该是核心/模板块,而是customer / form_login块(由块覆盖)。

4)您更改其名称,因此如果您在正确的文件中没有getChildHtml,则不会调用它。

总而言之,你应该这样做:

<customer_account_login>
    <reference name="customer_form_login">
        <action method="setTemplate"><template>customercar/form/login.phtml</template></action>
    </reference>
</customer_account_login>

这将说明登录块(被覆盖的)在原始页面中使用您的新模板


1) You must remove the persistent thing, it will not help finding problem as it's not using the right template.

2) The change you made, will make the yoursite.com/customercar/account/login page using your template but not the yoursite.com/customer/account/login page. Is it what you need ?

3) you use :

<block type="core/template" name="customercar_form_login" output="toHtml" template="customercar/form/login.phtml" ></block>

This is not supposed to be a core/template block but the customer/form_login block (overwritten by your block).

4) you change its name, so it won't be called if you don't have a getChildHtml in the right file.

To sum up, you should do it this way :

<customer_account_login>
    <reference name="customer_form_login">
        <action method="setTemplate"><template>customercar/form/login.phtml</template></action>
    </reference>
</customer_account_login>

This will say that the login block (the overwritten one) use your new template in the original page

相关问答

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)