Hi Brian,

Yes, you're right that by default the templates are retrieved from the jar. It's a normal performance improvement to extract them from the java to improve performance and this may be why others haven't noticed the problem.

Do you have time to copy them out and observe the difference?

See Section 1 of this document on info about extracting the templates:
http://cwiki.apache.org/confluence/display/S2WIKI/Creating+a+custom+Dojo+profile+for+Struts+2.0.x

And here: http://struts.apache.org/2.0.11/docs/performance-tuning.html

Bryan Taylor wrote:
I'm thinking more about this. It's very interesting that the open file is the 
struts2-core jar.
This is obviously opened by a class loader to get class definitions and 
resource files.

Several questions come to mind:
 - What files are being retrieving?
 - What classloader is doing this? Is it the normal Tomcat webapp classloader?
 - What would cause a classloader to fail to release a file handle?

Perhaps we are retrieving the freemarker templates for something like form.ftl 
from the
jar?

----- Original Message ----
From: Dave Newton <[EMAIL PROTECTED]>
To: Struts Developers List <dev@struts.apache.org>
Sent: Friday, February 29, 2008 2:06:59 PM
Subject: Re: Severe production issue: struts2-core-2.0.9.jar has hundres of 
file handles

FWIW (not much), I can't duplicate this with S2.0.11 under Mac OS X; I may
have a report from both Windows and Linux boxen in a little bit.

Dave

--- Bryan Taylor <[EMAIL PROTECTED]> wrote:

We're troubleshooting a severe problem in our production system. We get
errors like this in tomcat:
SEVERE: Socket accept failed
    org.apache.tomcat.jni.Error: Too many open files

We're on linux and run lsof to show the files tomcat has open, which shows
hundreds (763 in one example) of distinct open files for
struts2-core-2.0.9.jar . The large number of these causes us to hit the
limit on the number of open files (1024 by default).
In a development setting, I run the following script to display open file
handles to this jar every second:
[root]# while true; do lsof -p $TOMCAT_PID | grep struts2-core-2.0.9.jar |
wc -l; sleep 1; done

When I go to our login page (a freemarker template served by a struts
action) if I hit refresh on the page as quickly as I can, I see the numbers
start at 2 or 3 and then go up in jumps of 20 at a time (eg 23, 43, 63,
83). After a while, say 30 seconds, the number will drop again, perhaps due
to garbage collection. It appears that under our production load, the
increases are beating the decreases until we hit the open file limit.
We have attempted to duplicate this with the struts showcase sample app.
One user by simply hitting refresh a lot can make the file handle count go
into the 30's.

Any ideas on what could be happening? Any help is greatly appreciate --
this is causing us big problems.






____________________________________________________________________________________
Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






      
____________________________________________________________________________________
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to