Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Answered

BC19 ODATA V4 - bad response time

Posted on by 5

I published a very simple codeunit as ODATA V4 endpoint:

codeunit 50000 "Webservice V4"
{
    procedure Ping(request: Text): Text
    begin
        exit(request);
    end;
}
The response time (Transfer Start in postman) is >400ms.. :-( In my opinion it should be less than 100ms.. 
Any idea?
Its a local service with credential type "NavUserPassword"..
Thanks in advance!
Categories:
  • MarKun Profile Picture
    MarKun 5 on at
    RE: BC19 ODATA V4 - bad response time

    Hi Paul

    Great - that's it! If I use the webservice access key the response time is btw. 10 and 30ms..

    Great - thank you for sharing!

  • Verified answer
    LPaulD Profile Picture
    LPaulD 65 on at
    RE: BC19 ODATA V4 - bad response time

    Hi Martin,

    If you are still following I've made a blog post about this and tweeted the Dynamics 365 gurus.

    Both Waldo and TobyNav were familiar with the issue. Did you by any chance like me authenticate via NavUserpassword instead of using a WAC (web services access key)?

    For me it was the common link in all my testing and after swapping it out in my rest client the response time dropped from 1300ms to about 10ms in BC21.

    Give it a try....

    medium.com/.../f0aafc37710b

  • LPaulD Profile Picture
    LPaulD 65 on at
    RE: BC19 ODATA V4 - bad response time

    Performed two further tests with OnPrem images which might be better suited for local testing:

    https://bcartifacts.azureedge.net/onprem/21.2.49946.49990/nl
    https://bcartifacts.azureedge.net/onprem/14.0.29537.0/nl

    So to summarize  MarKun  BC21 doesn't seem to perform better and even significantly worse than previous versions.
    Please prove me wrong @anyone

    BC Version PingPong Response Time
    BCv14 10ms
    BCv21 1308ms
    (I actually did a few calls to get the lowest number here)


    Script for replication:

    Install-Module BcContainerHelper -Force
    
    $containername = 'Nav365v21'
    
    $Username = 'paul'
    $Password = '*****************'
    $SecureString = ConvertTo-SecureString -AsPlainText $Password -Force
    $credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Username,$SecureString 
    
    
    New-BcContainer -accept_eula: $true `
                     -containername $containername `
                     -auth NavUserPassword `
                     -credential $credential `
                     -doNotExportObjectsToText `
                     -updateHosts `
                     -assignPremiumPlan `
                     -accept_outdated:$true `
                     -artifactUrl "https://bcartifacts.azureedge.net/onprem/21.2.49946.49990/nl" `
                     -multitenant:$false `
                     -isolation process




    pastedimage1672428697109v1.png

    pastedimage1672428865436v3.png

    codeunit 50001 "Ping"
    {
        trigger OnRun()
        begin
    
        end;
    
        procedure Ping(Pong: Text): Text
        begin
            exit(Pong);
        end;
    }

  • LPaulD Profile Picture
    LPaulD 65 on at
    RE: BC19 ODATA V4 - bad response time

    Hi Martin,

    That is too bad: perhaps my work today can help you and others in a better path forward:
    Our partners support team indicated that the problem probably was our setup which implies the meter will start running (it's their default response ) so I did a little more testing.
    Created a basic extension called PingPong which takes a string and returns a string, nothing more.
    Tested the following situations, each time testing response times against our current BC14 vs a local docker build with BcContainerHelper.
    The local docker build should theoretically show a better response time as it doesn't take a trip over the internet.
    The test pc is a beast with i9 and 32GB of ram.

    The latter API test as yzhums indicated that Microsoft recommended the API path forward but it's performance also worsened with BC20 -> BC21.

    I hope anyone can verify these results and could share Microsofts view on this?

    I hope I have a wrong setting or biased setup. 
    We refactored a large part of our WMS to work with BC webservices providing a future proof path but it seems now this was a bad call. Imagine having to make consecutive API/OData calls for an order pick and waiting 20 seconds for a result with each scan? 

  • MarKun Profile Picture
    MarKun 5 on at
    RE: BC19 ODATA V4 - bad response time

    Hi Paul

    Unfortunately I did not find a solution - we had this issue in BCv19 and BCv20 OdataV4 and API.. So we had to switch to an ASP-Solution :-(

    I hope for BCv21..

  • LPaulD Profile Picture
    LPaulD 65 on at
    RE: BC19 ODATA V4 - bad response time

    Hi Martin,

    Did you ever find a solution?

    I landed here with the same observation. We've implemented a solution based on OdataV4 unbound actions for BCv14 and it's quite fast. 50ms response time for simple queries. Today we setup a test server with an upgraded database to BCv20 and everything is 1000ms+ often worse.

    Fingers crossed its an easy fix and not a reimplementation

  • MarKun Profile Picture
    MarKun 5 on at
    RE: BC19 ODATA V4 - bad response time

    I tested with a very simple API Page based on a temporary table.

    Unfortunately the response time of the api is equal to the OData V4.. More than 400ms..

  • YUN ZHU Profile Picture
    YUN ZHU 70,099 Super User 2024 Season 2 on at
    RE: BC19 ODATA V4 - bad response time

    Hi, as Josh mentiond, the API is the preferred way to integrate with Business Central. 

    https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/webservices/web-services#api-web-services

    pastedimage1650507460586v1.png

    Info from Directions NA.

    pastedimage1650507490812v3.png

    Hope this helps.

    Thanks.

    ZHU

  • JAngle Profile Picture
    JAngle 33,155 on at
    RE: BC19 ODATA V4 - bad response time

    An api page would provide improved performance. Tiering wise it is api, odata then soap

  • MarKun Profile Picture
    MarKun 5 on at
    RE: BC19 ODATA V4 - bad response time

    Thank you for the response!

    Yes, the response time is +/- constant.. Between 400ms and 450ms

    Kind regards

    Martin

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,558 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,645 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans