Saqib Ullah

BootStrapper Know How

  Home  |   Contact  |   Syndication    |   Login
  112 Posts | 1 Stories | 1124 Comments | 15 Trackbacks

News



Article Categories

Archives

Post Categories

Blogging websites

Favourite Blogs

Private Links

Sites

Error:

 


There is a temporary failure. Please retry later. (The request failed, because you exceeded quota limits for this hour. If you experience this often, upgrade your subscription to a higher one). Additional Information : Throttling due to resource : Connections."


If you Google this issue, you only find different blogs and forums where geeks discussing this issue and giving suggestion to each other.
Even when I counter this issue I also review my application architecture and I re-write the Azure Appfabric cache component on the
following concept.

 

One connection per web role instance for DataCacheFactory


Important thing that you want to keep in mind is only one instance of DataCache is created per instance of DataCacheFactory and
GetDefaultCache() returns back the same instance each time.

To get rid of from this error I created OnPremCache class that is accessible from Instance property (basically I implemented a singleton
class) and call my OnPremCache methods from WCF Web Role service. 

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.ApplicationServer.Caching;

namespace Saqibullah.Com
{
    public sealed class OnPremCache
    {
        private DataCacheFactory dataCacheFactory = null;
        private DataCacheFactoryConfiguration dcfc = null;
        private DataCacheLocalCacheProperties local = null;
        private DataCache dataCache = null;

        public static readonly OnPremCache Instance = new OnPremCache();

        private OnPremCache()
        {
            LoadCacheConfiguration("default");
            dataCacheFactory = new DataCacheFactory(dcfc);
            dataCache = dataCacheFactory.GetDefaultCache();
        }

        private void LoadCacheConfiguration(string defaultorSSLEndpoint)
        {
            dcfc = new DataCacheFactoryConfiguration(defaultorSSLEndpoint);
            local = new DataCacheLocalCacheProperties(1000, TimeSpan.FromMinutes(5), DataCacheLocalCacheInvalidationPolicy.TimeoutBased);
            dcfc.LocalCacheProperties = local;
        }

        public object Get(string key)
        {
            return dataCache.Get(key);
        }
      
        public void Put(string key,object obj)
        {
            dataCache.Put(key, obj);
        }
      
        public void Add(string key, object obj)
        {
            if (dataCache.Get(key) == null)
                dataCache.Add(key, obj);
        }
     
        public void Remove(string key)
        {
            dataCache.Remove(key);
        }

    }
}

 

WCF Web Role class and interface and sample Data class.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace Saqibullah.com
{
    [DataContract]
    public class Data
    {
        [DataMember]
        public string Emp_Id { get; set; }

        [DataMember]
        public string Emp_Name { get; set; }

        [DataMember]
        public string Emp_Designation { get; set; }

        [DataMember]
        public string Emp_Salary { get; set; }

        [DataMember]
        public string Emp_IsManager { get; set; }

        [DataMember]
        public string Emp_CasualLeaves { get; set; }

        [DataMember]
        public DateTime ServerDate
        {
            get
            {
                return DateTime.Now;
            }
            set { }
        }
    }

    [ServiceContract]
    public interface IService1
    {

        [OperationContract]
        Data GetData(string clientId);

        [OperationContract]
        void PutData(string clientId, Data obj);

        [OperationContract]
        void RemoveData(string clientId);

        [OperationContract]
        void UpdateData(string clientId, object obj);

    }

    public class Service1 : IService1
    {

        public Data GetData(string clientId)
        {
            return OnPremCache.Instance.Get(clientId) as Data;
        }

        public void PutData(string clientId, Data obj)
        {
            OnPremCache.Instance.Add(clientId, obj);
        }


        public void RemoveData(string clientId)
        {
            OnPremCache.Instance.Remove(clientId);
        }

        public void UpdateData(string clientId, object obj)
        {
            OnPremCache.Instance.Put(clientId, obj);
        }
    }
}

posted on Thursday, October 13, 2011 3:20 AM

Feedback

# re: Azure Appfabric Cache connections throttling issue 11/29/2011 6:25 PM Cleveland Design Build
Ya , Just notice solution. that was really fabulous way of representing

# hii 12/12/2011 9:46 PM Rec to rec agencies Dubai
The war came at a great cost in lives and economic damage—half a million Iraqi and Iranian soldiers as well as civilians are believed to have died in the war with many more injured—but it brought neither reparations nor change in borders.

# re: Azure Appfabric Cache connections throttling issue 12/29/2011 11:25 AM Rencontre Webcam
cool et merci pour cet article...

# re: Azure Appfabric Cache connections throttling issue 5/19/2012 5:57 AM langweilig
the Paleo Challenge is concerned, the clean eating habits definitely stuck with me after it was over. so its definitely incredibly beneficial

# re: Azure Appfabric Cache connections throttling issue 5/23/2012 11:13 PM los angeles accounting firm
Instance property (basically I implemented a singleton
class) and call my OnPremCache methods from WCF Web Role service.

# rock 7/23/2012 4:56 PM tax relief
the clean eating habits definitely stuck with me after it was over.

# re: Azure Appfabric Cache connections throttling issue 9/26/2012 6:36 AM specialty fasteners
Thanks a lot for providing the amazing info is visible in this blog that to sharing the great services in this blog.


# re: Azure Appfabric Cache connections throttling issue 9/30/2012 8:17 PM legal marketing
I have been to many websites for research and I can assert that it is one of the best informative resources I have used so far.


# re: Azure Appfabric Cache connections throttling issue 10/29/2012 3:46 AM Weekly London Rental
I was trying this. but could not do it perfectly.you nicely showed the whole process.I am now confident about doing this perfectly.

# re: Azure Appfabric Cache connections throttling issue 11/3/2012 9:05 PM hostel nyc
It seems so mucheasy here.Now I cando it i think.

# re: Azure Appfabric Cache connections throttling issue 11/26/2012 8:32 PM reverse mortgage for senior
I think this is very wonderful article! I believe that we can see here, it will strive to do every step of the positive. Thank you!


# re: Azure Appfabric Cache connections throttling issue 11/29/2012 2:55 PM pradaxa lawsuit
I not to mention my buddies happened to be following the great pointers from your web blog and then then developed a horrible suspicion I never thanked the web blog owner for those techniques.


# re: Azure Appfabric Cache connections throttling issue 12/1/2012 12:46 AM Maria K
Great tip, the Azure Connections are working well again :-)

# re: Azure Appfabric Cache connections throttling issue 12/3/2012 7:14 PM mesothelioma law firm
You provided a valuable service to the community. Thank you for doing such a great job all these years.


# re: Azure Appfabric Cache connections throttling issue 12/4/2012 12:40 PM authorized user
Your article was very insightful. I shared it with my family and they enjoyed it too

# re: Azure Appfabric Cache connections throttling issue 1/1/2013 12:24 PM san diego accident lawyer
It refers to the work done in providing primary care, secondary care and tertiary care, as well as in public health. Thanks


# re: Azure Appfabric Cache connections throttling issue 1/5/2013 7:01 PM beats by dre
Boy, was that a process. The title is trying to express all the strange juxtapositions that I experienced -- a tall white guy in western China

# re: Azure Appfabric Cache connections throttling issue 1/14/2013 8:13 PM PG-510
Inkjet printer when not in use, it should be placed into the cartridge box, remove the print cartridge, and as much as possible to ensure that the cartridges ambient thermostat, not the cartridge placed directly into the strong sunlight. Inkjet printer you need to keep it clean in the state has not been used for a long. Is preferably back into the box, not exposed to the air for a long time to accumulate dust.http://www.britanniainks.co.uk/products/Remanufactured-PG-510-High-Capacity-Ink.html

# re: Azure Appfabric Cache connections throttling issue 2/24/2013 6:31 AM Lucy FAS
This worked perfect for my project. Thanks for Azure tips

Post A Comment
Title:
Name:
Email:
Comment:
Verification: