jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Smuts <asm...@yahoo.com>
Subject Re: JCS Setup Questions
Date Mon, 07 Mar 2005 01:05:31 GMT

--- Daniel Rosenbaum <drdan321-nospam@yahoo.com>
wrote:

> Thanks Aaron for your insight.  You answered some of
> my
> questions, and I now have a better picture how to
> set this all
> up, but the following questions still remain.  Could
> you or
> someone else please be kind enough to respond?
> 
> 1) How does the "listener" get started for a lateral
> cache, what
> sets up binding of the port etc.  Is it a separate
> process or
> does it start a new thread when the cache is
> initialized in the
> web app?
> 

If you configure a region to use a lateral cache.  The
listener will startup when the cache is initialized. 
The first time you get any region or call configure,
all regions are configured.


> 2) Does the lateral cache broadcast change messages
> right away,
> or is there a thread that wakes up periodically to
> send
> messages?  In other words, is there ever a
> possibility server B
> would serve stale data after the object was changed
> on server A,
> simply because the thread did not wake up yet to
> propogate the
> change?
> 

All events to disk, laterals, remotes, etc are put
into event queues.  There are two options for the
queues.  The standard option is that every queue has
its own devoted worker thread, which dies after 60
seconds of inactivity and is started again when
something gets put in the queue.  While alive it tries
tog et stuff out of the queue.  If you put it in, it
will be pulled out as soon as possible.  The otehr
model is to configure a thread pool to be used by the
queue.  (I won't tell you how to do this right now. 
You don't really need to know.)


> 3) Similar to (2), does the lateral cache have a
> listener, or is
> it the type that wakes up periodically to check if
> there are
> messages waiting?  Put another way, does it have a
> push or a
> pull model?
> 

Incoming messages are queued just like outgoing.  The
are processed when they come in.

> 4) Is there a way to set up the lateral caches to
> only send
> invalidate messages but not serialize the objects
> and send them?
> 

I think so.  The remote cache has this.  I'll have to
check.  It is failry easy to add the feature if not.

> 5) I will be using this cache with Hibernate.  For
> some reason
> the Hibernate project deprecated the use of JCS as a
> secondary
> cache, and the new Hibernate 3.0 release does not
> even include
> the JCS plugin at all, but I see no reason why not
> to, with all
> the bug fixes lately.  Does anyone know why not to?

They deprecated it based on bugs in a 2 or 3 year old
version.  (I'll hold my tongue here.)
 
> The only
> reason I saw not to use the JCS distributed cache
> functionality
> with Hibernate is since JCS does not support locking
> and
> transactions, but I am not so concerned about this. 

It would be madness to use jboss cache in a big
cluster in locking mode.  Using jgroups for
distributed locking is not scallable.  

It also adds all sorts of complexity for puts.  Each
object is broken down into primitive elements.  Using
AOP they intercept all changes to the objects inteh
cache, so if you only modify a small field of a large
object, just that field needs to be sent over the
wire.  This solves an uncommon problem in a way that
has costs for the common situation where you have a
modest size object.  

Also, if you need that degree of data integrity, you
don't need a cache, you need a database.

> Is there
> any other reason?  (By the way, since the plugin
> code no longer
> exists on the new version of Hibernate, perhaps it
> should be
> moved to be part of the jcs code base so JCS could
> continue to
> be used with Hibernate?)

You write the plugin, send it to us, and I'll put it
in a plugin jar along with the struts plugin. 

> 
> 6) New question: the config idea with JNDI is
> interesting but I
> am not sure it is possible using Weblogic
> clustering.  With
> Weblogic clustering you would deploy a war file on
> just one
> server and Weblogic would then automatically deploy
> it on all
> the servers in the cluster for you.  There is only
> one place to
> configure all the servers.  I am not sure if there
> is a way to
> specify a different value for each server, and you
> would
> actually have only one console.  Does anyone have
> any experience
> with this, and know of a way to specify a different
> value for
> each node in a cluster?
> 

You can definitely set different values for different
servers.

Either way, I think the remote cache is a better
option.  It solves your configuration problems, since
all the local caches can have the same settings.  It
does require that you run a separate process, but it
is a better model overall. 

Aaron

> Thanks in advance,
> Daniel
> 
> 
> --- Aaron Smuts <asmuts@yahoo.com> wrote:
> 
> > Hi Daniel.
> > 
> > A removeAll sends one message, not a message for
> each
> > item.  
> > 
> > Jgroups is fine, but it is slower than the otehr
> > options.  
> > 
> > I'd use tcp lateral connections or the remote rmi
> > server.
> > 
> > If you use the tcp lateral, then you need to
> specify
> > the servers a cache should connect to.  If you
> have 3
> > servers, A, B, and C, then A should point to B and
> C, 
> > B should point to A and C, . . .
> > 
> > The problem is that this would require that you
> have a
> > different war for each app.  
> > 
> > There is asolution.  Use JNDI and a startup
> servlet. 
> > Set the server list as a value in applicaiton
> context
> > through the container.  Make a startup servlet
> that
> > configures JCS based on a properties object.  Load
> the
> > cache.ccf file and change the values you need. 
> Then
> > configure JCS with this. use the
> > CompositeCacheManager. 
> > 
> > This way you can deploy the same war to multiple
> > servers.  
> > 
> > 
> > Aaron
> > 
> > --- Daniel Rosenbaum <drdan321-nospam@yahoo.com>
> > wrote:
> > 
> > > Hello,
> > > 
> > > JCS seems to have come a long way since about a
> year
> > > ago.  Could
> > > I assume most of the bugs were fixed that the
> > > Hibernate project
> > > was reporting?
> > > 
> > > Anyhow, I am thinking about using JCS for it's
> > > clustered cache
> > > capability.  I hope the community would not mind
> > > giving me a few
> > > pointers how to set this up properly, and some
> > > insight as to
> > > what configuration options are best for me.
> > > 
> > > I have a web app running on Weblogic that is
> > > currently clustered
> > > on two servers but may go up to 5 servers or
> more. 
> > > The data I
> > > cache is mostly read only but changes
> occasionally. 
> > > I don't
> > > care so much about sharing data between servers
> but
> > > am more
> > > concerned about not serving stale data, so I
> would
> > > be happy just
> > > to send an invalidate message to the rest of the
> > > servers on an
> > > element change so they would not serve stale
> data.
> > > 
> > > I am trying to make heads or tales of the docs
> but
> > > find them
> > > difficult to understand.  As far as I could tell
> > > though a
> > > lateral cache would suit my needs best.  
> > > 
> > > 1) Since I am not so concerned about sharing the
> > > data I figure a
> > > remote cache is not so important, plus it seems
> for
> > > a remote
> > > cache I would need to start another process
> besides
> > > for the web
> > > servers.  This seems like overkill.  Am I
> correct
> > > though that
> > > for a lateral cache I would not need to start
> > > another process? 
> > > But if so I am confused how the "listener" gets
> > > started for a
> > > lateral cache, what sets up binding of the port
> etc.
> > >  The doc
> > > was not clear on this.
> > > 
> > > 2) I am unclear how I would specify servers in
> the
> 
=== message truncated ===


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-jcs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-jcs-user-help@jakarta.apache.org


Mime
View raw message