1

i have just migrated from a single web server environment to a multiwebserver environment and i have been using nhibernate and the syscache 2nd level cache in the past.

I know i need to move to a distributed nhibernate 2nd level caching solution (memcache, velocity, etc) but (for a bunch of reasons), its going to take a little time to do that migration.

Is there anything in particular that i need to worry about with my current state (of using Syscache level 2 cache in a multi webserver environment for now) or is it just not going to be as performant as a distributed solution (given i will essentially have local parallel caches on each webserver versus a centralized cache across servers).

I am basically trying to figure out if this are any problems with this setup or its just not as fast as it could be.

skaffman
  • 398,947
  • 96
  • 818
  • 769
leora
  • 188,729
  • 360
  • 878
  • 1,366

1 Answers1

1

In a web farm environment it is recommended to use a distributed cache or each web server will have its own copy of the cache which could be less efficient. Syscache uses the the default ASP.NET cache provider so it will perform as fast as this default ASP.NET cache. By default it is stored in memory of each web server.

So SysCache using the default ASP.NET cache will work in a web farm environment but will not be as efficient if you used a distributed cache.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • what if i do an update or an insert from one web server to the DB. how does the 2nd level cache on the other web server get notified ? – leora Jul 06 '11 at 18:45
  • @ooo, with non-distributed cache the other server simply doesn't get notified. With distributed cache a special hash function is used in order to calculate on which server the corresponding item is stored. – Darin Dimitrov Jul 06 '11 at 20:05
  • if it doesn't get notified, couldn't that lead to the other server trying to update data that is stale ? – leora Jul 07 '11 at 00:08
  • what are your thoughts on my last comment ? – leora Mar 31 '12 at 14:33
  • My thoughts are you are correct. I guess Darin didn't know the answer. Did you ever get any testing or results on this? – David C Aug 20 '13 at 22:19