question

RachelTan-1402 avatar image
0 Votes"
RachelTan-1402 asked LeoErlandsson answered

API in Logic Apps is slower compared to .NET Rest API

Hi, I have created a API using Logic Apps but it apparently slower than a Web API which i built from Visual Studio. The execution time of the Web API which I built using .NET is within milisecond but the API which built from Logic Apps took 5 seconds to 20 seconds. What can we do to improve the execution time? As this will be a API which will be executed by our partners.

azure-logic-apps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LeoErlandsson avatar image
0 Votes"
LeoErlandsson answered

Hi,

You can expect Logic Apps to be slower than a Web API. It's by design, and Logic Apps are not recommended for really time critical or real time API response times.

That said, I think that there are ways of improving the performance. Could you please detail your api design and implementation a bit more for us?

Br,
Leo

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RachelTan-1402 avatar image
0 Votes"
RachelTan-1402 answered RachelTan-1402 edited

Hi,

Can I say that Logic Apps is more recommended for a scheduler job?

The workflow of my API including :

  • validation of the existence of field records against SQL database (which I built by a nested Logic Apps)

  • execute few custom function apps which to convert value from xml to json format, to convert value to md5 format

  • connect to HTTP to run a API which hosted in API management where I imported a SOAP web service to transform to REST API

  • there are SQL stored procedure need to be executed to insert and select records (which our SQL database is running in VNET and we use ISE to connect)


Thanks.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,

Scheduling yes, but not only. I've built fast APIs in Logic Apps that responds in 200-300 milliseconds (not that fast, but acceptable).

I'd start by looking at the Run History and the times in there to determine what action it is that takes time.

Br,
Leo

0 Votes 0 ·

Hi, The weird thing is when i looking at Run History but failed to determine what action causing it takes time. As you can see from the screenshot, this simple workflow took 1.71seconds to complete. But i cannot find any actions which took 1.71 seconds to complete. This workflow only select record from database and check if the record is there or not, as simple as that. Thanks.![81637-capture.jpg][1] [1]: /answers/storage/temp/81637-capture.jpg

0 Votes 0 ·

Another sample here, this workflow spent 2.17s to complete but in history, all actions showing 0 second. Please help. Thanks. ![.][1] [1]: /answers/storage/temp/81767-capture2.jpg

0 Votes 0 ·
LeoErlandsson avatar image
0 Votes"
LeoErlandsson answered

Hi,

Well, you have 1s on the "Check valid API NAME", and then 710ms is the sum of all the other actions, including overhead.

Seems reasonable, I guess.

Br,
Leo

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.