tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: [Seriously OT] Help in diagnosing server unresponsiveness
Date Tue, 05 Feb 2013 23:10:15 GMT
Hash: SHA256


On 2/2/13 11:47 AM, chris derham wrote:
>> In the Java world, most people would only call it a consider it
>> a "cluster" if the app servers actually know about each other --
>> for instance, if you are using session replication. IMO session 
>> replication is a dog, and there are better ways to achieve
>> similar goals that yield much higher performance.
> I am curious to hear your thoughts - care to elaborate?

We've totally hijacked Zoran's thread. After this, let's move to a new
OT thread (or threads).

Tomcat's session replication basically blasts everything around to all
other Tomcat instances (or you can choose one and use BackupManager).
Every time you modify your session, you get a burst of traffic between
all your cluster members.

I dunno if Tomcat bothers updating the last-touched-time on the
session if that's the only thing that changed during the request, but
if so it means that there is a burst of replication traffic after
/every single request/.

Most web applications I've seen use HttpSession for a variety of
things, and not all of them need to be replicated. If you want to
hand-roll some wrapper objects to allow you to stash things into the
session that are not serializable (or shouldn't be serialized, like a
"transient" wrapper) you can avoid some of this stuff, but you really
shouldn't have to do this kind of thing.

Instead, rely on some other data-sharing mechanism such as a database,
memcached, etc. You can create a token that you pass to the client
just like a JSESSIONID cookie and if they fail-over to a different
node, you can still fetch your stuff when you need it.

The problem with using HttpSession + session replication is that lazy
programmers will stash just about anything into the session without
thinking about it, and it will get replicated all over the place. If
you use an external data storage mechanism, it's much more obvious
that something "special" is happening, and (hopefully) your devs will
take more care with dipping into that data store all the time.

- -chris
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools -
Comment: Using GnuPG with Thunderbird -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message