Azure Logic App和Function App的性能差异 [英] Azure Logic App and Function App performance difference
本文介绍了Azure Logic App和Function App的性能差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们正在建立新项目。我们的需求是调用多个REST API并聚合响应并将其发送回移动客户端。
我们正在为我们的体验层(集成)探索这两个选项 1.逻辑应用 2.Azure函数我们观察到这两者在性能方面的一个主要差异。
我们通过简单的用例来比较性能。
我们只是调用REST API来获取具有不同选项的一些指标
- 只需将APIM作为后端服务集成
- 使用Azure函数
- 使用逻辑应用
与其他选项相比,逻辑应用程序的执行时间更长。下面是调用REST API的简单逻辑应用程序
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"GetReferenceData": {
"inputs": {
"headers": {
"Authorization": "@variables('AuthToken')"
},
"method": "GET",
"uri": "url"
},
"runAfter": {
"Initialize_AuthToken": [
"Succeeded"
]
},
"type": "Http"
},
"Initialize_AuthToken": {
"inputs": {
"variables": [
{
"name": "AuthToken",
"type": "string",
"value": "@{triggerOutputs()['headers']?['Access-Token']}"
}
]
},
"runAfter": {},
"type": "InitializeVariable"
},
"Response": {
"inputs": {
"body": "@body('GetReferenceData')",
"statusCode": "@outputs('GetReferenceData')['statusCode']"
},
"kind": "Http",
"runAfter": {
"GetReferenceData": [
"Succeeded"
]
},
"type": "Response"
},
"Response_2": {
"inputs": {
"body": "@body('GetReferenceData')",
"statusCode": "@outputs('GetReferenceData')['statusCode']"
},
"kind": "Http",
"runAfter": {
"GetReferenceData": [
"Failed",
"Skipped",
"TimedOut"
]
},
"type": "Response"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"storageLocation": {
"defaultValue": [],
"type": "Array"
}
},
"triggers": {
"manual": {
"inputs": {
"method": "GET",
"relativePath": "/referenceData",
"schema": {}
},
"kind": "Http",
"type": "Request"
}
}
},
"parameters": {}
}
我们有太多的用例需要调用多个REST API并聚合结果。从上面的数字来看,函数应用程序似乎比函数应用程序做得更好。对于并行操作,我可能会依赖持久函数而不是逻辑应用程序。
所以我只想了解为什么逻辑应用比类似操作的函数花费更长的时间,几乎是两倍的时间?
逻辑应用程序不适用于这些操作吗?
推荐答案
引用已回答此问题的另一个帖子。Is Logic Apps performance slower compared to a direct .NET REST Call?
以下添加内容可能会提供更多洞察力
"Azure函数是由事件触发的代码,而逻辑应用程序是由事件触发的工作流的单独框架。" Logic App是一个工作流的逻辑容器,您可以使用触发器和操作来定义它。
逻辑应用程序运行在Azure区域的一组基础设施上(数据中心的VM),它由几个组件组成,因为它被抽象出来了。通过设置Logic App,您可以在定义工作流并触发流程后利用该基础架构的一部分(间接通过Logic App Service)。 Azure函数是Azure Web+Mobile应用程序服务套件的一部分,旨在支持创建有意义的、可重用的小方法,以便在服务之间轻松共享。这篇关于Azure Logic App和Function App的性能差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文