Session states in mojoPortal

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
7/7/2011 8:59:15 AM
Gravatar
Total Posts 130

Session states in mojoPortal

Hi Joe,

I'm running on 2.3.5.3 MSSQL multi site mode and we are in the process of migrating to a virtual machine cluster; we have a failover server and a health probe that switches back and forth between our two server clusters based on server responsiveness. The main cluster replicates to the failover cluster every 15 minutes. 

Anywho, I've been migrating mojo sites to the cluster and a funny thing is happening; Session states are not being maintained.  This is problematic because when a Site Editor creates & publishes a new page in mojo, the display of content is out of whack (new pages not showing up) on pages that are hitting the failover server.  In about 15 minutes the replication occurs and both views match, but for that 15 minutes depending on what page you load, the display is incorrect and confusing.

This threw me off because I thought that content creation was being solely written to the database (so even if session state was not maintained the data would still be presented).  I looked in the web.config to see how session states are handled but didn't see <sessionState> present.

Can you please advise?

Thanks,

Beth

7/7/2011 9:15:00 AM
Gravatar
Total Posts 18439

Re: Session states in mojoPortal

Hi Beth,

This is because of caching of the site map. Currently we clear the cache when a new page is created or one is deleted by touching cache dependency files down under /Data/Sites/[SiteID]/systemfiles so that is why the other nodes are not updating right away because their copy of the dependency file did not get touched. So next time the app pool recycles it would clear the cache or once the sync happens it may touch the file and clear the cache.

I think a simple failover server arrangement should work fine but we don't yet officially support Web Farms and will probably need to revisit our caching strategy for that scenario. So if you are frequently changing back and forth the active node it will result in this kind of problem whereas if the failover is a once in a while thing it should work fine.

I can say that in the next few months I'll be focusing on WebFarm support. I've got something else I'm working on at the moment that I need to finish first, but Web Farm support is next on my list.

Best,

Joe

7/7/2011 3:25:15 PM
Gravatar
Total Posts 130

Re: Session states in mojoPortal

Thanks for explaining how the cache is currently working.  On a related note I'm trying to change the directory location for the site media directories so they are removed from the cluster.  I've been reading the neatUpload documentation but haven't figured out where I can change the default upload directory.  Any advice?

Thank you!

~ Beth

7/8/2011 10:02:17 AM
Gravatar
Total Posts 18439

Re: Session states in mojoPortal

Hi Beth,

NeatUpload settings only control the temporary upload location, if App_Data is writable it will use that location for the temporary else it uses Windows\temp I think.

Application code determines where the file is stored after it is uploaded.

You could copy the /Data folder to a network share or drive accessible to the nodes and then remove it and then create a virtual directory named /Data that points to the share location, this way from IIS point of view everything writable is still under /Data. I know there are some issue with using network shares with IIS but there are solutions so you may need to do some googling.

Hope that helps,

Joe

7/11/2011 10:00:01 AM
Gravatar
Total Posts 130

Re: Session states in mojoPortal

Hi Joe,

Thanks for the advice.  I'm going to use a virtual directory and create a service account to access the share in IIS.

One other question; where in the source code do you handle caching for page menus etc?  I'd like to try to shorten the cache time so that the delay in synchronization between our servers is minimized. I found some cache settings in the web.config but am thinking that is not the only place you have set cache times.

Thanks for your help,

Beth

7/13/2011 9:24:28 AM
Gravatar
Total Posts 18439

Re: Session states in mojoPortal

Hi Beth,

In terms of the site map, it currently has no cache expiration, the only thing that expires it is when the app recycles or when we touch the dependency file which happens when a new page is created or a page is deleted or allowed view roles are changed.

Best,

Joe

7/22/2011 2:07:39 PM
Gravatar
Total Posts 130

Re: Session states in mojoPortal

In case someone else runs into the same issues, this is how I made mojoPortal work (meaning handling caching & file uploads) in a web farm with a failover server.

  • created a service account with access to a file share not on the virtual machines.
  • in IIS 7 created an app pool that runs through the service account and applied my mojo sites to that app pool
  • created a virtual directories in mysite/data/sites/mysitenumber/ for 'media' and 'systemfiles'
  • created those directories on the file share and deleted from the mojo installation
  • made sure those virtual directories were running through the service account

With this in place I don't have to worry about some files getting uploaded to one server and some to the other (depending on which site the ACE module is serving) and also regardless of which server is being utilized, each time the cache dependency files are touched, they are immediately reflected in all locations.

Good luck,

Beth

You must sign in to post in the forums. This thread is closed to new posts.