Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Robin Hjelmeir 24 posts 85 karma points
    Jan 09, 2014 @ 21:58
    Robin Hjelmeir
    0

    Load Balanced Back Office Caching Issue in 6.1.6

    I am in a load balanced environment (amazon) where the back-office (admin section) needs to be on each server. I have found no instructions (outside http://our.umbraco.org/documentation/Installation/load-balancing which just says "If you require that the back office is load balanced you may have to do additional custom development to ensure this works seamlessly." - so no help) to help me set up my servers when the back office is not on a single designated server.

    The problem: publish content on one server, not showing up on other servers frontend. Trying to via umbraco code, rebuild the local cache on the secondary servers from script/code residing on the secondary servers that loads the cache from the central database.

    I am attempting to deal with the caching issue. I have an event hook for AfterPublish that I *want* to rebuild all local server cache. None of the suggestions in http://our.umbraco.org/wiki/reference/api-cheatsheet/publishing-and-republishing solve my problem.

    Here is my event hook code: https://gist.github.com/rhjelmeir/8341713 which does not work (the event is fired, but not rebuilding cache, items still do not show up on the frontend). I do not have the proper understanding of umbraco or load balancing to be much help to myself. Most of the documents (I can find) dealing with caching are not updated for v6.

    If you know of anyway to truly refresh all local cache from the database please let me know. Or why the refreshing of cache will not work in a load balanced environment. I need layman's terms :-)

    Or if v7 does any better with caching?

    Thanks, Robin

  • Chris Keyes 6 posts 26 karma points
    Mar 17, 2014 @ 15:17
    Chris Keyes
    0

    Have you had a look at the distributed call config??:

    <distributedCall enable="true"> <user>0</user> <servers> <server>server1.mywebsite.com</server> <server>server2.mywebsite.com</server> <server>server3.mywebsite.com</server> </servers> </distributedCall>

     

    See Umbraco Configuration below the ASP.NET Configuration Section (sorry no internal links to send you there).

    http://our.umbraco.org/documentation/Installation/load-balancing

     

    Probably too late by now but good luck.

     

     

     

     

  • Robin Hjelmeir 24 posts 85 karma points
    Mar 17, 2014 @ 17:35
    Robin Hjelmeir
    0

    Thanks Chris for your response. Per the docs

    "XML the distributed server names are the custom DNS names created for each IIS host name for each server."

    Have you gotten the distributed config to work with dynamic load balancing? Amazon assigns a random dns for each server and it changes everytime we do a deploy.

    But anyways, we created a (ridiculous) hackish workaround for our caching which entails adding an on application start hook within Umbraco that adds our new hook into the publish event. This hook saves the doc id to a database table (call it published), with the current server id. We have a second table (propagate). We set up a cron script that runs every 5 mins (on each server), that checks this published table for new doc ids and compares to the propagated table. If this document hasn't been propagated to the other servers (the current server), we run a function on the current server that updates the cache for that doc id, then it gets added to the propagate table with current server id.

    It's a long complicated process, but it works for now. If anyone wants, I can post code and a better detailed process.

  • Chris Keyes 6 posts 26 karma points
    Mar 17, 2014 @ 17:44
    Chris Keyes
    0

    Interesting! We have physical servers right now - I haven't played with AWS. Definitely something to keep in mind should we ever look at it.

     

    Sorry I'm no help there then :(

  • Dan Lister 416 posts 1974 karma points c-trib
    Mar 17, 2014 @ 17:47
    Dan Lister
    1

    You may want to have a look at this package which has just been released. It implements a similar service to Distributed Calling. It's one (and only) provider works with Amazon ELB environments and 1 to N instances.

  • Robin Hjelmeir 24 posts 85 karma points
    Mar 17, 2014 @ 17:55
    Robin Hjelmeir
    0

    Dan, thanks for the info. I will check out the package

  • Robin Hjelmeir 24 posts 85 karma points
    Mar 17, 2014 @ 18:08
    Robin Hjelmeir
    0

    Hey Dan,

    Is there a place I can ask questions regarding your package? Like what you call to refresh the cache on each server?

  • Dan Lister 416 posts 1974 karma points c-trib
    Mar 17, 2014 @ 18:12
    Dan Lister
    1

    I've added a forum to the package's page if you've got any questions or suggestions.

Please Sign in or register to post replies

Write your reply to:

Draft