Is NAV Cache shared by Service Tier Instance or by computer

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

    Posted by Jason Wilder on September 30, 2020 at 3:27 pm
    • Jason Wilder

      Member

      September 30, 2020 at 3:27 PM

      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
      ——————————

    • Jason Luchka

      Member

      October 1, 2020 at 7:30 AM

      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
      ——————————
      ——————————————-

    • Jason Wilder

      Member

      October 1, 2020 at 7:54 AM

      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
      ——————————
      ——————————————-

    • Jason Luchka

      Member

      October 1, 2020 at 8:19 AM

      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
      ——————————
      ——————————————-

    • Jason Wilder

      Member

      October 1, 2020 at 8:55 AM

      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
      ——————————
      ——————————————-

    • Mark Anderson

      Member

      October 2, 2020 at 9:43 AM

      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
      ——————————
      ——————————————-

    • John Gaither

      Member

      October 5, 2020 at 8:21 AM

      Where do you find the tool in NAV 2018?

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

    • Jason Wilder

      Member

      October 5, 2020 at 8:40 AM

      @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
      ——————————
      ——————————————-

    • Bob Stahr

      Member

      October 1, 2020 at 4:11 PM

      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
      ——————————
      ——————————————-

    • Jason Wilder

      Member

      October 5, 2020 at 8:42 AM

      @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
      ——————————
      ——————————————-

    • Dave Lessard

      Member

      October 5, 2020 at 12:09 PM

      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
      ——————————
      ——————————————-

    • Jon Long

      Member

      October 5, 2020 at 4:10 PM

      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
      ——————————
      ——————————————-

    • Robert Jolliffe

      Member

      October 6, 2020 at 9:49 AM

      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
      http://www.sabrelimited.com
      ——————————
      ——————————————-

    Jason Wilder replied 5 years, 9 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Is NAV Cache shared by Service Tier Instance or by computer’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!