I have 0 experience of AppFabric but was given a task while some people were on vacation.
First question is, don't you need to configure Session State Caching and Distributed Cache on the server hosting AppFabric before you can code against it and use it?
If so where do I find information on how to do it cause I can't find any?
If not, where do I find information on what I need to include for each cache (this is for Sharepoint 2013 apps)?
Anyone who has expiernce that can help me?
Session State Caching doesn't require any server-side setup, it's purely client side, using the AppFabricCacheSessionStoreProvider class. For Sharepoint and AppFabric, there's a overview and configuration guide on MSDN, and a page on how to manage the Sharepoint Distributed Cache service on technet with an associated download on configuration and installation
Related
I have a web role with co-located cache. there are two instances of this role.
Even when there is a cache-hit, the turn-around time for our request measures to a few seconds. Upon analysis we found that the time taken by cache to get back with data is 1 second on average. However, IIS logs suggest that the overall servicing of the request takes about 4 seconds. there is no intermediate operation before or after data retrieval from cache.
What could be wrong here? What would be a good way to analyse the problem?
For what it's worth we were having a similar problem with caching in Redis in Azure and a RESTful API.
The problem turned out to be the serialization of data.
Some ways to debug the problem:
Download ANTS profile (it has a free trial) and profile your worker role locally.
Enable profiling for your worker role, deploy it, run it for a bit, then download the profile file in Visual Studio. (You can use Server Explorer to find your instance and download the log).
Download the Azure tool kit (http://blogs.msdn.com/b/kwill/archive/2013/08/26/azuretools-the-diagnostic-utility-used-by-the-windows-azure-developer-support-team.aspx) on your instance. It has things like Process Explorer that can tell you how much memory your role is taking, how much CPU, what it's doing on the network etc.
You can contact Azure support and have them help you profile your application. We did that and got absolutely amazing support. They talked with us on the phone for hours and helped us profile our code.
You really should increase the log level for client and server refer In-Role Cache Troubleshooting and Diagnostics (Windows Azure Cache) and take a look at the performance counters. If read operations (GET) is taking long time then there can be paging in one of the instances or may be there is overload on the server. If you see any performance issue on the cache instances then you should take reassess the capacity using Capacity Planning Considerations for In-Role Cache (Windows Azure Cache) .
If this doesn't help then please open a support ticket.
I'm currently building a site that will be hosted in Microsoft Azure. The last site I created in this hosting environment used "Windows Azure Shared Caching". Some of you may already be aware that "Windows Azure Shared Caching" service will soon be deprecated over the next year.
I have applied for the preview release of "Windows Azure Cache". However, I'm finding that my request is still "queued".
I wouldn't mind using "Windows Azure Shared Caching" since the site I'm building will only be live for around 10 weeks and the fact it being deprecated next year doesn't worry me. However, I am unable to create a new caching service through the old Azure Management Portal since new caching has to be done using "Windows Azure Cache".
So my question...
Since my application for the new caching platform is still yet to be approved and I am unable to create a new caching service under the old platform, what other options are there? Have I missed something?
Microsoft is surely making things difficult.
The other option you have is using In-Role Cache for Web/Worker roles (Azure Cloud Services). Any role within the same cloud deployment can access the cache. If you have just 1 web role - this acts very similar to ASP.NET State Server which provides an in-memory cache. However, as you add more web roles - you can choose to distribute this in-memory cache across all roles or use a dedicate worker role for managing the cache.
Dedicated In-Role Cache: worker role uses all available memory
Co-Located In-Role Cache: percentage of available memory is used across all roles
See In-Role Cache FAQ on MSDN for more details.
Your request should have been approved (irrespective of whether yours is a paid/trial/free subscription). If it still hasn't, put the query up here. This is the forum for Cache.
This is a proper release of the Cache Service! The core is very mature and Microsoft is giving great support on top of it. Go ahead and use it!
This flavor of Cache is THE right one for Azure Websites.
Leave a post at the forum for any concerns/issues you have. It is being constantly monitored and replied to.
I guess I am the first to suggest Azure Redis Caching?
I'm using the role-based caching feature for a windows azure web role.
Configured as co-located. I've followed the steps given by windows azure docs for caching (preview). I get the following error:
ErrorCode <ERRCA0017>:SubStatus<ES0006>:There is a temporary failure.
Please retry later. (One or more specified cache servers are
unavailable, which could be caused by busy network or servers. For
on-premises cache clusters, also verify the following conditions.
Ensure that security permission has been granted for this client
account, and check that the AppFabric Caching Service is allowed
through the firewall on all cache hosts. Also the MaxBufferSize on the
server must be greater than or equal to the serialized object size
sent from the client.). Additional Information : The client was trying
to communicate with the server: net.tcp://127.255.0.4:20010/.
I'm running everything as localhost, using the local development storage, my cache client is in the same role as the server. Changed many configuration attributes, but I always get that excpection or similar like "cannot connect to tcp....".
I'd appreciate some help. Thanks.
There are couple of things which could go wrong with your application.
Very first thing to make sure that you have SDK 1.7 in your machine even with Windows Azure Caching Services and then verify that you have reference set from Windows Azure Cache (not from Windows Server App Fabric SDK). I have seen such misconfiguration in past which lead to such errors.
Now have you changed your dataCacheClient, identifier to your ROLE Name as described in the documentation link here. If you follow the documentation as described to you should not hit any error so for the sake of checking what could be wrong, you can create exact same application as described in this link and see if that works or not.
To get more details error, please be sure to increase the DataCacheFactoryConfiguration.ChannelOpenTimeout value to longer i.e. 2 minutes then default 20 seconds as described here. This step will help you to get details about inner exception which may lead to actual root cause to your problem.
We use Azure co-located caching (not in preview anymore) as our session backer and have fairly regular outages. About once a month.
We tried using the Enterprise library Transient Fault Handling but our instances still hang when caching experiences problems. I think that the transient fault code would work for data caching, but for session backing there is some activity closer to the metal that we can't seem to code against.
The error codes have become more informative over the last year and go something like...
ErrorCode:SubStatus:The request timed out..
Additional Information : The client was trying to communicate with the
server: net.tcp://10.xx.xxx.xx:xxxxx/.
Our best guess so far from experimenting and MS support is that each, or at least one co-located cache role/instance needs to know about all the other instance's IPs, since Azure can destroy and re-up instances whenever they want, this sometimes fails to update the dependent instances. This is secret sauce for Azure, but it is not a secret when our site goes down. I'm looking for any more information on this and to see how others are working around this issue.
One possible work-around. One of our talented platform administrators found that resetting IIS on the instances and scaling up two more instances seem to help the problem. This makes sense to me because it gives caching another chance to gather all the required info about the other instances. This is NOT CONFIRMED to solve the problem but if we repeat this during the next outage it could be a valid work around.
Can anyone tell me that if I use Session(inside an ASP.NET MVC 3 application) in Windows Azure environment with multiple instances(means multiple virtual machines), then it work without any configuration or I need to use ASP.NET Universal Providers or I need to handle this manually by using AppFabric?
You can't use in-process session state, but must use a shared session state provider.
The only supported session state model is to use Azure Cache, but you can use a provider that works with either Azure Storage or SQL Azure.
UPDATE:
I wrote some articles on my blog which go into using SQL Azure for session state with Entity Framework Code First. Hopefully, you'll find useful pointers there, even if you're not using Entity Framework.
Something to bear in mind using the standard SQL Server Session State Provider is that it doesn't have the retry logic which is considered good practice when working with SQL Azure.
This discussion on ASP.NET MVC providers may help you:
http://azureproviders.codeplex.com/discussions/276053
, also, look here for how to implement a session provider using Azure AppFabric Caching:
http://weblogs.asp.net/shijuvarghese/archive/2011/05/04/using-windows-azure-appfabric-caching.aspx
"...Without any configuration..."
As Steve Morgan mentioned, The Azure AppFabric Cache provides a supported mechanism for caching. The cache itself is independent from your compute instances. In fact, a single cache could be accessed by multiple applications, if you wanted to use it in such a way.
Regarding configuration, you'll have to modify web.config, as the AppFabric Cache has a custom cache provider. The web.config snippet itself is auto-generated for you via the portal; it's as easy as copy-n-paste.
You can find out more info on caching, including sizes and pricing, here.
I heard that apps don’t port directly and they have to be specifically written to work with Azure. I’m new to Azure and did some reading but I don’t see anything from their site or documentation that suggests that you must specifically code for Azure, so is it true?
If this question is better suited for another StackExchange site please let me know.
You should take a look at the Windows Azure Platform Training Kit to see some introductory project labs.
While you theoretically can just "drop in" some apps into a Windows Azure VM, it hardly makes sense to do so. Some apps can be migrated with only minor changes, such as an asp.net website - session state is easily handled by AppFabric Cache, and the Web Role VM is Windows Server 2008 with Full IIS. However, you'd still need to integrate with Windows Azure Diagnostics, to be able to have external visibility to the health of your app.
Further, with the example above, there are more optimal things you can do, such as moving static content to blob storage, and taking load off your VMs. This requires you to upload this content, and then change your IMG and other tag URLs to point to a slightly-different URL.
Just remember that you're moving to Windows Azure to take advantage of its platform and related services, not just to be a rack to host a server. To take advantages of these services, you're going to have to target them specifically, such as:
Access control services
Caching
Connectivity (vpn, service bus)
Diagnostics
Database (SQL Azure)
Synchronization services
Traffic management across data centers
This is somewhat true. Your apps will typically run as-is. You just need to add an azure project to the solution, and add your MVC apps as roles to the Azure Project.
I found O'Reilly's "Programming Windows Azure" to be a good conceptual introduction to Azure.