-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Memcache and multiple application instances
PostPosted: Fri Jan 18, 2008 4:30 pm 
Regular
Regular

Joined: Mon Jul 18, 2005 4:10 am
Posts: 92
Location: Poland
Hibernate version: 1.2.1.400

Hello

I am hosting many instances of the same ASP.NET application on the web server, and I need 2-nd level cache solution.

Tried SysCache but it consumed far too much server memory than I can spend on this, I started to get OutOfMemory exceptions.

Now I am trying to set up MemCache on separate machine. I configured two test instances to connect to MemCache server. And - surprise - they started to "cross-load" the objects , resulting in total mess (one application loaded objects from second instance and vice versa). After setting up log4net I discovered that MemCacheProvider does not distingush instances, eg. :

Code:
Cache lookup: interfejsLib.User, interfejsLib, Version=2.3.2939.35557, Culture=neutral, PublicKeyToken=null#1


Two instances use the same cache key, so it is possible that one application gets objects from second application's database :(
Because documentation of MemCacheProvider is very .... short, I ask you for help - is there any way to make separate "space" or something , one for every instance/database ? Running many memcache processes is not a solution , because I have over 50 application instances and there will be more in future.

Thanks in advance.

_________________
michal


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 19, 2008 6:23 am 
Regular
Regular

Joined: Mon Jul 18, 2005 4:10 am
Posts: 92
Location: Poland
Newermind, problem solved.

Again I see the best documentation is the source code ;) There is "regionPrefix" property to distinguish application instances, just needed to put it at nhibernate configuration section :

Code:
<nhibernate>
    (...)
   <add key="regionPrefix" value="InstanceName" />
</nhibernate>

_________________
michal


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 21, 2008 11:14 am 
Beginner
Beginner

Joined: Wed Jul 19, 2006 8:24 am
Posts: 35
FYI, here's a problem I had with cache regions and expirations.

http://forum.hibernate.org/viewtopic.ph ... t=memcache


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 21, 2008 4:04 pm 
Regular
Regular

Joined: Mon Jul 18, 2005 4:10 am
Posts: 92
Location: Poland
I have read your post before, I don't need different expiration times so far, thanks for the warning anyway :)

_________________
michal


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.