Answered AppFabric Cache Notification

  • Wednesday, September 15, 2010 1:35 PM
     
     

    Hello,

    How to configure pollInterval in milliseconds using Config.App content . Iam trying

    instead of  <clientNotification pollInterval="300" /> I wrote the following

        <clientNotification>
          <pollInterval TotalMilliseconds="500"/>
        </clientNotification>  

    But it did not work. Where to find the cache configuration schema?

    Best regards

     

     

     

     

     

All Replies

  • Wednesday, September 15, 2010 2:54 PM
     
     

    Hello. Currently the pollInterval is the only setting that controls the notification polling frequency, and this is an integer that specifies the number of seconds. So there is no way to set a polling interval of less than a second in the configuration file.

    If you programmatically setup your DataCacheNotificationProperties, you can set the PollInterval proproperty to a TimeSpan object that is less than a second. However, you may find that even though you're allowed to do this that this would negatively impact performance due to the frequency that you're checking for notifications. Is there a reason that you would like to check so frequently? What types of notifications are you expecting for your design?

    Thanks!

    Jason Roth

  • Thursday, September 16, 2010 6:26 AM
     
     

    Hello,

    well I have a single task thread reading a flow of incoming requets. These requests should be logged and handled by another listening process.

    the task thread has to be looping as fast as possible and the listening process has to get a kind of asynchronous notification reading the requests.

    Thanks

    Mial

  • Friday, September 17, 2010 5:14 PM
     
     

    So, you have:

    1. A task thread that gets incoming requests. When it gets a request it creates an entry in the cache cluster?

    2. When a new item has been added to your cache, you want to be notified so that you can read it back out of the cache and process it?

    3. You're adding these items to the cache so quickly that you want a fast notification interval?

    Let me know if I understand this correctly. If the items being added to the cache are fast and unique, how are you getting value from using the Caching technology? It seems like with caching, you get the most benefit by enabling multiple calls to retrieve the same cached item rather than getting it from a slower backend data source? Sorry for all of the questions, but I think the real answer is that the technology did not expect that you would need notifications that frequently and so that put the interval in seconds. Although it does look like you could decrease this interval to milliseconds if you programmatically setup your cache client instead of the config file.

    Jason Roth

  • Monday, September 20, 2010 8:14 AM
     
     

    So, you have:

    1. A task thread that gets incoming requests. When it gets a request it creates an entry in the cache cluster?

         Ans:   That is right

    2. When a new item has been added to your cache, you want to be notified so that you can read it back out of the cache and process it?

     Ans : That is right . after processing the Item It is returned back to the cache with new additions ( some changes). Task thread has already a looping spawned thread reading the changed items.

    3. You're adding these items to the cache so quickly that you want a fast notification interval?

    That is exactly right.

     

    Let me know if I understand this correctly. If the items being added to the cache are fast and unique, how are you getting value from using the Caching technology? It seems like with caching, you get the most benefit by enabling multiple calls to retrieve the same cached item rather than getting it from a slower backend data source? Sorry for all of the questions, but I think the real answer is that the technology did not expect that you would need notifications that frequently and so that put the interval in seconds. Although it does look like you could decrease this interval to milliseconds if you programmatically setup your cache client instead of the config file.

    I have changed the interval programmatically in milliseconds and it work as expected. Could this ,by som means, regarded as a  "missusage" or a non expected use of the cahce technology?  

    /Mial

     

  • Wednesday, September 22, 2010 10:59 AM
     
     
    I reformulize my reply where You will find my comments in Bold .

     

    1. A task thread that gets incoming requests. When it gets a request it creates an entry in the cache cluster?

         Ans:   That is right

    2. When a new item has been added to your cache, you want to be notified so that you can read it back out of the cache and process it?

     Ans : That is right . after processing the Item It is returned back to the cache with new additions ( some changes). Task thread has already a looping spawned thread reading the changed items.

    3. You're adding these items to the cache so quickly that you want a fast notification interval?

      Ans: That is exactly right .

     

    I have changed the interval programmatically in milliseconds and it work as expected. Could this ,by som means, regarded as a  non expected use of the cahce technology?

      /Mial

  • Monday, September 27, 2010 12:07 PM
     
     

    Mial,

    Sorry for the slow response. I'm glad that you got this working programmatically. I don't believe that the scenario you have here is one of the projected/tested scenarios. But I'll inquire internally and let you know if I'm wrong. When you're running, I suggest that you look at the load to CPU and Network in performance monitor and make sure that the physical resources on the machine are not being negatively affected by this design.

    Thanks.

    Jason

  • Tuesday, September 28, 2010 1:04 PM
     
     Answered

    Mial,

    I confirmed that your scneario was not one of the tested ones. That also explains why it's not an option in the config file.

    So you'll want to watch if it creates an unwanted impact on the performance of your server or client. But it is an interesting use of the architecture. Thanks for sharing it.

    Jason