Has anyone got any experience with load balancers in combination with Silverstripe ?
I've currently got a live site which behaves quite weird behind a load-balancer (once someone is logged in into Silverstripe the system gets very very slow for that user) and I'm wondering if the caching system is acting up if there are 2 machines writing / reading to the same silverstripe-cache directory.
Is there a way to switch the entire caching system off so I can test this ?
www.demconvention.com runs on (mt) Media Temple's (gs) Grid Service - which means that many servers share a common set of directories via something like a SAN (Storage Area Network). It did involve some challenges - the biggest one was that because of the specific way the Grid servers are setup, not all directories are shared - basically only the /home directories (where all the site files are stored) was shared. So therefore, whenever you accessed a page, you would get one of (potentially) 100 servers, and the likelihood that this particular server had already cached the templates needed to generate this page was quite unlikely. I ended up hacking sapphire/core/Core.php to change the TEMP_FOLDER definition to be something that was shared across all servers, thus all servers looked in a common place for the template cache.
This might be something that could help you also - I added some notes to this wiki page on content delivery network issues which might help you. I had to contact Media Temple to confirm this with them first, but it might be a similar problem to you... or maybe it's the opposite.
Can't be entirely sure without a little more info - are the cache directories shared? How are they shared? Do you have stats on the load balancer - is it one or other of the servers that is slow?
Silly thing is that in my situation , the servers do have their webroot shared, so the silverstripe-cache directory is the same for both. But it just slows down to a near halt once you are logged in and start working in the CMS. The anonymous front-end works perfect.
Do you guys have any other ideas I could try ? ;-)
Ah, so it's the CMS itself that's slow. I'm not really sure what's going on - the CMS does load a lot of very small files, rather than a few big ones, so it's possible that the servers are tuned to not answer requests for lots of files at once for one IP address or something, or the load balancer is slow for many requests at once (unlikely, but it could also be slowing the requests to a more manageable level for the web server)?
I won't be any real help I'm afraid, are you running a custom load balanced solution? If not, what host are you with?
could you elaborate some more on the lines of code that need hacking. i'm not much of php guy, but after convincing a client to ditch their current host (really bad) for media temple i'm looking a bit red in the face.
i assumed that all instances of $ssTmp need to be modified and tried both: