Open Forum

Expand all | Collapse all

Is NAV Cache shared by Service Tier Instance or by computer

  • 1.  Is NAV Cache shared by Service Tier Instance or by computer

    TOP CONTRIBUTOR
    Posted 28 days ago
    This is kind of a deep technical question in regards to NAV 2018 onprem.  There are issues that are introduced when you have multiple service tiers.  For security, performance and other reasons we have one Service Tier for windows clients (lets call this Service Tier CS) on one machine and one for Web Services on another machine which we will call Service Tier WS (we actually have two more but not relevant to this conversation).  The issue has to do with NAV caching (not SQL caching).  Changes that a person makes on Service Tier CS can take up to 30 seconds before being synced (or sunk?) with the Service Tier WS due to NAV caching.  This is way too slow as the changes need to be instantly available on the other service tier.  I am very familiar with the C/AL SELECTLATESTVERSION command and the Data Cache Size setting on the service tier, these do not solve my issue, unfortunately.

    I am considering moving the Service Tier WS to the Service Tier CS computer and simply have 2 separate services on that one machine.  I do not want to run the client and web services functions on 1 individual service instance because I need to be able to restart the Web Service without kicking out users.

    So my actual question is this:
    If i have 2 separate Service Tiers on 1 physical machine (2 instances on 1 machine) will those 2 instances share the same cache?  Another way to say this is like this: Is NAV cache at the computer level or the service tier instance level?  My guess is that it is at the Service Tier instance level due to a setting or two that you set by service tier.  But I was hoping there was someone out there that could answer this question for me once and for all.




    ------------------------------
    Jason Wilder
    Senior Application Developer
    Stonewall Kitchen
    York ME
    ------------------------------
    Academy - Online Interactive Learning from Experts


  • 2.  RE: Is NAV Cache shared by Service Tier Instance or by computer

    Posted 27 days ago

    Is this a problem with NAV2018? 

    We have 17+ service tiers across two application servers (basically by department/functional area) trying to respect 20 users per tier and have never had any issues like this.



    ------------------------------
    Jason Luchka
    Senior Enterprise Applications Analyst
    siffron
    Twinsburg OH
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 3.  RE: Is NAV Cache shared by Service Tier Instance or by computer

    TOP CONTRIBUTOR
    Posted 27 days ago
    I think you can have way more than 20 users per service Tier.  We have around 70 with typically no issues. Having separate Service Tiers on the same machine might not gain you any performance benefits as the services are sharing that computers resource.You might actually gain performance by putting 100 or so users (sounds like you have 300 to 400 users) on 4 service tiers with each service Tier on a separate machine.  The more service Tiers you have the more synchronizing of cache that has to happen between each and every one of them (kind of based on the answer to my original question which I don't have answered yet).  But then again if you don't have issues then why change it.

    This is an issue for us (but probably not for most people) and it all depends on what you are doing, such as are you using web services?  We have web services grabbing sales orders, customer changes, item changes etc... for our integrations so the data needs to be up to date.  Here is an example of what does not work:
    User on Service Tier CS adds a line to a Sales order and releases the sales order which puts a record in a Queue for the warehouse management system (WMS) to pick up via a web service.  One second later the WMS uses the Service Tier WS to grab this order but because of caching it doesn't see the new line yet so it is getting incomplete information.  The fix is to use the SELECTLATESTVERSION  command but it doesn't work fast enough so our actual fix that works 100% of the time is to not allow the WMS to see these changes until 1 minute has gone by.

    It also works the other way around.  Web Service WS posts shipments that come back from the warehouse.  We have some screens that just don't update as soon as the shipment posts, it takes maybe 10 seconds or so (sometimes) because we are connected through the Service Tier CS.

    ------------------------------
    Jason Wilder
    Senior Application Developer
    Stonewall Kitchen
    York ME
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 4.  RE: Is NAV Cache shared by Service Tier Instance or by computer

    Posted 27 days ago
    When we upgraded to 2013, we were told to keep the connection count down since the service tier only has so much bandwidth on the server due to how it is architected (each service only capable of using so much RAM). We built some rather beefy servers to accommodate the number of services.

    Also, we see another benefit in keeping the tiers relatively small because we have locking issues with the high volume of our transactions. The SQL queries we have to see who is locking only show the user running the service tier, and we use specific AD accounts to run each service. As a result, I can easily see which tier is responsible for persistent locking and investigate. I can then also reset a tier without bouncing everyone in a larger department, for example.

    We haven't had any obvious issues with caching, which is why I was asking if this was related to newer builds. Like you said, if it isn't broke, don't fix it.

    ------------------------------
    Jason Luchka
    Senior Enterprise Applications Analyst
    siffron
    Twinsburg OH
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 5.  RE: Is NAV Cache shared by Service Tier Instance or by computer

    TOP CONTRIBUTOR
    Posted 27 days ago
    Big difference in NAV 2018 and later (might have been NAV 2017 that this was introduced)  is that the Service Tier is 64bit so that limitation goes away and you can have way more users on one service tier.  Having more service tiers wouldn't improve locking in any way but might actually cause more (each service tier has to talk back to the database often so you might find some locking there).  Totally agree that having many service tiers might help figure out where the locking is coming from, I really miss the seeing the locking chain from older versions of NAV.  Also I believe NAV 2013 does not utilize any Service Tier caching so you would not see this issue I am discussing at all.

    There is a tool that comes with NAV 2018 that helps see who is locking who, but it isn't great.

    Still hoping someone can answer my original question, Do 2 Service Tier instance's on 1 machine share the same cache?

    ------------------------------
    Jason Wilder
    Senior Application Developer
    Stonewall Kitchen
    York ME
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 6.  RE: Is NAV Cache shared by Service Tier Instance or by computer

    TOP CONTRIBUTOR
    Posted 26 days ago
    Agreed. I can see database locks, but then i have to go to SSMS to kill the session. Clearly users don't have access to SSMS, so they're hosed if I'm not around. I'll probably write and SSRS report that users can use to kill session ID's (not ideal, but only quick solution I see)

    ------------------------------
    Mark Anderson
    Director of ERP Systems
    Clesen Wholesale
    Evanston, IL
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 7.  RE: Is NAV Cache shared by Service Tier Instance or by computer

    SILVER CONTRIBUTOR
    Posted 23 days ago
    Where do you find the tool in NAV 2018?

    ------------------------------
    John Gaither
    American Art Clay Co
    Indianapolis IN
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 8.  RE: Is NAV Cache shared by Service Tier Instance or by computer

    TOP CONTRIBUTOR
    Posted 23 days ago
    @Gaither from the NAV Developer ​ environment go to Tools, Debugger, Database Locks.

    You can't quite get to the source of the locking but it has some interesting information.

    ------------------------------
    Jason Wilder
    Senior Application Developer
    Stonewall Kitchen
    York ME
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 9.  RE: Is NAV Cache shared by Service Tier Instance or by computer

    GOLD CONTRIBUTOR
    Posted 27 days ago

    Jason,
    Please re-state the problem you are trying to solve.  (is it performance right after a service tier is restarted)

    I don't think there is any way for a cache to be shared between instances.  The cache has to be built back up every time a service tier is re-started.  For a 75 user prod environment of NAV2013R2 we have run (for a long time) 3 service tiers, 1 for ALL users (20-70 concurrent) 1 for web services/automation, and 1 for reporting (jet+).
    The primary reason for that division was so that when needed, we could bounce the service for just web services or just reporting without dumping the cached data that all the users have built up over time.

    We did experiment some with "warm-up scripts" that could be added to the "Bounce" processes, and we did see impressive benchmarks, in the test environment anyway, where certain actions like display of a long list, were much faster, right after a service tier was re-started if the warm-up script had called the data into the cache.
    Having all users on the same service tier seemed to eliminate the need for a warm up script in PROD, however, as they just naturally logged in and got going.





    ------------------------------
    Bob Stahr
    BTC - WA
    bob@stahr.us
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 10.  RE: Is NAV Cache shared by Service Tier Instance or by computer

    TOP CONTRIBUTOR
    Posted 23 days ago
    @Stahr ​I don't think I can state better than my original post at the top of this thread.  Here it is again:
    So my actual question is this:
    If i have 2 separate Service Tiers on 1 physical machine (2 instances on 1 machine) will those 2 instances share the same cache? Another way to say this is like this: Is NAV cache at the computer level or the service tier instance level? My guess is that it is at the Service Tier instance level due to a setting or two that you set by service tier. But I was hoping there was someone out there that could answer this question for me once and for all.

    ------------------------------
    Jason Wilder
    Senior Application Developer
    Stonewall Kitchen
    York ME
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 11.  RE: Is NAV Cache shared by Service Tier Instance or by computer

    Posted 23 days ago
    Hi Jason,

    It's my understanding that each NAV/BC service has it's own cache and by default it will synchronize with other services every 30 seconds. You can schedule the synchronization between services with this parameter in the CustomSettings.config file.

    <add key="CacheSynchronizationPeriod" value="hh:mm:ss" />

    More info is available here: https://docs.microsoft.com/en-us/dynamics-nav/data-access

    I hope this helps!


    ------------------------------
    Dave Lessard
    Qixas Group Inc
    Guelph ON
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 12.  RE: Is NAV Cache shared by Service Tier Instance or by computer

    GOLD CONTRIBUTOR
    Posted 23 days ago
    Jason, How are you testing that the "synch" is happening? Dave answered your main question, but if I understand your ultimate slow problem, your writing data from CS and WS is not "seeing" that write for 30 seconds?

    ------------------------------
    Jon Long
    Director of ArcherPoint-Upgrades
    ArcherPoint Inc.
    GA
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 13.  RE: Is NAV Cache shared by Service Tier Instance or by computer

    GOLD CONTRIBUTOR
    Posted 22 days ago

    This is somewhat un-scientific as I don't know 100% where the NAV Caching is happening, but definitely on 2 separate servers the service tiers have 2 separate caches.

    When I have worked with 2 NAV service tiers - one NAV User Password (not web services) and a NAV Windows Client with windows authentication on a single server, it seems that the updates of the client happen more or less instantly in the other client.  I would have to reproduce this as I haven't done it for a while - but I think it was 2018 that I was doing this in.  There does not seem to be any significant pause.

    This would be very easy to test by adding a client tier to your server running web services and connecting to it.

    -Rob



    ------------------------------
    Robert Jolliffe B.A.Sc, MCSE, MCS - NAV Manufacturing Expert
    President
    Sabre Limited
    Cambridge
    robert@sabrelimited.com
    www.sabrelimited.com
    ------------------------------

    Academy - Online Interactive Learning from Experts


If you've found this thread useful, dive deeper into User Group community content by role