Servicenow Instance Cache

Servicenow Instance Cache

ServiceNow is a leading provider of cloud-based services that automate and streamline IT operations. One of the key features of ServiceNow is its instance cache, which is a mechanism for storing and retrieving data in a fast and efficient manner.

The instance cache is a central repository of data that is used by ServiceNow to improve performance and reduce the number of database queries needed to retrieve data. This is accomplished by storing commonly used data in the cache, so that it can be quickly accessed without the need to query the database.

The instance cache is divided into two types of data: global and tenant. Global data is data that is shared across all instances of ServiceNow, while tenant data is specific to a particular tenant or customer. Both types of data are stored in the cache and can be accessed quickly and efficiently.

The instance cache is also used to store data that is frequently accessed, such as user and role information. This allows ServiceNow to quickly retrieve this data without the need to query the database, which improves performance and reduces the load on the database.

One of the key benefits of the instance cache is that it helps to improve the performance of ServiceNow by reducing the number of database queries needed to retrieve data. This in turn helps to improve the overall user experience and reduce the load on the database.

Another benefit of the instance cache is that it allows ServiceNow to provide a more scalable and robust service. By storing data in the cache, ServiceNow can handle a larger number of users and requests without the need to constantly query the database.

In conclusion, the ServiceNow instance cache is a powerful feature that helps to improve the performance and scalability of ServiceNow by storing and retrieving data in a fast and efficient manner. It is a central repository of data that is used by ServiceNow to improve performance and reduce the number of database queries needed to retrieve data, which in turn helps to improve the overall user experience and reduce the load on the database.


Servicenow Instance Cache

The ServiceNow Instance Cache is a distributed cache for storing objects in the ServiceNow environment.

So, as you know that the cache is used to improve the instance performance. The ServiceNow Instance or I will say the platform will take the data when we do something on Instance and what I mean by take the data??? is that it will store the data which is in database to a memory and by doing so when we again need that data then it will reload it from the cache itself, not from the database again and again.

What I know(researched) is that the Cache do the collection or stores the data of :
  • Business rules and User Interface policies(UI Policies),
  • Form Design or the layout,
  • Lists of Choice,
  • System properties, etc.
There maybe more that cache stores but I have written few points on it. The above points are simple to understand by anyone.

The important thing is when the record value or the data is updated or change happens then the cache should be clear so that the new arrangements or the values can be done/updated. For example, if the system properties are modified then the cache will be cleared for the old values and next time when needed then it will be updated.

In some cases the old cache values are not auto removed then we sometimes have to update it manually and empty the cache.

To manually clear the cache, go to:

instance.service-now.com/cache.do

Where "instance" is the code of your instance.
Ex - devXyz.service-now.com/cache.do

 

There is one more way to clear the cache is:

  1. On your Instance Navigate to "cache.do" press enter,
  2. After pressing the enter key on your content frame you will see some before and after figures for memory usage.
  3. On the top right corner of the content frame you will see "clear cache" button, just press that button and the cache is cleared from your Instance.  



Cache may affect the Instance Performance

Till now you got to know What is Cache and how it improves the system performance, what data it stores and how you can clear the cache or flush the cache manually. 

Now, suppose if you have cleared the cache from you Instance you will find your system to be slow when doing anything like querying something or switching from one module to another.

To check if the cache is cleared or flushed and that lead to poor Instance performance there are two ways: 
  1. You can check the flushed cache details by navigating to "diagnostic_event.list" table. Data in this table is maintained for some-days. 


  2. Second way to check is by navigating to "sys_cache_flush.list" table where catalog is 'syscache_everything'. On this table after clearing the cache the data will remain for the next 1 hour.


The Cache will auto generate or rebuilt if we: 

  • Add or Update System Properties,
  • Add or update dictionary entries,
  • Execute Update Sets,
  • Plugin Activation, etc.
So, if your system performance is slow don't worry it's a short term pain till the cache gets auto generated on your instance by storing data while you working on different modules or performing some create/update operations. After it you will find your Instance performance to be good as it will reload the data from cache.

Also please try not to do the cache flushing or clearing of cache on Production/Live Instance as you know it will make performance of Instance slow and many things like form layout are stored in the cache so it loads fast and remove periodically.

You must have faced this issue before but I hope now you got the information on how you can solve this by manually clearing the cache and checking for if it's cleared successfully.