Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AppFabric Cache server and web application on same physical machine

I am considering using AppFabric caching feature for one of our projects. We have a need for distributed caching feature and it seems AppFabric is a good solution. However, I have a few questions which I hope will be answered here.

We are considering to host AppFabric Cache server on the same machine where our web application is installed. I have found on MSDN article stating that AppFabric should be installed on a dedicated machine. It is also noted there that AppFabric can be installed on the same machine as application itself but some issues should be considered (quote from article):

Windows Server AppFabric cache hosts should be dedicated to the caching service, which means that those servers are not also used as application, web, or database servers. It is possible to use non-dedicated cache servers in a cluster, but this scenario is not supported. Despite this policy, if you decide to use non-dedicated cache hosts, make sure to properly estimate and test the configuration for each cache host to allow enough memory and network resources for both the caching service and all other services on the machines. Also understand that spikes in processor and network utilization by other services will negatively impact the performance and stability of the cache cluster.

Here is a link to this article: Article #1

Now, this sounds reasonable enough, I was thinking that limiting amount of RAM AppFabric cache can use would be enough. But, reading another article on MSDN I have found this:

For both physical and virtual machines, you should note the location of the cache cluster to the application or web servers that use the cache. If they are in separate data centers, make sure that the latency between those datacenters will not negatively affect your performance. At this stage it might be tempting to use your application or web servers for your cache servers. Although possible, this is not supported. First, any resource usage spikes by services such as IIS on those machines could impact the cache cluster. Second, the caching service assumes that it is on a dedicated server and can potentially use more much more memory than you specify.

Here is a link to this article: Article #2

If I understand correctly statement above, this means that despite my config settings for AppFabric, it will take as much RAM as it wants? Can this be really true? Has anyone some experience with configuration where application and AppFabric are located on the same machine?

like image 620
buhtla Avatar asked Nov 16 '11 08:11

buhtla


1 Answers

To share my story on appfabirc, we started using appfabric caching on a shared server, but eventually had to take it out because of the following issues...

  1. we were trying to save objects in it, and do that you have to serialize the whole graph and send it to server, in a high demand scenario, not sure how much more efficient it is than puling from db itself. Plus you can say goodbye to any any delegates or events wireups, or async operations in your objects..

  2. The caching service itself would intermittently throw errors saying its not avaialable and then you will have to go and check the health of it using powershell. Also anytime your box is using more than 90% of RAM, it would stop working..

  3. Even if there is a little bit of memory pressure on the box, it aggressively tries to evict items from the cache and was always taking around 10-20% of cpu for that....

to sum it up, i think MS recommendation is correct that it needs to have its own dedicated cluster, but then again every application has its own unique needs and you should evaulate it against parameters in your deployment environment.

like image 128
np-hard Avatar answered Sep 21 '22 13:09

np-hard