[Resin-interest] clustering config and changing servers

2008-07-09 Thread Bernard Bernstein

Running Resin 3.0.21

We are running many resin servers, each have applications that manage  
their own clustering using Tangosol for their shared data. However,  
the applications do not handle their own user sessions. We use resin  
for that, and generally that has been fine as long as we have our load- 
balancers keep their sessions sticky, talking to the same server. Now  
we are considering making our sessions less sticky, which means we'll  
need to start using clustering for sessions at the Resin level.


Here's the hard part.

We have many servers running many instances or applications. Always at  
least a pair of any instance running. Currently when we deploy to a  
pair of servers, there is no configuration we need to do on those  
servers. Each instance has their own port across all servers, so  
Tangosol is able to use broadcast to find it's cluster members and  
figure out it's cluster set. When a machine goes down, we simply copy  
an instance to another machine, fire it up, and the pair for that app  
is running again.


Is it possible to have Resin clustering work with no configuration per- 
machine? Is there any solution that would allow Resin instances on the  
same port to find each other, or to have a single configuration for  
all instances regardless of their ip address so that they can be  
clustered no matter where they are?


One thought is to have a list of all possible ip addresses (or just  
the final part of the address) as the id for each, then in the launch  
script, we can pass in the id of the local ip address for the machine.  
That means, that we'll 254 servers listed in the configuration when  
only two will actually exist in many cases.


eg.
server
  http id='2' port='${hport}'/
  http id='3' port='${hport}'/
  http id='4' port='${hport}'/
  http id='5' port='${hport}'/
...
  http id='254' port='${hport}'/

  cluster
   srun id='2' host='10.0.0.2' port='${aport}'/
srun id='3' host='10.0.0.3' port='${aport}'/
srun id='4' host='10.0.0.4' port='${aport}'/
srun id='5' host='10.0.0.5' port='${aport}'/
...
srun id='254' host='10.0.0.254' port='${aport}'/
  /cluster

And let's say the launch script calls something like this:
${ipend} = final part of the full ip address
launch-command -Dhport=10080 -Daport=20080 -server=${ipend}

I'm thinking this solution would cause logs full of connection  
failed errors and lots of overhead dealing with failed connections.
Another thought is if there is some way to use a Persistent Store with  
always-load-session and always-save-session set, so that the cluster  
members don't need to know each other, but rather just handle their  
sessions through the database with no interaction with each other.  
Perhaps even better yet, they could store these sessions through a  
memcached instance which can save/restore using a database but provide  
memory-based access to the session store.


All suggestions welcome. I'm hoping there's a known best-practice  
solution for this, so let me know.

Thanks,
Bernie


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] SOLVED: Slooow file reads (really weird!)

2007-10-08 Thread Bernard Bernstein
I realize you've solved your problem, but I thought I'd share a  
similar slow-startup problem that we ran across that I would have  
suggested had I looked at the thread earlier. Adding here so that it  
makes it into the archives.

One of our apps allowed users to upload files. These files were  
stored in a directory that was deep within the WEB-INF directory of  
the webapp. As the number of files grew very large (100's of  
thousands), we found that the webapp was taking longer and longer to  
startup. Later we found that at startup time, resin was doing a  
search through all WEB-INF subdirectories for any taglib files. I  
don't know if this was a misconfiguration on our part or just normal  
behavior. Our simple solution was to put the directory of uploaded  
files elsewhere and keep the number of files inside WEB-INF to a  
reasonable number.

This may not apply to all versions of resin (we made that change in  
the resin 2.x days) but it's just another potential slow startup  
scenario for future reference.


Bernie


On Oct 8, 2007, at 6:39 AM, Mattias Jiderhamn wrote:

 I believe I have found the offender in this issue: ZoneAlarm.
 I had already tried to turn it off, but since I have seen some strange
 behaviour with ZoneAlarm before I now tried uninstalling it  
 altogether.
 That seem to have solved the issue.

 I'm sorry for wasting your time, especially now that I remember I
 probably upgraded ZoneAlarm (free version to 7.0.408) around the time
 the problems started. *blush*
 Thanks for all the tips and suggestions - the supportive community is
 part of what makes Resin great.
 Hopefully the archive copy of this thread can be of help to  
 somebody else.

  /Mattias


 I wrote:
 By the way, the CPU usage is peaking all the way through. Around  
 49% on
 my dual core system.
 (And there is even more memory on the computer with the problem  
 than the
 other one)


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Mattias  
 Jiderhamn
 Sent: Friday 05 October 2007 11:20
 To: Resin
 Subject: [Resin-interest] Slooow file reads (really weird!)


 Hi list.
 I have my J2EE webapp on an external hard drive, which I carry  
 between
 my office and my home computer.
 On each computer - running Windows XP and Java 1.5 - I have a Resin
 (3.0.22) installation and a shortcut to start Resin with the  
 server root
 on the external drive.
 This has worked flawlessly for over a year.

 Now suddenly (ok, after returning from vacation), the application is
 immensely slow - on one of the computers!
 Starting Resin and the application now takes anywhere from 3 to 5
 minutes on my home computer, compared to the usual 30 or so seconds.
 Loading a simple page can take 40 seconds. It seems that most of the
 time is spent inside the disk access of the dependency checking.
 (Turning dependency checking off was much faster, but still  
 slower than
 normal).
 I tried to copy the project to the internal drive to see if there  
 was
 some interface hardware issue - no difference.
 I profiled the application with JProfiler, and it thinks there is a
 hotspot in com.caucho.vsf.JniStream.read(). Why...?

 I am running out of ideas on what could be wrong and how to track  
 it down.

 Any tips would be much welcome!

   /Mattias



 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest




___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


[Resin-interest] jsp include automatically generate comment?

2007-04-04 Thread Bernard Bernstein
One of our UI coders have asked me if we could do this and I didn't  
have an answer.

We use many little jsp files with small chunks of our pages that we  
piece together with [EMAIL PROTECTED] ...% directives. There are times when  
a designer would like to see exactly which files were used to  
generate a page from the browser as an xml comment.

So, if I have some files included in one top-level file like this:

%@ include file=/client1/page-top.jsp %
%@ include file=/standard/page-body.jsp %
%@ include file=/client1/page-bottom.jsp %

We'd like to have something like this show up in the page source:

!-- /client1/page-top.jsp --
This is the stuff at the top of the page

!-- /standard/page-body.jsp --
This is the body of the page

!-- /client1/page-bottom.jsp --
This is the bottom


I know the simplest way to do this would be to insert the current  
file name as a comment at the top of every .jsp file, but we'd also  
like to be able to change a property somewhere and have those  
comments disappear when we run this on a production server. Also, we  
have hundreds of these snippet files and nobody wants to touch them  
all nor have each one do something at runtime to figure out whether  
or not to output something.

Any suggestions?


Bernie




___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


[Resin-interest] regexp with literal question-mark

2007-01-03 Thread Bernard Bernstein
I have this rewrite rule:

rewrite-dispatch
   forward
 regexp=/here/.*/([0-9]+)\??(.*)
 target=/there.jsp?id=$1amp;$2
   /
/rewrite-dispatch

Which is supposed to do this:

when resin sees this:
/here/12345?x=1

it should forward to this:
/there.jsp?id=12345x=1

but actually it is forwarding to this:

/there.jsp?id=12345


It seems that the \? isn't recognizing a literal question-mark, or  
what seems more likely, the query-string is parsed out and not  
available from that variable. I would be satisfied any way I can  
insert the query-string, so if there is some other way of entering  
that in the target, I'd use that.

I tried:


target=/there.jsp?id=$1amp;${query-string]

but that didn't help.

Any ideas?


Bernie


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest