Re: Performance with many small requests

2009-05-12 Thread Leon Rosenberg
On Tue, May 12, 2009 at 6:27 AM, Caldarale, Charles R
chuck.caldar...@unisys.com wrote:
 From: David Kerber [mailto:dcker...@verizon.net]
 Subject: Re: Performance with many small requests

 Incrementing a counter can't be much of a synchronization bottleneck,
 and if I switch to an AtomicInteger, it should be even less of one.

 Actually, it won't.  There's a slight performance difference between the two 
 mechanisms, but it's usually in favor of the synchronized increment, not the 
 AtomicInteger, at least on my dual-core AMD 64 system running JDK 6u12 in 
 64-bit server mode on Vista.  The difference is only a few percent, so you 
 should just code it whichever way you find more maintainable.  (Test program 
 available on request; it would be interesting to see if the same relationship 
 exists on a modern Intel chip.)

Hello,

last time I checked (which is a while ago - 2006 and on 1.5) it was
not only processor, but also OS dependent and clearly in favor of
atomics (but it probably depends on the number of concurrent writers
too). If you would share your test code, I would love to test it on
some *nixes and darwins I have here; i'd also volunteer to gather and
publish results from everyone else :-)

regards
Leon

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Apache 2.2 Tomcat 6.0 on Debian

2009-05-12 Thread Alexander Diedler
Hello,

I got the SSL configuration not to work:

In my 000-default in /apache2/sites-enabled/:

 

NameVirtualHost *:80

Virtual Host *:80

ServerName www.test2.de

.

/VirtualHost

 

Virtual Host *:80

ServerName www.test3.de

.

/VirtualHost

 

NameVirtualHost *:443

VirtualHost *:443

ServerName www.test2.de

[Certfile test2.de]

/VirtualHost

 

VirtualHost *:443

ServerName www.test3.de

[Certfile test3.de]

/VirtualHost

 

 

Every Domain has it own IP address.If I use https://www.test2.de everything
ok but if I use https://www.test3.de id said that the certificate is
invalid, is only valid for test2.de and www.test2.de



smime.p7s
Description: S/MIME cryptographic signature


Re: Tomcat Language

2009-05-12 Thread A A
Caldarale, That was it!!
I had recently deployed a new aplication in this tomcat, opencms 7, and it had 
changed the date format and tomcat language.
So, As you said, I undeployed the application, reboot the tomcat service,and 
the date format change, and fix the problem!!!



Thanks for all

--- El vie, 8/5/09, André Warnier a...@ice-sa.com escribió:
De: André Warnier a...@ice-sa.com
Asunto: Re: Tomcat Language
Para: Tomcat Users List users@tomcat.apache.org
Fecha: viernes, 8 mayo, 2009 10:08

Caldarale, Charles R wrote:
 From: A A [mailto:masvalesolo...@yahoo.es]
 Subject: Re: Tomcat Language
 
 Checking java variables with and jsp in each tomcat, we see that
 java.text.DateFormat.getInstance() returns mm/dd/yy in the english
 manager and dd/mm/yy in the spanish manager.
 
 Any suggestion?
 
 Examine the system properties in each Tomcat instance; this can be done
with JConsole, but installing Lambda Probe makes it easier.  Compare the two
sets for differences, especially the user.country and user.language settings.
 
 This happened to one other user a few months ago, and was found to be
caused by a webapp setting those variables on the fly (as I recall).  Since
they're global, it affected everything in the JVM.
 
As I am this other user, I confirm (except that in my case the Tomcat Manager
started talking German one day, not Spanish).
As I recall, at some point we added a webapp, which was setting (for itself
basically) the user.country and user.language properties when it was loaded. 
Since you cannot really control the order in which Tomcat loads the various
webapps, it was a bit random as a result.
If you have a webapp that sets these properties, remove it temporarily, restart
Tomcat, and check if that changes the Manager language.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




  

Re: Apache 2.2 Tomcat 6.0 on Debian

2009-05-12 Thread Moritz Kobel
Hello,

as far as i know, you should provide the IP-address to the VirtualHosts:

VirtualHost 123.45.67.8:443
ServerName www.test2.de
   
/VirtualHost
VirtualHost 123.45.67.9:443
ServerName www.test3.de
...
/VirtualHost


- Moritz


Am Tuesday den 12. May 2009 schrieb Alexander Diedler:
 I got the SSL configuration not to work:
 In my 000-default in /apache2/sites-enabled/:
[..] 
 VirtualHost *:443
 ServerName www.test2.de
 [Certfile test2.de]
 /VirtualHost
 VirtualHost *:443
 ServerName www.test3.de
 [Certfile test3.de]
 /VirtualHost
 Every Domain has it own IP address.If I use https://www.test2.de everything
 ok but if I use https://www.test3.de id said that the certificate is
 invalid, is only valid for test2.de and www.test2.de



-- 
Wissen ist das einzige Gut, das sich vermehrt, wenn man es teilt.
--
http://www.lagerkochbuch.ch

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Performance with many small requests

2009-05-12 Thread Peter Crowther
 From: David Kerber [mailto:dcker...@verizon.net]
 I definitely should hook a profiler to the app so I can be sure of
 what's taking the time, though.

Yes.  If you don't measure it, you don't know whether you're fixing the right 
problem!

Also consider connector, then if necessary process and OS limits on the number 
of concurrent connections.  Do you usually have connector threads sat idle, or 
are they all reading and processing requests most/all of the time?  A thread 
dump will tell you - the last one you posted had at least one thread in the 
pool waiting for a connection, and you can simply spot which others look 
similar.  The other way to check would be to monitor the depth of your 
connector's socket's accept queue, but I'm not aware of any way to do this in 
Windows.

At this point, I'm guessing on any remaining bottlenecks.  I recall your 
network is gigabit from the router (I think I've recalled correctly), but also 
check:

- Is the firewall or router overloaded?  Highly unlikely if they're properly 
specced, but I have been in one data centre where the bottleneck turned out to 
be the routers.*

- What's your external connectivity like?  Gigabit from the router is 
irrelevant if you're trying to fit 20 Mbit/s of data down a 10 Mbit/s pipe :-).

- Peter

* Names elided to protect the innocent, but a manufacturer's claim that a 
particular spec of router could handle two ISDN primaries turned out to be 
correct in the USA (23 B-channels per PRI) and wrong in Europe (30 B-channels 
per PRI).

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat (re-)packaging, relocation etc..

2009-05-12 Thread André Warnier

Hi.

Picking up on a recent (mild) comment on this list :

quote

Note that relocating everything means that when posting your users post
questions to this mailing list we're likely to say who's the idiot that
scattered all the directories all over the place? try downloading a
fresh version of Tomcat and see if all your problems go away?.

unquote

I wonder if it is not time to make peace on this issue and maybe 
trying to find a reasonable middle ground.


An installation of the complete official Tomcat under 
/usr/local/tomcatx.y, including logfiles, webapps, etc.. is undoubtedly 
the simplest case for someone here trying to offer support to some 
bewildered user.
At the same time, it is not the configuration that most users have when 
they come here for help.


Also, application packagers for various systems have undoubtedly a 
number of reasons for doing what they do, and it is also undoubtable 
that the availability of software packaging and distribution mechanisms 
greatly facilitate the life of system administrators and a whole bunch 
of users.
And these packagers have to deal not just with Tomcat, but with hundreds 
of applications which vie for the same or alternative resources, and try 
to bring some modicum of order into this chaos.


And yes, some packagers for some platforms seem to have great fun in 
scattering Tomcat things all over the place, and creating a maze of 
symlinks where the most seasoned of Tomcat developer quickly loses his 
serenity.


My point is that packaging of applications, considering its many 
practical advantages, is here to stay.  That implies also putting 
logfiles for all applications in some generally common place, 
configuration files ditto, added user applications ditto, etc..


So why not try, at the Tomcat development level, to take some steps to 
make this easier, while providing a framework that helps in diagnosing 
issues and simplify the life of experts on this list and others.


For instance, the startup of Tomcat already uses the JAVA_HOME variable 
to locate the appropriate jvm, the CATALINA_HOME to find the code, 
CATALINA_BASE to find the instance-specific stuff etc..


So why not add some variables like CATALINA_LOGS, CATALINA_WEBAPPS 
etc.., whose value would by default be what they are now (such as 
$CATALINA_BASE/webapps) but which could also easily be redefined by 
the application packagers when needed ?
(And I mean without the need for these people to become real Tomcat 
experts and go digging in the server.xml, context.xml etc..).


And why not add a standard program/script/webapp to Tomcat, which prints 
out a few lines containing the platform type, Tomcat version, location, 
jvm version and location, webapps location, logfiles location, and so 
on, so that we could in this forum ask that posters first and for all 
execute this command or webapp and prefix their messages with the output ?
Only that, would already save a significant percentage of the bandwidth 
on this list.


I know that this is to some extent a naive request, and that there are 
some aspects that may be more difficult than others, but is it possible 
to approach this issue in a positive, rather than recriminative fashion ?




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Newbie question about war file deployment

2009-05-12 Thread tomas_bar

Hi,
I've generated a war file using GWT. I have placed it in the webapps folder
of the tomcat directory (which is installed locally).
How do I now start the application from a client browser?
I have tried http://localhost:8080/ApplicationName
but it doesnt work. I guess I'm missing something basic.
Thanks very much for any help.
-- 
View this message in context: 
http://www.nabble.com/Newbie-question-about-war-file-deployment-tp23500897p23500897.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Performance with many small requests

2009-05-12 Thread David kerber

Leon Rosenberg wrote:

On Tue, May 12, 2009 at 6:27 AM, Caldarale, Charles R
chuck.caldar...@unisys.com wrote:
  

From: David Kerber [mailto:dcker...@verizon.net]
Subject: Re: Performance with many small requests

Incrementing a counter can't be much of a synchronization bottleneck,
and if I switch to an AtomicInteger, it should be even less of one.
  

Actually, it won't.  There's a slight performance difference between the two mechanisms, 
but it's usually in favor of the synchronized increment, not the AtomicInteger, at 
least on my dual-core AMD 64 system running JDK 6u12 in 64-bit server mode on Vista.  
The difference is only a few percent, so you should just code it whichever way you 
find more maintainable.  (Test program available on request; it would be interesting to 
see if the same relationship exists on a modern Intel chip.)



Hello,

last time I checked (which is a while ago - 2006 and on 1.5) it was
not only processor, but also OS dependent and clearly in favor of
atomics (but it probably depends on the number of concurrent writers
too). If you would share your test code, I would love to test it on
some *nixes and darwins I have here; i'd also volunteer to gather and
publish results from everyone else :-)
  

I'll second that request!

Dave



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Performance with many small requests

2009-05-12 Thread David kerber

Peter Crowther wrote:

From: David Kerber [mailto:dcker...@verizon.net]
I definitely should hook a profiler to the app so I can be sure of
what's taking the time, though.



Yes.  If you don't measure it, you don't know whether you're fixing the right 
problem!
  
It was apparent early on that the synchronization was the most limiting 
bottleneck, and that has been mostly corrected thanks to you guys.  Now 
I'm looking at various possibilities for the secondary bottlenecks.


Also consider connector, then if necessary process and OS limits on the number of concurrent connections.  Do you usually have connector threads sat idle, or are they all reading and processing requests most/all of the time?  A thread dump will tell you - the last one you posted had at least one thread in the pool waiting for a 
Yes, I usually have several waiting on the socket, either at my 
InputStream.read() line, or in some tomcat code that Chuck said was 
waiting for http headers.  However, I still have more completely idle 
(sleeping) threads than I do busy or locked ones at any given time, so 
the servlet seems to be keeping up pretty well overall.  See below, 
though...



connection, and you can simply spot which others look similar.  The other way 
to check would be to monitor the depth of your connector's socket's accept 
queue, but I'm not aware of any way to do this in Windows.

At this point, I'm guessing on any remaining bottlenecks.  I recall your 
network is gigabit from the router (I think I've recalled correctly), but also 
check:

- Is the firewall or router overloaded?  Highly unlikely if they're properly 
specced, but I have been in one data centre where the bottleneck turned out to 
be the routers.*
  
In my original post, I posted a bunch of numbers about network and other 
possible bottlenecks, and what it boiled down to was that neither my 
firewall load, nor total internet connection bandwidth were close to 
their limits.  I do have questions about the number of connections that 
the OS networking stack can handle, but have not figured out how to 
check on that.  I also need to investigate some possible latency (as 
opposed to throughput) issues in my network, given the small request size.



- What's your external connectivity like?  Gigabit from the router is 
irrelevant if you're trying to fit 20 Mbit/s of data down a 10 Mbit/s pipe :-).
The outside world connection is a full T-1, running about 40% - 50% 
capacity on average.


D



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



problems with mod_proxy (apache 2.2.9) and tomcat ajp connector (6.0.18)

2009-05-12 Thread Michael Biebl
Hi,

first of all, I'd like to say hi, as I'm new to the list.

I hope you can help me with the following problem I have.
I run a stock Debian lenny installation with apache 2.2.9 and tomcat 6.0.18
I'm using mod_proxy to forward the request to tomcat using ajp. The
apache vhost configuration looks like this:

VirtualHost *:80

...
ProxyRequests Off
ProxyVia On
ProxyPass /t/ ajp://localhost:8009/barcooServer/t/
ProxyPass /ws/ ajp://localhost:8009/barcooServer/ws/
ProxyPass /reports/ ajp://localhost:8009/barcooServer/reports/
ProxyPass / ajp://localhost:8009/barcooWebsite/
ProxyPassReverse / ajp://localhost:8009/barcooWebsite/
ProxyPassReverseCookiePath /barcooWebsite /
...

/VirtualHost

The apache mpm prefork modules is used with the following configuration.
IfModule mpm_prefork_module
StartServers  5
MinSpareServers   5
MaxSpareServers  10
MaxClients  200
MaxRequestsPerChild   0
/IfModule

The tomcat ajp connector configuration is as simple as
Connector port=8009 protocol=AJP/1.3 redirectPort=8443 /


Now, when I get a lot of users access, the http connection via apache
slows down to a crawl
and I get a lot of the following messages in the kernel log:

[2350915.113736] __ratelimit: 11 messages suppressed
[2350915.113742] TCPv6: Possible SYN flooding on port 8009. Dropping request.

apache and tomcat itself seem to be idling along, and the load is not
that high on the machine.

Has anyone an idea what's going on there?

Thanks in advance for your help,
Michael

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Performance with many small requests

2009-05-12 Thread Peter Crowther
 From: David kerber [mailto:dcker...@verizon.net]
 In my original post, I posted a bunch of numbers about
 network and other
 possible bottlenecks, and what it boiled down to was that neither my
 firewall load, nor total internet connection bandwidth were close to
 their limits.

Thanks.  Apologies for not referring back!

 I do have questions about the number of connections that
 the OS networking stack can handle, but have not figured out how to
 check on that.

As a first step:
netstat -an  somefile.txt
How many TCP sockets are there in the result?

 The outside world connection is a full T-1, running about 40% - 50%
 capacity on average.

Dedicated or contended bandwidth?  Can you get the other 50-60% out of it if 
you try hard from another machine on the same network, or do you never get it 
in reality?

- Peter

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Virtual host configuration problems

2009-05-12 Thread JDawg72

I have to admit that I am new to application server administration, and being
a programmer, I have a new found respect for the administrators I work with.

That being said, I am having a problem configuring my web application to
load when I type  www.mydomain.com in my browser address bar.  My
application does work as long as I type www.mydomain.com/myapp for the url.  
I have tried changing my server.xml host context and WEB-INF/context.xml
with no luck.  The closest I get to this working is the application starts
to load but as soon as it gets to a point in the servlet where it is
referencing my formBean it stops loading the page.  When I look at the log I
notice that the first error fails to get the database resource need to build
the form.  Then of course I get jsp exceptions because the formBean failed
to initialize.  Below is the first line in of the first exception that is
thrown as well as my server.xml and META-INF/context.xml entries.  

I have been through several forum threads that are similar to this issue,
but I have had no luck translating the suggestions successfully, and have
yet to find out why it works as long as I qualify the context path in the
url.  Any help would be greatly appreciated.

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of
class '' for connect URL 'null'

server.xml
Server
port=
  Listener
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener/
  Listener
className=org.apache.catalina.storeconfig.StoreConfigLifecycleListener/
  Listener className=org.apache.catalina.mbeans.ServerLifecycleListener/
  GlobalNamingResources
Resource
  auth=Container
  description=User database
  name=UserDatabase
  type=org.apache.catalina.UserDatabase
  pathname=conf/tomcat-users.xml
  factory=org.apache.catalina.users.MemoryUserDatabaseFactory/
  /GlobalNamingResources
  Service
  name=Catalina
Connector
port=
minSpareThreads=1
address=127.0.0.1
maxThreads=50
maxSpareThreads=3
connectionTimeout=3
protocol=AJP/1.3
/Connector
Engine
defaultHost=mydomain.com
name=Catalina
  Realm className=org.apache.catalina.realm.UserDatabaseRealm/
  Host
  appBase=/home/userId/public_html
  name=mydomain.com
Aliaswww.mydomain.com/Alias
Context
   
docBase=/usr/local/tomcat/apache-tomcat-5.5.26/server/webapps/admin
path=/admin
privileged=true
reloadable=true
/Context
Context
   
docBase=/usr/local/tomcat/apache-tomcat-5.5.26/server/webapps/manager
path=/manager
privileged=true
reloadable=true
  ResourceEnvRef
name=users
type=org.apache.catalina.UserDatabase/
/Context
Context
docBase=/home/userId/public_html/myapp
path=
reloadable=true
/Context
  /Host
/Engine
  /Service
/Server
META-INF/context.xml

?xml version=1.0 encoding=UTF-8?
Context path=/myapp docBase=myapp reloadable=true
crossContext=true
   Resource name=jdbc/mycon auth=Container type=javax.sql.DataSource
 maxActive=40 maxIdle=5 maxWait=5000
 username=user password=password
driverClassName=com.mysql.jdbc.Driver
 removeAbandoned=true removeAbandonedTimeout=3
logAbandoned=true

url=jdbc:mysql://www.mydomain.com:3306/database?autoReconnect=true /
/Context  
-- 
View this message in context: 
http://www.nabble.com/Virtual-host-configuration-problems-tp23501325p23501325.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Performance with many small requests

2009-05-12 Thread David kerber

Peter Crowther wrote:

From: David kerber [mailto:dcker...@verizon.net]
In my original post, I posted a bunch of numbers about
network and other
possible bottlenecks, and what it boiled down to was that neither my
firewall load, nor total internet connection bandwidth were close to
their limits.



Thanks.  Apologies for not referring back!
  

No problem; that was many posts ago...
  

I do have questions about the number of connections that
the OS networking stack can handle, but have not figured out how to
check on that.



As a first step:
netstat -an  somefile.txt
How many TCP sockets are there in the result?
  
Just over 1000 total, 810 to the port that this application is using.  
The vast majority are showing a status of TIME_WAIT, a dozen or so in 
ESTABLISHED and one (I think) in FIN_WAIT_1.



The outside world connection is a full T-1, running about 40% - 50%
capacity on average.



Dedicated or contended bandwidth?  Can you get the other 50-60% out of it if 
you try hard from another machine on the same network, or do you never get it 
in reality?
  
That's our corporate connection, so it's shared across all users.  I can 
easily run it up to 100%  it by doing a large d/l from somewhere (I need 
to plan my patch Tuesday updates to avoid trouble), so my router and 
firewall have no trouble handling the full bandwidth.  However, those 
are low numbers of high-throughput connections.  This app produces large 
numbers of connections, each with small amounts of data, so it may scale 
differently.


D



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Confused by mpm/mod_jk

2009-05-12 Thread Rainer Jung
On 12.05.2009 02:09, Bill Davidson wrote:
The 150 threads do not make a good fit to your MaxClients of 256. If
your Apache is mainly forwarding requests to Tomcat, then it doesn't
make much sense to allow 256 parallel connections to Apace, but only 150
on the backend. That will result in some Apache processes being fully
connected (32 connections) and some other not able to grow their
connection pool to the full size, because they get errors when trying to
connect.
 
 Interesting.  httpd is mainly connecting to servlets but those also request
 images, javascript, style sheets and applets that get served directly by
 httpd.

Keep in mind, that

   concurrency = throughput * responsetime

So assume 80% of your requests are for static content handled directly
by Apache, but those objects might be small and take only 10
milliseconds to handle in the web server (yes, that's not to unlikely),
and the 20% requests for dynamic content might take on average 1000
milliseconds, then only 100 * (0.8*10) / (0.8*10 + 0.2*1000) = 4 percent
of the observed concurrency will be for static content requests, and 96%
for dynamic ones. So you always also need to take the expected response
time and the load together to derive some result for concurrency.

Regards,

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: problems with mod_proxy (apache 2.2.9) and tomcat ajp connector (6.0.18)

2009-05-12 Thread André Warnier

Michael Biebl wrote:

Hi,

first of all, I'd like to say hi, as I'm new to the list.

I hope you can help me with the following problem I have.
I run a stock Debian lenny installation with apache 2.2.9 and tomcat 6.0.18
I'm using mod_proxy to forward the request to tomcat using ajp. The
apache vhost configuration looks like this:

VirtualHost *:80

...
ProxyRequests Off
ProxyVia On
ProxyPass /t/ ajp://localhost:8009/barcooServer/t/
ProxyPass /ws/ ajp://localhost:8009/barcooServer/ws/
ProxyPass /reports/ ajp://localhost:8009/barcooServer/reports/
ProxyPass / ajp://localhost:8009/barcooWebsite/
ProxyPassReverse / ajp://localhost:8009/barcooWebsite/
ProxyPassReverseCookiePath /barcooWebsite /
...

/VirtualHost

The apache mpm prefork modules is used with the following configuration.
IfModule mpm_prefork_module
StartServers  5
MinSpareServers   5
MaxSpareServers  10
MaxClients  200
MaxRequestsPerChild   0
/IfModule

The tomcat ajp connector configuration is as simple as
Connector port=8009 protocol=AJP/1.3 redirectPort=8443 /


Now, when I get a lot of users access, the http connection via apache
slows down to a crawl
and I get a lot of the following messages in the kernel log:

[2350915.113736] __ratelimit: 11 messages suppressed
[2350915.113742] TCPv6: Possible SYN flooding on port 8009. Dropping request.

apache and tomcat itself seem to be idling along, and the load is not
that high on the machine.

Has anyone an idea what's going on there?


It seems to be something entorely outside of Apache and Tomcat.
I'm no specialist, but a few names come to mind : iptables, denyhosts, 
SELinux ?



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Performance with many small requests

2009-05-12 Thread Peter Crowther
 From: David kerber [mailto:dcker...@verizon.net]
 Just over 1000 total, 810 to the port that this application is using.

Should be fine on Windows.

 The vast majority are showing a status of TIME_WAIT, a dozen or so in
 ESTABLISHED and one (I think) in FIN_WAIT_1.

Sounds fair enough.  The ESTABLISHED ones are active both ways and able to 
transfer data; the one in FIN_WAIT_1 has been closed at one end but the other 
end's still open; and the ones in TIME_WAIT are closed but tombstoned so the 
TCP stack knows to throw away any data that arrives for them.  None of those 
are a surprise.

 That's our corporate connection, so it's shared across all
 users.  I can
 easily run it up to 100%  it by doing a large d/l from
 somewhere (I need
 to plan my patch Tuesday updates to avoid trouble), so my router and
 firewall have no trouble handling the full bandwidth.

Ah, OK.

 However, those
 are low numbers of high-throughput connections.  This app
 produces large
 numbers of connections, each with small amounts of data, so
 it may scale differently.

It may, but I'd be a little surprised - IP is IP, and you have enough 
concurrency that latency shouldn't be a problem.

That said, if a client has multiple data items to send in rapid succession, 
does it accumulate those and batch them, or does it send each one as a 
different request?  Or does the situation never arise?

- Peter

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Analyzing Tomcat related VM crash?

2009-05-12 Thread Rainer Jung
On 12.05.2009 01:13, Andre-John Mas wrote:
 I have added the details to the end of this e-mail.

 #  SIGSEGV (0xb) at pc=0x06546578, pid=7456, tid=2349013936

 Current thread (0x08060800):  GCTaskThread [stack:
 0x8bfb1000,0x8c032000] [id=7459]

 Other Threads:
   0x8bd97800 VMThread [stack: 0x8baba000,0x8bb3b000] [id=7462]
   0x8bdb3800 WatcherThread [stack: 0x8b5f3000,0x8b674000] [id=7469]
 
 =0x08060800 (exited) GCTaskThread [stack: 0x8bfb1000,0x8c032000] [id=7459]

 Heap
  PSYoungGen  total 186112K, used 176507K [0xa7ad, 0xb42d,
 0xb42d)
   eden space 167424K, 100% used [0xa7ad,0xb1e5,0xb1e5)
   from space 18688K, 48% used [0xb1e5,0xb272ec48,0xb309)
   to   space 18496K, 39% used [0xb30c,0xb37d07d8,0xb42d)
  PSOldGentotal 319488K, used 266765K [0x942d, 0xa7ad,
 0xa7ad)
   object space 319488K, 83% used [0x942d,0xa47535f8,0xa7ad)
  PSPermGen   total 131072K, used 35161K [0x8c2d, 0x942d,
 0x942d)
   object space 131072K, 26% used [0x8c2d,0x8e5265e8,0x942d)

The crash happened in the GCTaskThread, so inside the code which is
responsible for doing Garbage Collection. As noted by others, the
exception you saw in the logo file is extremely unlikely to cause a JVM
crash.

Look at the release notes for 1.6.0_13 whether there's a fix for C
crashes included and try Chucks suggestion about using the client VM.

What's a bit strange in the above output concerning your memory use, is
that from and to are both non-empty. Usually after a GC, one of the
two is always empty. So it seems the crash happened while the JVM was
doing a garbage collection (the full young generation is another
indicator for that). You old generation is also reletively full, but we
can't judge from the numbers whether that would hevae been simply
cleaned up by a GC of tenured or not.

Look for a GC fix (1.6.0_13), or try the child vm, or try switching to
another GC algorithm, like CMS.

Regards,

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Form-based Container Security with SSL

2009-05-12 Thread Martin Gainty

if your goal is encryption..
i found this explanation from Stanford helpful in understanding kerberos/ssh/ssl

http://pangea.stanford.edu/computerinfo/resources/network/security/safeguards/kerberos.html

HTH
Martin 
__ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de 
déni et de confidentialité
This message is confidential. If you should not be the intended receiver, then 
we ask politely to report. Each unauthorized forwarding or manufacturing of a 
copy is inadmissible. This message serves only for the exchange of information 
and has no legal binding effect. Due to the easy manipulation of emails we 
cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




 Date: Mon, 11 May 2009 18:37:22 -0400
 From: ch...@christopherschultz.net
 To: users@tomcat.apache.org
 Subject: Re: Form-based Container Security with SSL
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Guojun,
 
 On 5/11/2009 5:49 PM, Guojun Zhu wrote:
  Dear Chris,
  
  Thank you very much.  What we really want is that the login
  username/password communicates encrypted.   Everything else can be in
  clear-text.  (We also need the log-out, so I cannot use the digest
  authentification.)
  
  
  Showing a non-secure login page isn't a problem, is it? You just need to
  make sure that the login form's action is HTTPS and you will get a
  secure login.
 
  But if this login page is reached by http, will the login
  username/password be sent out in clear-texted?
 
 The scheme used to access the login page is not relevant to the safety
 of your credentials. Only the scheme used to /submit/ those credentials
 from your login form is relevant.
 
  Or should I specified the action j_security_check as https?
 
 Definitely.
 
  Then after the authentication,
  change back to http.
 
 Correct.
 
  (By changing the secured cookie into unsecured?
  Where?  In every pages as tomcat has redirect the link away from
  login?)
 
 No, all my suggestions have been to create a non-secure session id
 cookie /before/ authentication occurs. Then you don't have to worry
 about it, later.
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iEYEARECAAYFAkoIqKIACgkQ9CaO5/Lv0PAifgCdGOhDbM2bEmMyoZUGCKrwSQx5
 Sg0AoJCaYuusBHIS98n8vKRUtalnjQkD
 =OlR2
 -END PGP SIGNATURE-
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

_
Windows Live™: Keep your life in sync.
http://windowslive.com/explore?ocid=TXT_TAGLM_BR_life_in_synch_052009

RE: Analyzing Tomcat related VM crash?

2009-05-12 Thread Peter Crowther
 From: Rainer Jung [mailto:rainer.j...@kippdata.de]
 Look for a GC fix (1.6.0_13), or try the child vm, or try switching to
 another GC algorithm, like CMS.

(Coming to the thread late, sorry if this has all already been said).

Also consider bad RAM, or memory corruption caused by some native code, if you 
have any native code in your app - JNI, ODBC drivers, other database drivers 
that are not pure Java, etc.  From my days dealing with  Smalltalk GC, I found 
the commonest cause of a crash during GC was a bad object header somewhere in 
the heap - usually because something's overwritten it or a bit's flipped due to 
bad RAM.

- Peter

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: IIS tomcat connector plugin fail to reverse proxy.

2009-05-12 Thread Rainer Jung
On 12.05.2009 01:40, eric tse wrote:
 I am trying to use the IIS tomcat connector to act like a reverse proxy
 
 If I hit the IIS at /MWGAT
 
 it will forward the tomcat with /GAT
 
 
 However I fail to do this
 
 In the documentation
 http://tomcat.apache.org/connectors-doc/generic_howto/proxy.html
 
 they say I can do this
 
 If you are using Microsoft IIS as a web server, the ISAPI plugin
 provides a way of doing the first step with a builtin feature. You
 define a mapping file for simple prefix changes like this:
 
 # Add a context prefix to all requests ...
 /=/myapp/
 # ... or change some prefix ...
 /oldapp/=/myapp/
 
 
 But I don;t think it is possible.(have tried)
 
 I would need some help.
 
 I am using isapi_redirect.1.2.14.dll

The feature has been added in version 1.2.16 and improved later. So try
again with 1.2.28.

Regards,

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: problems with mod_proxy (apache 2.2.9) and tomcat ajp connector (6.0.18)

2009-05-12 Thread Michael Biebl
2009/5/12 André Warnier a...@ice-sa.com:
 Michael Biebl wrote:

 Hi,

 first of all, I'd like to say hi, as I'm new to the list.

 I hope you can help me with the following problem I have.
 I run a stock Debian lenny installation with apache 2.2.9 and tomcat
 6.0.18
 I'm using mod_proxy to forward the request to tomcat using ajp. The
 apache vhost configuration looks like this:

 VirtualHost *:80

 ...
        ProxyRequests Off
        ProxyVia On
        ProxyPass /t/ ajp://localhost:8009/barcooServer/t/
        ProxyPass /ws/ ajp://localhost:8009/barcooServer/ws/
        ProxyPass /reports/ ajp://localhost:8009/barcooServer/reports/
        ProxyPass / ajp://localhost:8009/barcooWebsite/
        ProxyPassReverse / ajp://localhost:8009/barcooWebsite/
        ProxyPassReverseCookiePath /barcooWebsite /
 ...

 /VirtualHost

 The apache mpm prefork modules is used with the following configuration.
 IfModule mpm_prefork_module
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          200
    MaxRequestsPerChild   0
 /IfModule

 The tomcat ajp connector configuration is as simple as
 Connector port=8009 protocol=AJP/1.3 redirectPort=8443 /


 Now, when I get a lot of users access, the http connection via apache
 slows down to a crawl
 and I get a lot of the following messages in the kernel log:

 [2350915.113736] __ratelimit: 11 messages suppressed
 [2350915.113742] TCPv6: Possible SYN flooding on port 8009. Dropping
 request.

 apache and tomcat itself seem to be idling along, and the load is not
 that high on the machine.

 Has anyone an idea what's going on there?

 It seems to be something entorely outside of Apache and Tomcat.
 I'm no specialist, but a few names come to mind : iptables, denyhosts,
 SELinux ?

No selinux enabled, no iptables rules loaded, no denyhosts installed.

My guess somehow is, that apache is opening too many ajp connections
to tomcat...

Michael

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Performance with many small requests

2009-05-12 Thread Caldarale, Charles R
 From: Peter Crowther [mailto:peter.crowt...@melandra.com]
 Subject: RE: Performance with many small requests
 
 That said, if a client has multiple data items to send in rapid
 succession, does it accumulate those and batch them, or does it send
 each one as a different request?  Or does the situation never arise?

Continuing with that thought, are the requests from a single client frequent 
enough to warrant using keepalives?  Building and tearing down the TCP session 
on each request might be adding noticeable delay, although your analysis of the 
heap dumps hasn't shown that yet.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Performance with many small requests

2009-05-12 Thread David kerber

Peter Crowther wrote:

From: David kerber [mailto:dcker...@verizon.net]
Just over 1000 total, 810 to the port that this application is using.



Should be fine on Windows.
  

That was my gut feeling too, but I'm glad to have it confirmed.

  

The vast majority are showing a status of TIME_WAIT, a dozen or so in
ESTABLISHED and one (I think) in FIN_WAIT_1.



Sounds fair enough.  The ESTABLISHED ones are active both ways and able to 
transfer data; the one in FIN_WAIT_1 has been closed at one end but the other 
end's still open; and the ones in TIME_WAIT are closed but tombstoned so the 
TCP stack knows to throw away any data that arrives for them.  None of those 
are a surprise.

  

That's our corporate connection, so it's shared across all
users.  I can
easily run it up to 100%  it by doing a large d/l from
somewhere (I need
to plan my patch Tuesday updates to avoid trouble), so my router and
firewall have no trouble handling the full bandwidth.



Ah, OK.

  

However, those
are low numbers of high-throughput connections.  This app
produces large
numbers of connections, each with small amounts of data, so
it may scale differently.



It may, but I'd be a little surprised - IP is IP, and you have enough 
concurrency that latency shouldn't be a problem.
  
I was wondering about that.  I knew total data throughput wasn't a major 
issue here, but wasn't sure how latency would affect it.



That said, if a client has multiple data items to send in rapid succession, 
does it accumulate those and batch them, or does it send each one as a 
different request?  Or does the situation never arise?
  
A typical client will have 2 to 5 items to send per transaction (they're 
actually lines from a data logger's data file), and each line is done in 
a separate POST request.  The frequency of transactions varies widely, 
but typically won't exceed one every 10 or 15 seconds from any given 
site.  As I mentioned earlier, each data line is small, 20 to 50 bytes. 

We had looked at batching up the transmissions before, and it's still an 
option.  However that adds a bit of complexity to the software on both 
ends, though the gain would be far fewer individual requests to 
process.  For now, we prefer the simplicity of line-by-line 
transmission, but if we start running into network limitations we'll 
probably start batching them up.


D



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Performance with many small requests

2009-05-12 Thread David kerber

Caldarale, Charles R wrote:

From: Peter Crowther [mailto:peter.crowt...@melandra.com]
Subject: RE: Performance with many small requests

That said, if a client has multiple data items to send in rapid
succession, does it accumulate those and batch them, or does it send
each one as a different request?  Or does the situation never arise?



Continuing with that thought, are the requests from a single client frequent 
enough to warrant using keepalives?  Building and tearing down the TCP session 
on each request might be adding noticeable delay, although your analysis of the 
heap dumps hasn't shown that yet.
  
See the message I just sent.  How difficult are keepalives to 
implement?  Our app design is such that we are never supposed to go 
longer than 5 minutes without at least a status update transmission.


Dave




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



[OT] RE: Performance with many small requests

2009-05-12 Thread Peter Crowther
 From: David kerber [mailto:dcker...@verizon.net]
 A typical client will have 2 to 5 items to send per
 transaction (they're
 actually lines from a data logger's data file), and each line
 is done in
 a separate POST request.  The frequency of transactions varies widely,
 but typically won't exceed one every 10 or 15 seconds from any given
 site.  As I mentioned earlier, each data line is small, 20 to
 50 bytes.

OK, so your top end is about 1 line every 2 seconds.  You'll need at least 2 
round-trip times (RTT) per line (SYN out, SYN-ACK back, ACK-DATA out, ACK-DATA 
back, plus the FIN-ACK out), but that's not a high rate.

 We had looked at batching up the transmissions before, and
 it's still an
 option.  However that adds a bit of complexity to the software on both
 ends, though the gain would be far fewer individual requests to
 process.  For now, we prefer the simplicity of line-by-line
 transmission, but if we start running into network limitations we'll
 probably start batching them up.

I'm interested - and this is now a long way from Tomcat, hence the [OT] mark 
above.  If a set of lines represents one transaction, why would you ever not 
send it and try to process it atomically?  Or is it acceptable to have 
part-transactions within your system?

- Peter

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Performance with many small requests

2009-05-12 Thread Caldarale, Charles R
 From: Leon Rosenberg [mailto:rosenberg.l...@googlemail.com]
 Subject: Re: Performance with many small requests
 
 If you would share your test code, I would love to test it on
 some *nixes and darwins I have here;

Here's the code I used to do the synch vs atomic testing.  The command line 
parameter is the number of loops to perform; you'll want to set it to at least 
10, and even then run repeated tests - the timings can vary 
considerably, at least under Vista.

(Also being sent directly to the two requesters, in case the list strips the 
attachment.)

Might be interesting to modify it to run with more cores, if you have a system 
available.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Re: Tomcat (re-)packaging, relocation etc..

2009-05-12 Thread David Smith
I think the real problem is in third party repackages that have a
tendency to treat .jar files like any native binary library.  The jar is
placed somewhere and then three or four different symlinks get chained
together to make it show up in all the places it's needed.  I know why
they do it -- they want to be able to build the library jars themselves
and then backport patches made to later releases to maintain
compatibility with all the dependent packages.   Unfortunately it
doesn't work and causes more headaches than it's worth.

I've personally done deploys somewhat similar to the way Apache Httpd
get's deployed -- make /etc/tomcat (or whatever you want to name it) the
root of the service, and then symlink webapps, work, temp, logs, lib,
and bin directories to different more appropriate places.  conf and all
it's subdirectories stay put under /etc/tomcat.  This lightweight
symlink works well for me.  The heavier weight stuff of symlinking the
jars themselves is usually where I've seen stuff break.

--David

André Warnier wrote:
 Hi.

 Picking up on a recent (mild) comment on this list :

 quote

 Note that relocating everything means that when posting your users post
 questions to this mailing list we're likely to say who's the idiot that
 scattered all the directories all over the place? try downloading a
 fresh version of Tomcat and see if all your problems go away?.

 unquote

 I wonder if it is not time to make peace on this issue and maybe
 trying to find a reasonable middle ground.

 An installation of the complete official Tomcat under
 /usr/local/tomcatx.y, including logfiles, webapps, etc.. is
 undoubtedly the simplest case for someone here trying to offer support
 to some bewildered user.
 At the same time, it is not the configuration that most users have
 when they come here for help.

 Also, application packagers for various systems have undoubtedly a
 number of reasons for doing what they do, and it is also undoubtable
 that the availability of software packaging and distribution
 mechanisms greatly facilitate the life of system administrators and a
 whole bunch of users.
 And these packagers have to deal not just with Tomcat, but with
 hundreds of applications which vie for the same or alternative
 resources, and try to bring some modicum of order into this chaos.

 And yes, some packagers for some platforms seem to have great fun in
 scattering Tomcat things all over the place, and creating a maze of
 symlinks where the most seasoned of Tomcat developer quickly loses his
 serenity.

 My point is that packaging of applications, considering its many
 practical advantages, is here to stay.  That implies also putting
 logfiles for all applications in some generally common place,
 configuration files ditto, added user applications ditto, etc..

 So why not try, at the Tomcat development level, to take some steps to
 make this easier, while providing a framework that helps in diagnosing
 issues and simplify the life of experts on this list and others.

 For instance, the startup of Tomcat already uses the JAVA_HOME
 variable to locate the appropriate jvm, the CATALINA_HOME to find the
 code, CATALINA_BASE to find the instance-specific stuff etc..

 So why not add some variables like CATALINA_LOGS, CATALINA_WEBAPPS
 etc.., whose value would by default be what they are now (such as
 $CATALINA_BASE/webapps) but which could also easily be redefined by
 the application packagers when needed ?
 (And I mean without the need for these people to become real Tomcat
 experts and go digging in the server.xml, context.xml etc..).

 And why not add a standard program/script/webapp to Tomcat, which
 prints out a few lines containing the platform type, Tomcat version,
 location, jvm version and location, webapps location, logfiles
 location, and so on, so that we could in this forum ask that posters
 first and for all execute this command or webapp and prefix their
 messages with the output ?
 Only that, would already save a significant percentage of the
 bandwidth on this list.

 I know that this is to some extent a naive request, and that there are
 some aspects that may be more difficult than others, but is it
 possible to approach this issue in a positive, rather than
 recriminative fashion ?



 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: IIS tomcat connector plugin fail to reverse proxy.

2009-05-12 Thread eric tse
thanks
On Tue, May 12, 2009 at 9:10 AM, Rainer Jung rainer.j...@kippdata.de wrote:
 On 12.05.2009 01:40, eric tse wrote:
 I am trying to use the IIS tomcat connector to act like a reverse proxy

 If I hit the IIS at /MWGAT

 it will forward the tomcat with /GAT


 However I fail to do this

 In the documentation
 http://tomcat.apache.org/connectors-doc/generic_howto/proxy.html

 they say I can do this

 If you are using Microsoft IIS as a web server, the ISAPI plugin
 provides a way of doing the first step with a builtin feature. You
 define a mapping file for simple prefix changes like this:

 # Add a context prefix to all requests ...
 /=/myapp/
 # ... or change some prefix ...
 /oldapp/=/myapp/


 But I don;t think it is possible.(have tried)

 I would need some help.

 I am using isapi_redirect.1.2.14.dll

 The feature has been added in version 1.2.16 and improved later. So try
 again with 1.2.28.

 Regards,

 Rainer

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: problems with mod_proxy (apache 2.2.9) and tomcat ajp connector (6.0.18)

2009-05-12 Thread Rainer Jung
On 12.05.2009 15:20, Michael Biebl wrote:
 2009/5/12 André Warnier a...@ice-sa.com:
 Michael Biebl wrote:
 Hi,

 first of all, I'd like to say hi, as I'm new to the list.

 I hope you can help me with the following problem I have.
 I run a stock Debian lenny installation with apache 2.2.9 and tomcat
 6.0.18
 I'm using mod_proxy to forward the request to tomcat using ajp. The
 apache vhost configuration looks like this:

 VirtualHost *:80

 ...
ProxyRequests Off
ProxyVia On
ProxyPass /t/ ajp://localhost:8009/barcooServer/t/
ProxyPass /ws/ ajp://localhost:8009/barcooServer/ws/
ProxyPass /reports/ ajp://localhost:8009/barcooServer/reports/
ProxyPass / ajp://localhost:8009/barcooWebsite/
ProxyPassReverse / ajp://localhost:8009/barcooWebsite/
ProxyPassReverseCookiePath /barcooWebsite /
 ...

 /VirtualHost

 The apache mpm prefork modules is used with the following configuration.
 IfModule mpm_prefork_module
StartServers  5
MinSpareServers   5
MaxSpareServers  10
MaxClients  200
MaxRequestsPerChild   0
 /IfModule

 The tomcat ajp connector configuration is as simple as
 Connector port=8009 protocol=AJP/1.3 redirectPort=8443 /


 Now, when I get a lot of users access, the http connection via apache
 slows down to a crawl
 and I get a lot of the following messages in the kernel log:

 [2350915.113736] __ratelimit: 11 messages suppressed
 [2350915.113742] TCPv6: Possible SYN flooding on port 8009. Dropping
 request.

 apache and tomcat itself seem to be idling along, and the load is not
 that high on the machine.

 Has anyone an idea what's going on there?

 It seems to be something entorely outside of Apache and Tomcat.
 I'm no specialist, but a few names come to mind : iptables, denyhosts,
 SELinux ?
 
 No selinux enabled, no iptables rules loaded, no denyhosts installed.
 
 My guess somehow is, that apache is opening too many ajp connections
 to tomcat...
 
 Michael

Have a look at netstat -an.

Also check the httpd documentation page about mod_proxy, which contains
lots of additional parameters needed to tune the proxy connection pool
(timeouts, persistent connction pool etc.). Not that mod_proxy_ajp is
not as old as many other httpd components, so there is still active
development and there might be some need to switch to recent versions.

Regards,

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Virtual host configuration problems

2009-05-12 Thread Caldarale, Charles R
 From: JDawg72 [mailto:mr.j@hotmail.com]
 Subject: Virtual host configuration problems
 
 That being said, I am having a problem configuring my web application
 to load when I type  www.mydomain.com in my browser address bar.
 My application does work as long as I type www.mydomain.com/myapp 
 for the url.

If you're on a reasonably recent version of Tomcat, the default webapp must be 
named ROOT (case sensitive).

You didn't explicitly tell us the version of Tomcat you're using, although the 
config indicates it's probably 5.5.26; please confirm that, and let us know 
what JVM you're using and what OS.

 I have tried changing my server.xml host context and 
 WEB-INF/context.xml with no luck.

The context.xml file belongs in META-INF, not WEB-INF; let's hope the above was 
a typo, since you do refer to META-INF later.

 Context
 docBase=/usr/local/tomcat/apache-tomcat-5.5.26/server/webapps/admin
 path=/admin
 privileged=true
 reloadable=true
 /Context
 Context
 docBase=/usr/local/tomcat/apache-tomcat-5.5.26/server/webapps/manager
 path=/manager
 privileged=true
 reloadable=true
   ResourceEnvRef
 name=users
 type=org.apache.catalina.UserDatabase/
 /Context
 Context
 docBase=/home/userId/public_html/myapp
 path=
 reloadable=true
 /Context

Context elements should not be placed in server.xml; that's extremely poor 
practice left over from older versions of Tomcat.  What you have above is a 
real mess; remove the Context elements from server.xml and place them where 
they belong.  For the webapps stored outside of the appBase directory (admin 
and manager), this should be conf/Catalina/mydomain.com/[appName].xml.  Your 
default webapp should be located in /home/userId/public_html/ROOT - nowhere 
else, and its Context element should be in 
/home/userId/public_html/ROOT/META-INF/context.xml.

Also note that if you have a single Host, it's not necessary to give it your 
domain name or supply any aliases; using the default of localhost will be 
fine.

I would configure an HTTP Connector to allow testing of Tomcat without the 
complication of using httpd in front of it.  (In fact, if you're not using 
httpd for something useful - such as PHP - get rid of it; it's only making 
things more complicated and slowing you down.)

 META-INF/context.xml

Where is the above directory located?

 Context path=/myapp docBase=myapp reloadable=true

The path and docBase attributes are not allowed when the Context element is 
in a webapp's META-INF/context.xml file.

Fix all of the above and see what happens.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Newbie question about war file deployment

2009-05-12 Thread Caldarale, Charles R
 From: tomas_bar [mailto:barto...@gmail.com]
 Subject: Newbie question about war file deployment

 I've generated a war file using GWT. I have placed it in the webapps
 folder of the tomcat directory (which is installed locally).

Tomcat version?  JVM level?  OS?  What's the name of the .war file?

 How do I now start the application from a client browser?
 I have tried http://localhost:8080/ApplicationName
 but it doesnt work.

What does doesnt [sic] work mean?  What error messages are you really 
getting?  What's in the Tomcat logs?

 I guess I'm missing something basic.

Providing actual facts would be a good start.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



How to create a virtual host with war file without beeing created a ROOT dir?

2009-05-12 Thread raistlink

Hi,
I've been developing an application with this structure of directories  

mydir/html/
mydir/html/WEB-INF
mydir/html/WEB-INF/classes
mydir/html/WEB-INF/lib
mydir/html/WEB-INF/web.xml

At server.xml I've included this host:  
Host name=myhost.es appBase=/myhost/html unpackWARs=true
autoDeploy=true xmlValidation=false xmlNamespaceAware=false
Context path= reloadable=true docBase=/myhost/html/
/Host

And everything works fine.

The problem comes now that I want to put my application in another machine
and I want to do it with a war file.

What I've done es to take the directory mydir/html and create the html.war.
Then I changed the host by this one:
Host name=myhost.es appBase=/myhost unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
Context path= reloadable=true docBase=/myhost/html/
/Host

But now, when I start tomcat, it creates the directories mydir/html and
mydir/ROOT. The application seems to work indeed but, how can I avoid the
system create de ROOT directory? Probably I'm not doing this in the correct
way.

I want to access my application at the URL myhost.es and not at
myhost.es/html.

Thanks
-- 
View this message in context: 
http://www.nabble.com/How-to-create-a-virtual-host-with-war-file-without-beeing-created-a-ROOT-dir--tp23504283p23504283.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Virtual host configuration problems

2009-05-12 Thread JDawg72

Thanks for you reply Chuck,

I am using DailyRazor as my web hosting provider.  The operating system is
Linux kernel version 2.6.27.18-14, Tomcat version 5.5.26, and JVM is
1.5.0_15-b04.  This is a private JVM configuration provided by DailyRazor. 
I purchased this server configuration because I am planning on hosting more
then one application and domain with this instance of Tomcat.  I have read
in the Tomcat documentation and discovered the sections you mention about
context elements being located in the server.xml file, however this is the
configuration file I started with from my hosting provider.  With this
hosting provider they tell me that I do not have access to webapp directory
so I am assuming I need the two context descriptors for the admin and
manager Tomcat applications.  I will go ahead and remove all of the context
entries and put them in conf/Catalina/mydomain.com/

My context.xml file is in META-INF and not WEB-INF.  Sorry about the typo. 
I will make the you mentioned in my app contect.xml file.

Your default webapp should be located in /home/userId/public_html/ROOT -
nowhere else, and its Context element should be in
/home/userId/public_html/ROOT/META-INF/context.xml. 
Also I am not clear on the suggestion of using “ROOT”.

Jeremy

Caldarale, Charles R wrote:
 
 From: JDawg72 [mailto:mr.j@hotmail.com]
 Subject: Virtual host configuration problems
 
 That being said, I am having a problem configuring my web application
 to load when I type  www.mydomain.com in my browser address bar.
 My application does work as long as I type www.mydomain.com/myapp 
 for the url.
 
 If you're on a reasonably recent version of Tomcat, the default webapp
 must be named ROOT (case sensitive).
 
 You didn't explicitly tell us the version of Tomcat you're using, although
 the config indicates it's probably 5.5.26; please confirm that, and let us
 know what JVM you're using and what OS.
 
 I have tried changing my server.xml host context and 
 WEB-INF/context.xml with no luck.
 
 The context.xml file belongs in META-INF, not WEB-INF; let's hope the
 above was a typo, since you do refer to META-INF later.
 
 Context
 docBase=/usr/local/tomcat/apache-tomcat-5.5.26/server/webapps/admin
 path=/admin
 privileged=true
 reloadable=true
 /Context
 Context
 docBase=/usr/local/tomcat/apache-tomcat-5.5.26/server/webapps/manager
 path=/manager
 privileged=true
 reloadable=true
   ResourceEnvRef
 name=users
 type=org.apache.catalina.UserDatabase/
 /Context
 Context
 docBase=/home/userId/public_html/myapp
 path=
 reloadable=true
 /Context
 
 Context elements should not be placed in server.xml; that's extremely
 poor practice left over from older versions of Tomcat.  What you have
 above is a real mess; remove the Context elements from server.xml and
 place them where they belong.  For the webapps stored outside of the
 appBase directory (admin and manager), this should be
 conf/Catalina/mydomain.com/[appName].xml.  Your default webapp should be
 located in /home/userId/public_html/ROOT - nowhere else, and its Context
 element should be in /home/userId/public_html/ROOT/META-INF/context.xml.
 
 Also note that if you have a single Host, it's not necessary to give it
 your domain name or supply any aliases; using the default of localhost
 will be fine.
 
 I would configure an HTTP Connector to allow testing of Tomcat without
 the complication of using httpd in front of it.  (In fact, if you're not
 using httpd for something useful - such as PHP - get rid of it; it's only
 making things more complicated and slowing you down.)
 
 META-INF/context.xml
 
 Where is the above directory located?
 
 Context path=/myapp docBase=myapp reloadable=true
 
 The path and docBase attributes are not allowed when the Context element
 is in a webapp's META-INF/context.xml file.
 
 Fix all of the above and see what happens.
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the e-mail
 and its attachments from all computers.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Virtual-host-configuration-problems-tp23501325p23505238.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Performance with many small requests

2009-05-12 Thread David kerber

Caldarale, Charles R wrote:

From: Leon Rosenberg [mailto:rosenberg.l...@googlemail.com]
Subject: Re: Performance with many small requests

If you would share your test code, I would love to test it on
some *nixes and darwins I have here;



Here's the code I used to do the synch vs atomic testing.  The command line 
parameter is the number of loops to perform; you'll want to set it to at least 
10, and even then run repeated tests - the timings can vary 
considerably, at least under Vista.

(Also being sent directly to the two requesters, in case the list strips the 
attachment.)

Might be interesting to modify it to run with more cores, if you have a system 
available.

 - Chuck
  

My dev machine:  WinXP SP3, dual-core 2.8GHz processor, java 1.5.0_12.

First, I ran it in Eclipse as supplied, with looplimit = 1000, and got:

secondary atomic time: 6890; ticks: 51773402
primary atomic time: 6890; ticks: 48226599
secondary synchronized time: 21281; ticks: 50282172
primary synchronized time: 21281; ticks: 49717829

Then I reversed the order of the tests (just to be sure it didn't 
matter) and got similar results:


secondary synchronized time: 21219; ticks: 49601191
primary synchronized time: 21234; ticks: 50398810
secondary atomic time: 6734; ticks: 52111089
primary atomic time: 6734; ticks: 47888912


Running at a command line (java -cp . TestSynch) gave me rather 
different results (qualitatively similar, quantitatively rather different):


primary synchronized time: 42998; ticks: 59125831
secondary synchronized time: 42998; ticks: 40874170
secondary atomic time: 4953; ticks: 49025722
primary atomic time: 4953; ticks: 50974279

After several tests, the ratio between the synchronized and atomic times 
varied between about 5 and 9, but atomic was always the lower time.  
Running two instances simultaneously didn't change the numbers much (as 
expected from a dual-core machine), but the command window with the 
focus always ran significantly faster than the one without it, no matter 
which one was started first.


One very surprising result (to me, anyway) was that 4 instances only 
extended the time numbers slightly (10%) for the synchronized run, and 
even less for the atomic run.  Going to 8 instances made a dramatic 
increase in the synchronized time, but again only a slight increase in 
the atomic version.  16 instances was too much for my system; it took a 
long time to start the last 8 or so, and both the atomic and the 
synchronized versions took a lot longer.


From these tests, it looks like, under windows XP and java 1.5 any way, 
that atomics are always faster, and also handle increasing concurrency 
much better than synchronize() blocks do.


Now to test on my server!!

Dave




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat not closing threads

2009-05-12 Thread Chetan Chheda
Hello, 
I am having an issue where I could use some clarity. 
We are using apache 2.0.59 and tomcat 5.5. We are having some growing pains 
with vendor specified modjk and tomcat settings. 
1. Tomcat opens up a number of threads during some transactions but does not 
close them. Is this because the connectionTimeout parameter is missing in the 
AJP connector defination? 
2. I do have the cache_timeout (deprecated , I know ) set to 900 secs. What 
impact does that have on closing idle threads?
3. Today one of the Tomcat's froze and thru jkstatus I saw 409 connections open 
to it. If my connection pool size is 256 (from modjk.log) why are more 
connections being opened?
 
Thanks,
Chetan
 
My workers.properties file looks like this. 
ps=/
worker.list=ajp13App31,ajp13App32,loadbalancer,mystatus
workers.tomcat_home=/coach/app/ptc/tomcat1
worker.ajp13App31.port=8012
worker.ajp13App31.host=localhost
worker.ajp13App31.type=ajp13
worker.ajp13App31.lbfactor=1
worker.ajp13App31.cache_timeout=900
worker.ajp13App31.socket_timeout=0
worker.ajp13App31.retries=3
worker.ajp13App31.recycle_timeout=900
worker.ajp13App32.port=8013
worker.ajp13App32.host=localhost
worker.ajp13App32.type=ajp13
worker.ajp13App32.lbfactor=1
worker.ajp13App32.cache_timeout=900
worker.ajp13App32.socket_timeout=0 
worker.ajp13App32.retries=3
worker.ajp13App32.recycle_timeout=900
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp13App31,ajp13App32
worker.loadbalancer.method=Request
worker.loadbalancer.sticky_session=true
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)tomcat.jar
worker.inprocess.cmd_line=start
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr
worker.mystatus.type=status
worker.mystatus.mount=/admin/status/jk
 
And here is the AJP13 connector from one of the tomcat's server.xml : 
Connector URIEncoding=UTF-8 acceptCount=100 debug=1 port=8012 
protocol=AJP/1.3 
protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler 
redirectPort=8445 tomcatAuthentication=false useBodyEncodingForURI=true
 
Apache MPM
# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
IfModule worker.c
ThreadLimit    512
StartServers   100
MaxClients 512
MinSpareThreads    129
MaxSpareThreads    256
ThreadsPerChild    256
MaxRequestsPerChild  0
/IfModule


  

Re: Performance with many small requests

2009-05-12 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

On 5/12/2009 12:27 AM, Caldarale, Charles R wrote:
 From: David Kerber [mailto:dcker...@verizon.net]
 Subject: Re: Performance with many small requests

 Incrementing a counter can't be much of a synchronization bottleneck,
 and if I switch to an AtomicInteger, it should be even less of one.
 
 Actually, it won't. There's a slight performance difference between
 the two mechanisms, but it's usually in favor of the synchronized
 increment, not the AtomicInteger, at least on my dual-core AMD 64 system
 running JDK 6u12 in 64-bit server mode on Vista. The difference is only
 a few percent, so you should just code it whichever way you find more
 maintainable. (Test program available on request; it would be
 interesting to see if the same relationship exists on a modern Intel chip.)

High monitor contention or low? I can run your test code on a Core 2 Duo
if you want to publish it.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkoJnmYACgkQ9CaO5/Lv0PDvxgCgsJr3YwJRFNh4ibZEQacaIWcN
1QcAnA5rOrqpu3WMqiBhzUZ6si3bI0lX
=9sJl
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat and Oracle connections

2009-05-12 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

On 5/11/2009 8:47 PM, Caldarale, Charles R wrote:
 From: Christopher Schultz [mailto:ch...@christopherschultz.net]
 Subject: Re: Tomcat and Oracle connections

 I would highly recommend adding these two attributes to your
 Resource:

logAbaodoned=true
removeAbandoned=true
removeAbandonedTimeout=30

 While you're at it, maybe you want to set:

validationQuery=SELECT 1 FROM DUAL
 
 Note that the OP is using type=oracle.jdbc.pool.OracleDataSource
 rather than Tomcat's pooling mechanism; consequently the above
 (slightly misspelled) attributes may not be applicable.

Whoops, I missed that; thanks for catching it.

Wouter, can you check to see if OracleDataSource has similar
configuration parameters? If not, consider using Tomcat's pool while you
inspect your application... you can always set it back to using Oracle's
DataSource if you need to.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkoJoncACgkQ9CaO5/Lv0PDx9ACfUvrw45atUZm65T9LI87GvrCB
RlYAnRAasHu2ay/EVgEtthCdy0kiNOTh
=agwY
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How to configure Tomcat 6.0 with JAAS?

2009-05-12 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

On 5/11/2009 11:16 PM, Caldarale, Charles R wrote:
 From: David Hoffer [mailto:dhoff...@gmail.com]
 Subject: Re: How to configure Tomcat 6.0 with JAAS?

 Next newbie question...will this be server agnostic?
 
 Unfortunately not.  The servlet spec does not define how realms are
 to be configured, so each app server rolls its own mechanism.  Note
 that the Context and Realm elements are unique to Tomcat, which
 is why they're not in WEB-INF/web.xml.

... though JBoss uses Tomcat as its default servlet container, so you
should be fine until you move to WebLogic, which uses a different
mechanism to configure its Realms.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkoJo+MACgkQ9CaO5/Lv0PDvWACfZ90OV5OMX5/4GD4NxNl4zGnx
oHQAn2ibKAKE/kmmDGHNWQbHC7DvCS86
=UANX
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat (re-)packaging, relocation etc..

2009-05-12 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 5/12/2009 7:39 AM, André Warnier wrote:
 I wonder if it is not time to make peace on this issue and maybe
 trying to find a reasonable middle ground.
 
 An installation of the complete official Tomcat under
 /usr/local/tomcatx.y, including logfiles, webapps, etc.. is undoubtedly
 the simplest case for someone here trying to offer support to some
 bewildered user.
 At the same time, it is not the configuration that most users have when
 they come here for help.

Yes, but if everyone has a different configuration, it's very difficult
to answer the question my app has been running forever without a
problem, and now it 'doesnt work'. We of course ask for log messages,
and the OP inevitably says where are my log files?. If the log files
are somewhere other than in the default location, we will simply have no
idea where to look.

I suppose we could say just run 'find / -name catalina.out' but that's
only good for UNIX and only if stdout has been redirected to
catalina.out (and not stdout.txt or catalina.log or
catalina_-MM-dd.log or whatever). Wanna find your log files on
Windows? That depends... are you running it as a service? Batch?
EXE-from-command-line? How was it configured... it's just a giant mess.

 Also, application packagers for various systems have undoubtedly a
 number of reasons for doing what they do, and it is also [doubtless]
 that the availability of software packaging and distribution mechanisms
 greatly facilitate the life of system administrators and a whole bunch
 of users.

I completely agree with this. I actually like the fact that package
managers move the log files to /var/log and the config files to /etc
(except that Tomcat shouldn't run as root, so things get a little hairy
when non-root users can write to /etc). If lots of people all use, say,
Debian, then we can at least say oh, you're on Debian, so your log
files are on _. Of course, the Debian (and other) folks clearly say
if you are having problems with our packages, contact us but they come
here anyway.

The only thing I take issue with is when people come on to the list and
say (to paraphrase) my app works and it must be your software that
sucks, when the reality is that their setup is not sane.

 For instance, the startup of Tomcat already uses the JAVA_HOME variable
 to locate the appropriate jvm, the CATALINA_HOME to find the code,
 CATALINA_BASE to find the instance-specific stuff etc..

... unless they are running it as a service under Windows. Or unless the
package maintainer has used their own script in /etc/init.d to start up
Tomcat (which is pretty much par for the course). The truth is that
bin/startup.sh is called somewhat rarely, apparently. That means that we
can't rely on the values for JAVA_HOME and CATALINA_HOME (which is
usually auto-detected anyway... it's rare for anyone to set
CATALINA_HOME in /etc/profile or anything like that).

 And why not add a standard program/script/webapp to Tomcat, which prints
 out a few lines containing the platform type, Tomcat version, location,
 jvm version and location, webapps location, logfiles location, and so
 on, so that we could in this forum ask that posters first and for all
 execute this command or webapp and prefix their messages with the output ?
 Only that, would already save a significant percentage of the bandwidth
 on this list.

I would love that but you could only really get the real story from the
running server. Otherwise, you run the risk of running a script that's
not actually being used (like reading bin/catalina.sh when it's not even
being called) or looking at a configuration file that's not being used
(or out of date). Again, this is a problem: where is your Tomcat
running? Port 8080? How about 80? Maybe 8443? 8009? HTTP? AJP? AJP
protocol on a (typically) HTTP port? What if it's not running yet? How
do you start it? Well, that depends on your configuration...

It's just a giant mess no matter which way you slice it.

I would love it if package maintainers would maintain a script that
would print out the configuration. Tomcat could provide the default
one that would report what it /would/ use, and the package maintainers
can feel free to customize it they just have to actually DO it :)

Of course, such a script would probably just read configuration from the
standard location for that environment, which should be published in
some documentation somewhere. If most folks would just read
documentation, they wouldn't have nearly so many questions...

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkoJp1MACgkQ9CaO5/Lv0PBSbgCeKU0n+2YBqedUbf0arVuCwOhx
aGoAn1qrgVqJitcNfmEKna3CcV3EePVB
=1/pg
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: 

RE: How to configure Tomcat 6.0 with JAAS?

2009-05-12 Thread Caldarale, Charles R
 From: Christopher Schultz [mailto:ch...@christopherschultz.net]
 Subject: Re: How to configure Tomcat 6.0 with JAAS?
 
 ... though JBoss uses Tomcat as its default servlet container

Unfortunately, JBoss does not use Tomcat's authentication - it has its own.  
When we wrote JAAS modules for use on our proprietary OS, we had to do separate 
implemenations for JBoss and Tomcat.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.




RE: Virtual host configuration problems

2009-05-12 Thread Caldarale, Charles R
 From: JDawg72 [mailto:mr.j@hotmail.com]
 Subject: RE: Virtual host configuration problems
 
 Your default webapp should be located in /home/userId/public_html/ROOT
 -
 nowhere else, and its Context element should be in
 /home/userId/public_html/ROOT/META-INF/context.xml.
 Also I am not clear on the suggestion of using “ROOT”.

It's not a suggestion - it's a requirement.  The default webapp must be named 
ROOT, so change the name of the directory from myapp to ROOT (must be upper 
case).

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.



RE: Tomcat and Oracle connections

2009-05-12 Thread Martin Gainty

Here is configuration which would work for your TC environment
http://forum.springsource.org/showthread.php?t=63392

One more link which will illustrate usage of OracleConnectionCacheImpl
http://www.stanford.edu/group/coursework/stanfordoki/oracle/oracle/jdbc/pool/OracleConnectionCacheImpl.html

feel free to ping me offline for any details on configuring the DataSource or 
how to determine if your DB supports FCF
Martin Gainty 
__ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de 
déni et de confidentialité
This message is confidential. If you should not be the intended receiver, then 
we ask politely to report. Each unauthorized forwarding or manufacturing of a 
copy is inadmissible. This message serves only for the exchange of information 
and has no legal binding effect. Due to the easy manipulation of emails we 
cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




 Date: Tue, 12 May 2009 12:23:19 -0400
 From: ch...@christopherschultz.net
 To: users@tomcat.apache.org
 Subject: Re: Tomcat and Oracle connections
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Chuck,
 
 On 5/11/2009 8:47 PM, Caldarale, Charles R wrote:
  From: Christopher Schultz [mailto:ch...@christopherschultz.net]
  Subject: Re: Tomcat and Oracle connections
 
  I would highly recommend adding these two attributes to your
  Resource:
 
 logAbaodoned=true
 removeAbandoned=true
 removeAbandonedTimeout=30
 
  While you're at it, maybe you want to set:
 
 validationQuery=SELECT 1 FROM DUAL
  
  Note that the OP is using type=oracle.jdbc.pool.OracleDataSource
  rather than Tomcat's pooling mechanism; consequently the above
  (slightly misspelled) attributes may not be applicable.
 
 Whoops, I missed that; thanks for catching it.
 
 Wouter, can you check to see if OracleDataSource has similar
 configuration parameters? If not, consider using Tomcat's pool while you
 inspect your application... you can always set it back to using Oracle's
 DataSource if you need to.
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iEYEARECAAYFAkoJoncACgkQ9CaO5/Lv0PDx9ACfUvrw45atUZm65T9LI87GvrCB
 RlYAnRAasHu2ay/EVgEtthCdy0kiNOTh
 =agwY
 -END PGP SIGNATURE-
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

_
Insert movie times and more without leaving Hotmail®.
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd1_052009

RE: Performance with many small requests

2009-05-12 Thread Caldarale, Charles R
 From: David kerber [mailto:dcker...@verizon.net]
 Subject: Re: Performance with many small requests
 
 From these tests, it looks like, under windows XP and java 1.5 
 any way, that atomics are always faster

Try it under 1.6; Sun made major improvements to synchronization handling 
between 1.5 and 1.6.  When I reran my tests on 1.5 (which I don't use these 
days), I got numbers similar to yours.  1.6 is much, much faster.

Also, what is your CPU type?  Intel and AMD may have significant differences, 
as may 32- vs 64-bit.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Virtual host configuration problems

2009-05-12 Thread JDawg72

Thanks Chuck, that worked but what has to happen when I need to add another
domain and application to this instance of Tomcat?

Jeremy


Caldarale, Charles R wrote:
 
 From: JDawg72 [mailto:mr.j@hotmail.com]
 Subject: RE: Virtual host configuration problems
 
 Your default webapp should be located in /home/userId/public_html/ROOT
 -
 nowhere else, and its Context element should be in
 /home/userId/public_html/ROOT/META-INF/context.xml.
 Also I am not clear on the suggestion of using “ROOT”.
 
 It's not a suggestion - it's a requirement.  The default webapp must be
 named ROOT, so change the name of the directory from myapp to ROOT (must
 be upper case).
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the e-mail
 and its attachments from all computers.
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Virtual-host-configuration-problems-tp23501325p23506692.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Virtual host configuration problems

2009-05-12 Thread Hassan Schroeder
On Tue, May 12, 2009 at 10:13 AM, JDawg72 mr.j@hotmail.com wrote:

 ... but what has to happen when I need to add another
 domain and application to this instance of Tomcat?

http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

-- 
Hassan Schroeder  hassan.schroe...@gmail.com

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Performance with many small requests

2009-05-12 Thread David kerber

Caldarale, Charles R wrote:

From: David kerber [mailto:dcker...@verizon.net]
Subject: Re: Performance with many small requests

From these tests, it looks like, under windows XP and java 1.5 
any way, that atomics are always faster



Try it under 1.6; Sun made major improvements to synchronization handling 
between 1.5 and 1.6.  When I reran my tests on 1.5 (which I don't use these 
days), I got numbers similar to yours.  1.6 is much, much faster.
  
That's good to know; that would be an incentive for me to migrate this 
app to 1.6 and Tomcat 6.



Also, what is your CPU type?  Intel and AMD may have significant differences, 
as may 32- vs 64-bit.
  

AMD 64 x2, running 32-bit windows XP


 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



  




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: How to create a virtual host with war file without beeing created aROOT dir?

2009-05-12 Thread Caldarale, Charles R
 From: raistlink [mailto:ela...@gmail.com]
 Subject: How to create a virtual host with war file without beeing
 created aROOT dir?
 
 I've been developing an application with this structure of directories

Care to tell us the version of Tomcat you're using?  Or should we just guess?

The above is incorrect; set it up like this:

mydir/html/ROOT
mydir/html/ROOT/WEB-INF
mydir/html/ROOT/WEB-INF/classes
mydir/html/ROOT/WEB-INF/lib
mydir/html/ROOT/WEB-INF/web.xml

 At server.xml I've included this host:
 
 Host name=myhost.es appBase=/myhost/html unpackWARs=true
 autoDeploy=true xmlValidation=false xmlNamespaceAware=false

With the above directory changes, your Host settings are o.k.

   Context path= reloadable=true docBase=/myhost/html/

The Context is completely wrong:

1) Don't put Context elements in server.xml - that's extremely bad practice 
unless you're using an ancient level of Tomcat.

2) The Context element should be in the webapp's META-INF/context.xml file; 
in your case, that will be mydir/html/ROOT/META-INF/context.xml.

3) The docBase attribute (when used, which is rarely) must *never* be the same 
as appBase.

4) For your case, the path and docBase attributes are not allowed when the 
Context element is in the proper location; remove them.

 And everything works fine.

Not really; there are bugs in certain versions of Tomcat that make it appear to 
work.  You're also getting double application deployment and have serious 
security holes with your current setup.

 What I've done es to take the directory mydir/html and create the
 html.war.

Change the name to ROOT.war.

 Then I changed the host by this one:
 Host name=myhost.es appBase=/myhost unpackWARs=true
 autoDeploy=true
 xmlValidation=false xmlNamespaceAware=false

The above is o.k.

   Context path= reloadable=true docBase=/myhost/html/

This is bad, for the reasons stated above.  Correct it as noted above.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Virtual host configuration problems

2009-05-12 Thread Caldarale, Charles R
 From: JDawg72 [mailto:mr.j@hotmail.com]
 Subject: RE: Virtual host configuration problems
 
 what has to happen when I need to add another
 domain and application to this instance of Tomcat?

A domain may have many webapps deployed for it.  Each domain also has to have 
one default webapp.  When you have multiple, independent domains, each will 
need its own Host element with a unique appBase setting.  Under each appBase, 
place the domain's default webapp in the ROOT directory (or use a ROOT.war 
file).

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.



RE: Performance with many small requests

2009-05-12 Thread Caldarale, Charles R
 From: David kerber [mailto:dcker...@verizon.net]
 Subject: Re: Performance with many small requests
 
 That's good to know; that would be an incentive for me to migrate this
 app to 1.6 and Tomcat 6.

You don't need to move to Tomcat 6 to use a 1.6 JVM; you can use the Tomcat you 
already have.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat not closing threads

2009-05-12 Thread Chetan Chheda
Just wondering if anyone got my message below? 





From: Chetan Chheda chetan_chh...@yahoo.com
To: users@tomcat.apache.org
Sent: Tuesday, May 12, 2009 12:03:49 PM
Subject: Tomcat not closing threads

Hello, 
I am having an issue where I could use some clarity. 
We are using apache 2.0.59 and tomcat 5.5. We are having some growing pains 
with vendor specified modjk and tomcat settings. 
1. Tomcat opens up a number of threads during some transactions but does not 
close them. Is this because the connectionTimeout parameter is missing in the 
AJP connector defination? 
2. I do have the cache_timeout (deprecated , I know ) set to 900 secs. What 
impact does that have on closing idle threads?
3. Today one of the Tomcat's froze and thru jkstatus I saw 409 connections open 
to it. If my connection pool size is 256 (from modjk.log) why are more 
connections being opened?
 
Thanks,
Chetan
 
My workers.properties file looks like this. 
ps=/
worker.list=ajp13App31,ajp13App32,loadbalancer,mystatus
workers.tomcat_home=/coach/app/ptc/tomcat1
worker.ajp13App31.port=8012
worker.ajp13App31.host=localhost
worker.ajp13App31.type=ajp13
worker.ajp13App31.lbfactor=1
worker.ajp13App31.cache_timeout=900
worker.ajp13App31.socket_timeout=0
worker.ajp13App31.retries=3
worker.ajp13App31.recycle_timeout=900
worker.ajp13App32.port=8013
worker.ajp13App32.host=localhost
worker.ajp13App32.type=ajp13
worker.ajp13App32.lbfactor=1
worker.ajp13App32.cache_timeout=900
worker.ajp13App32.socket_timeout=0 
worker.ajp13App32.retries=3
worker.ajp13App32.recycle_timeout=900
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp13App31,ajp13App32
worker.loadbalancer.method=Request
worker.loadbalancer.sticky_session=true
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)tomcat.jar
worker.inprocess.cmd_line=start
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr
worker.mystatus.type=status
worker.mystatus.mount=/admin/status/jk
 
And here is the AJP13 connector from one of the tomcat's server.xml : 
Connector URIEncoding=UTF-8 acceptCount=100 debug=1 port=8012 
protocol=AJP/1.3 
protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler 
redirectPort=8445 tomcatAuthentication=false useBodyEncodingForURI=true
 
Apache MPM
# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
IfModule worker.c
ThreadLimit    512
StartServers   100
MaxClients 512
MinSpareThreads    129
MaxSpareThreads    256
ThreadsPerChild    256
MaxRequestsPerChild  0
/IfModule


  

Re: Is it possible to move Tomcat logfiles?

2009-05-12 Thread Jonathan Mast
Did CentOS setup /var and /usr on different partitions?  If so then maybe it
would be a good idea to place the logs some where on /var.

What else will this server be used for aside from the Webserver?  If nothing
else and if /var and /usr are on the same partition, then I wouldn't alter
the default locations of the tomcat folders.

On Sun, May 10, 2009 at 11:35 AM, Konstantin Kolinko knst.koli...@gmail.com
 wrote:

 2009/5/10 johnrock johnpi...@yahoo.com:
 
  I am setting up a CentOS 5 server running tomcat and wanted to know
 whether
  the best practice is to leave the Tomcat logfiles in their default
 location:
 
  /usr/share/apache-tomcat-6.0.18/logs
 
  or whether I should place them in another directory like /var/log/tomcat.
 
  Is this possible, and/or preferred?
 
  I am new to Linux, but my understanding so far was that changing data
 like
  logfiles should not be under /usr/ but instead under /var/.  Is that a
  correct interpretation in this case?
 
  Thanks
  --

 1. the log folder contains:
 1) log output

 By default java.util.logging (aka JULI) is used to write those logs,
 though there is possibility to use log4j.

 It is configured as described in
  http://tomcat.apache.org/tomcat-5.5-doc/logging.html

 For JULI the configuration file is logging.properties

 2) catalina.out, that is redirected stdout, strerr of
 java process running the server

 Look into the shell script that starts Tomcat. That is where the
 redirection occurs.

 2. I have configurations where log folder is stored in /var/log/... and the
 log folder of Tomcat is simply a symbolic link to that location.

 It works, and I think that would be one of the easiest ways to configure
 it.

 3. If you are concerned about /usr vs. /var, you may want to pay attention
 to the possibility of separating CATALINA_HOME and CATALINA_BASE

 E.g., you may place conf, webapps, work etc. folders on /var, while bin,
 common, server remain on /usr.

 See RUNNING.txt in the distributive.


 Best regards,
 Konstantin Kolinko

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: problems with mod_proxy (apache 2.2.9) and tomcat ajp connector (6.0.18)

2009-05-12 Thread Michael Biebl
2009/5/12 André Warnier a...@ice-sa.com:
 Michael Biebl wrote:

 2009/5/12 André Warnier a...@ice-sa.com:

 Michael Biebl wrote:

 Hi,

 first of all, I'd like to say hi, as I'm new to the list.

 I hope you can help me with the following problem I have.
 I run a stock Debian lenny installation with apache 2.2.9 and tomcat
 6.0.18
 I'm using mod_proxy to forward the request to tomcat using ajp. The
 apache vhost configuration looks like this:

 VirtualHost *:80

 ...
       ProxyRequests Off
       ProxyVia On
       ProxyPass /t/ ajp://localhost:8009/barcooServer/t/
       ProxyPass /ws/ ajp://localhost:8009/barcooServer/ws/
       ProxyPass /reports/ ajp://localhost:8009/barcooServer/reports/
       ProxyPass / ajp://localhost:8009/barcooWebsite/
       ProxyPassReverse / ajp://localhost:8009/barcooWebsite/
       ProxyPassReverseCookiePath /barcooWebsite /
 ...

 /VirtualHost

 The apache mpm prefork modules is used with the following configuration.
 IfModule mpm_prefork_module
   StartServers          5
   MinSpareServers       5
   MaxSpareServers      10
   MaxClients          200
   MaxRequestsPerChild   0
 /IfModule

 The tomcat ajp connector configuration is as simple as
 Connector port=8009 protocol=AJP/1.3 redirectPort=8443 /


 Now, when I get a lot of users access, the http connection via apache
 slows down to a crawl
 and I get a lot of the following messages in the kernel log:

 [2350915.113736] __ratelimit: 11 messages suppressed
 [2350915.113742] TCPv6: Possible SYN flooding on port 8009. Dropping
 request.

 apache and tomcat itself seem to be idling along, and the load is not
 that high on the machine.

 Has anyone an idea what's going on there?

 It seems to be something entorely outside of Apache and Tomcat.
 I'm no specialist, but a few names come to mind : iptables, denyhosts,
 SELinux ?

 No selinux enabled, no iptables rules loaded, no denyhosts installed.

 My guess somehow is, that apache is opening too many ajp connections
 to tomcat...

 Apart from the answer given by Rainer,

 too many for whom ? or, compared to what ?

 Ok, granted, too many for something on your system, since the error messages
 were :
 [2350915.113736] __ratelimit: 11 messages suppressed
 [2350915.113742] TCPv6: Possible SYN flooding on port 8009. Dropping
 request.

 Let's take these messages at face value.
 A SYN is the first packet that a client sends to a server, to establish a
 connection.
 a SYN flood is a type of attack, whereby some nefarious agent will flood
 the server with SYN requests for new connections, trying to bring it down.
 The _ratelimit part seems to indicate that there is some rate limit to new
 connections set up in your system.  That is usually a parameter defining how
 many new connections can be accepted per minute on some port.

 The Apache part of the connector indeed needs to establish connections to
 the back-end Tomcat, in your case to port 8009. If the configuration is very
 deficient, it may need to establish more connections than strictly
 necessary, but not I believe enough to justify a real SYN flood suspicion.

 As far as I know also - referring to the too many bit - Tomcat will
 happily accept hundreds of connections on port 8009, and depending on what
 you run this on, can support hundreds of simultaneous threads processing
 requests.

As you can see, I have 4 ProxyPass directives. Does that mean that I
will get 4 ajp connections from apache to tomcat per user request, ie.
if say 200 users are online I have 800 connections open?

Is it correct, that apache uses ipv6 for the ajp connection (as the
log is talking about tcpv6)?

 And it is not Tomcat complaining, it is some other system component that
 writes to kernel.log.

I know, it's the kernel that is dropping the connections.
I'm wondering if there is  a limit of open ajp connections?

 Would you by any chance have something mentioning port 8009 anywhere in
 /etc/network/* ?

No.

 Other than that, is there any log facility available in mod_proxy_ajp, which
 you could set to debug for a while to see what is really going on from
 that side ?



-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How to create a virtual host with war file without beeing created aROOT dir?

2009-05-12 Thread André Warnier

Caldarale, Charles R wrote:

From: raistlink [mailto:ela...@gmail.com]
Subject: How to create a virtual host with war file without beeing
created aROOT dir?

I've been developing an application with this structure of directories


Care to tell us the version of Tomcat you're using?  Or should we just guess?

The above is incorrect; set it up like this:

mydir/html/ROOT
mydir/html/ROOT/WEB-INF
mydir/html/ROOT/WEB-INF/classes
mydir/html/ROOT/WEB-INF/lib
mydir/html/ROOT/WEB-INF/web.xml


At server.xml I've included this host:

Host name=myhost.es appBase=/myhost/html unpackWARs=true
autoDeploy=true xmlValidation=false xmlNamespaceAware=false


With the above directory changes, your Host settings are o.k.


Context path= reloadable=true docBase=/myhost/html/


The Context is completely wrong:

1) Don't put Context elements in server.xml - that's extremely bad practice 
unless you're using an ancient level of Tomcat.

2) The Context element should be in the webapp's META-INF/context.xml file; 
in your case, that will be mydir/html/ROOT/META-INF/context.xml.

3) The docBase attribute (when used, which is rarely) must *never* be the same 
as appBase.

4) For your case, the path and docBase attributes are not allowed when the 
Context element is in the proper location; remove them.


And everything works fine.


Not really; there are bugs in certain versions of Tomcat that make it appear to 
work.  You're also getting double application deployment and have serious 
security holes with your current setup.


What I've done es to take the directory mydir/html and create the
html.war.


Change the name to ROOT.war.


Then I changed the host by this one:
Host name=myhost.es appBase=/myhost unpackWARs=true
autoDeploy=true
xmlValidation=false xmlNamespaceAware=false


The above is o.k.


Context path= reloadable=true docBase=/myhost/html/


This is bad, for the reasons stated above.  Correct it as noted above.



What I don't get in all this, is how it works, what with the application 
located in /mydir/html and the Tomcat appBase in /myhost/html.


What version of Tomcat is that ? It's *really* smart.
;-)

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



requested resource not available

2009-05-12 Thread tomcat
I am running Tomcat 5.5.26, Java 1.6.0_13, and Centos 5.2 64 bit.

I am really stumped, getting The requested resource not 
available. I Googled and found quite items on this topic and 
everything points to an incorrect path. I have checked all the 
paths I can find, and am not finding the problem. 

I have another box with this successfully installed and as far as I 
can tell the 2 installations are identical, except one works and 
one does not.

Any ideas? Please let me know, thanks for your help,

Brad


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Performance with many small requests

2009-05-12 Thread Caldarale, Charles R
 From: David kerber [mailto:dcker...@verizon.net]
 Subject: Re: Performance with many small requests
 
 How difficult are keepalives to implement?

That would depend on your client.  Looks like the Apache http client supports 
it, but I haven't used it.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: requested resource not available

2009-05-12 Thread Caldarale, Charles R
 From: tom...@nym.hush.com [mailto:tom...@nym.hush.com]
 Subject: requested resource not available
 
 I am running Tomcat 5.5.26, Java 1.6.0_13, and Centos 5.2 64 bit.

Thanks for telling us that; an amazing number of people fail to do so.

 I am really stumped, getting The requested resource not
 available.

When you do what?  Where is that message displayed?  Have you looked in the 
Tomcat logs?

If the message is being displayed by a browser, is there a firewall blocking 
the access?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.



RE: requested resource not available

2009-05-12 Thread tomcat
Thank you for your help, Chuck.

I get the message when trying to access the application through a 
browser. I did try with and without the firewall enabled on the 
server, and nothing changed. I am not sure I have Tomcat logging 
set up correctly, so I have not learned anything there.

I am brand new to Tomcat, as you can probably tell.

Brad

On Tue, 12 May 2009 14:34:10 -0500 Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:
 From: tom...@nym.hush.com [mailto:tom...@nym.hush.com]
 Subject: requested resource not available
 
 I am running Tomcat 5.5.26, Java 1.6.0_13, and Centos 5.2 64 
bit.

Thanks for telling us that; an amazing number of people fail to do 
so.

 I am really stumped, getting The requested resource not
 available.

When you do what?  Where is that message displayed?  Have you 
looked in the Tomcat logs?

If the message is being displayed by a browser, is there a 
firewall blocking the access?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE 
PROPRIETARY MATERIAL and is thus for use only by the intended 
recipient. If you received this in error, please contact the 
sender and delete the e-mail and its attachments from all 
computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Performance with many small requests

2009-05-12 Thread Christopher Schultz
On May 12, 2009, at 13:09, Caldarale, Charles R chuck.caldar...@unisys.com 
 wrote:



From: David kerber [mailto:dcker...@verizon.net]
Subject: Re: Performance with many small requests

From these tests, it looks like, under windows XP and java 1.5
any way, that atomics are always faster


Try it under 1.6; Sun made major improvements to synchronization  
handling between 1.5 and 1.6.  When I reran my tests on 1.5 (which I  
don't use these days), I got numbers similar to yours.  1.6 is much,  
much faster.


This reminds me of perfomance optimizations that people used to make  
in their Java code such as converting String objects to byte arrays to  
do operations on them because everyone knew that it was faster.  
Then, Sun came along and optimized the String API implementation,  
causing all those optimizations to then be slower than the  
straightforward implementatios of string ops. That optimized code  
also has the added advantage of being confusing to read.


I agree with Chuck's assertion that understandability ought to be a  
more important goal than maximum possible performance.


-chris 
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: requested resource not available

2009-05-12 Thread Caldarale, Charles R
 From: tom...@nym.hush.com [mailto:tom...@nym.hush.com]
 Subject: RE: requested resource not available
 
 I am not sure I have Tomcat logging set up correctly,
 so I have not learned anything there.

For a standard Tomcat installation (downloaded from tomcat.apache.org), there's 
really nothing to set up; the log files will be in Tomcat's logs directory.  If 
you're using a 3rd-party repackaged version of Tomcat, there's no telling where 
the log files might be.

Assuming you can find the logs, try updating conf/server.xml to remove the 
comment markers around the AccessLogValve and restart Tomcat.  The logs will 
then show whether or not the request is even reaching Tomcat.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.



RE: requested resource not available

2009-05-12 Thread tomcat
Ok, I did that and here is what I got:

[r...@li54-122 bin]# less ../logs/localhost_access_log.2009-05-
12.txt 
70.249.74.9 - - [12/May/2009:16:17:00 -0400] GET / HTTP/1.1 200 
347
70.249.74.9 - - [12/May/2009:16:17:00 -0400] GET /pentaho/ 
HTTP/1.1 404 979



On Tue, 12 May 2009 15:11:15 -0500 Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:
 From: tom...@nym.hush.com [mailto:tom...@nym.hush.com]
 Subject: RE: requested resource not available
 
 I am not sure I have Tomcat logging set up correctly,
 so I have not learned anything there.

For a standard Tomcat installation (downloaded from 
tomcat.apache.org), there's really nothing to set up; the log 
files will be in Tomcat's logs directory.  If you're using a 3rd-
party repackaged version of Tomcat, there's no telling where the 
log files might be.

Assuming you can find the logs, try updating conf/server.xml to 
remove the comment markers around the AccessLogValve and restart 
Tomcat.  The logs will then show whether or not the request is 
even reaching Tomcat.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE 
PROPRIETARY MATERIAL and is thus for use only by the intended 
recipient. If you received this in error, please contact the 
sender and delete the e-mail and its attachments from all 
computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: requested resource not available

2009-05-12 Thread Caldarale, Charles R
 From: tom...@nym.hush.com [mailto:tom...@nym.hush.com]
 Subject: RE: requested resource not available
 
 [r...@li54-122 bin]# less ../logs/localhost_access_log.2009-05-
 12.txt
 70.249.74.9 - - [12/May/2009:16:17:00 -0400] GET / HTTP/1.1 200
 347
 70.249.74.9 - - [12/May/2009:16:17:00 -0400] GET /pentaho/
 HTTP/1.1 404 979

Are those the requests you expected to see?  Do they correspond to the URLs you 
submitted from the browser?

Do you have a webapp named pentaho deployed?  If so, does it have a welcome 
page under its first-level directory?  If not, do you have a servlet mapping 
for it that should have handled all requests?

Have you followed the guidelines for webapp deployment described in the doc?
http://tomcat.apache.org/tomcat-5.5-doc/appdev/index.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.



IE + Flash + mod_jk issue

2009-05-12 Thread Stephen More
I have a flash application ( Macromedia Breeze Presentation ) that is
working fine when I access it directly from tomcat's port 8080.

When I access it through apache using mod_jk, IE loads some of the
flash files, but not all.
The problem is only appearing with IE, it is working fine with Firefox.

Here are my options:
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

Could this be a mod_jk issue or should I be looking at something else ?

Any help is appreciated.
-Thanks
Steve More

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Performance with many small requests

2009-05-12 Thread David kerber

Christopher Schultz wrote:
On May 12, 2009, at 13:09, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:



From: David kerber [mailto:dcker...@verizon.net]
Subject: Re: Performance with many small requests

From these tests, it looks like, under windows XP and java 1.5
any way, that atomics are always faster


Try it under 1.6; Sun made major improvements to synchronization 
handling between 1.5 and 1.6.  When I reran my tests on 1.5 (which I 
don't use these days), I got numbers similar to yours.  1.6 is much, 
much faster.


This reminds me of perfomance optimizations that people used to make 
in their Java code such as converting String objects to byte arrays to 
do operations on them because everyone knew that it was faster. 
Then, Sun came along and optimized the String API implementation, 
causing all those optimizations to then be slower than the 
straightforward implementatios of string ops. That optimized code 
also has the added advantage of being confusing to read.
When (what java version) did those string operation optimizations 
happen?  Sun's web page that talks about this (and explicitly says that 
string buffers are usually faster than direct string operations) doesn't 
mention a specific java version.




I agree with Chuck's assertion that understandability ought to be a 
more important goal than maximum possible performance.

That's going to depend on the application's intended use.

Dave



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: requested resource not available

2009-05-12 Thread tomcat
Those are the requests I expected to see, they do correspond to the 
URLs I entered in the browser.

I am deploying a preconfigured version of Pentaho that I found 
here: 
http://sourceforge.net/project/showfiles.php?group_id=140317package
_id=160028release_id=648414

I deployed this exact same package on my development box with no 
problems. The preconfigured installation of Tomcat does appear (to 
me at least) to follow the deployment guidelines on the link you 
sent.

On Tue, 12 May 2009 15:28:50 -0500 Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:
 From: tom...@nym.hush.com [mailto:tom...@nym.hush.com]
 Subject: RE: requested resource not available
 
 [r...@li54-122 bin]# less ../logs/localhost_access_log.2009-05-
 12.txt
 70.249.74.9 - - [12/May/2009:16:17:00 -0400] GET / HTTP/1.1 
200
 347
 70.249.74.9 - - [12/May/2009:16:17:00 -0400] GET /pentaho/
 HTTP/1.1 404 979

Are those the requests you expected to see?  Do they correspond to 
the URLs you submitted from the browser?

Do you have a webapp named pentaho deployed?  If so, does it have 
a welcome page under its first-level directory?  If not, do you 
have a servlet mapping for it that should have handled all 
requests?

Have you followed the guidelines for webapp deployment described 
in the doc?
http://tomcat.apache.org/tomcat-5.5-doc/appdev/index.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE 
PROPRIETARY MATERIAL and is thus for use only by the intended 
recipient. If you received this in error, please contact the 
sender and delete the e-mail and its attachments from all 
computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: IE + Flash + mod_jk issue

2009-05-12 Thread Rainer Jung
On 12.05.2009 22:33, Stephen More wrote:
 I have a flash application ( Macromedia Breeze Presentation ) that is
 working fine when I access it directly from tomcat's port 8080.
 
 When I access it through apache using mod_jk, IE loads some of the
 flash files, but not all.
 The problem is only appearing with IE, it is working fine with Firefox.
 
 Here are my options:
 JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
 
 Could this be a mod_jk issue or should I be looking at something else ?

Sounds like an IE issue :)

I would start with finding out, what the URLs of the missing flashes
are, and how the browser learns about those URLs (are they part of some
content retrieved previously or similar)?

Then check, how the URLs look like in the 8080 case respectively
Apache/mod_jk case. Maybe you'll find something strange.

Could it be a security setting in MSIE?

Regards,

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Performance with many small requests

2009-05-12 Thread Caldarale, Charles R
 From: David kerber [mailto:dcker...@verizon.net]
 Subject: Re: Performance with many small requests
 
 When (what java version) did those string operation optimizations
 happen?  Sun's web page that talks about this (and explicitly says
 that string buffers are usually faster than direct string operations)
 doesn't mention a specific java version.

Don't confuse a StringBuffer (the recommended type) with a byte array (what 
Chris was talking about).  Since a String object is immutable, one should 
always use a StringBuffer (preferably a StringBuilder, these days) when you are 
constructing strings in a piecemeal fashion, then convert to String when 
complete.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



tomcat close_wait state and proxy error when connecting to my web application

2009-05-12 Thread orahi001

Hi,

I have apache web server running on one box as a proxy server
tomcat running on another box.

The apache server connects to application server (tomcat) via proxy passthru
parameter. The server running tomcat was recently rebooted.  When it came
back up I started tomcat but I can no longer connect to my web application
over http.  I'm getting a proxy error in my browser window: error reading
from the remote server.  The apache log shows the same message.

On the server running tomcat, netstat -a shows the port running tomcat
changes to a state of close_wait.

however, if I telnet to the port (8980) from the server running apache I can
connect and the port shows a state of established.

Any ideas as to why I can no longer reach my web application?
Whats causing this close_wait state?


thanks,

-- 
View this message in context: 
http://www.nabble.com/tomcat-close_wait-state-and-proxy-error-when-connecting-to-my-web-application-tp23510873p23510873.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat not closing threads

2009-05-12 Thread Chetan Chheda
I managed to get a thread dump during one such tomcat hangs. Most of the 
threads are in the following status ...

TP-Processor7 daemon prio=10 tid=00093ab0 nid=86 lwp_id=4866290 runnable 
[53c0..53c00dc0]
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:134)
    at java.io.FilterInputStream.read(FilterInputStream.java:111)
    at 
com.wily.introscope.agent.probe.net.ManagedSocketInputStream.read(ManagedSocketInputStream.java:214)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:222)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
    - locked 8e0d3a50 (a java.io.BufferedInputStream)
    at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:598)
    at org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:535)
    at 
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:663)
    at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
    at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:534)
TP-Processor6 daemon prio=10 tid=000938d0 nid=85 lwp_id=4866288 runnable 
[53cc..53cc0dc0]
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:134)
    at java.io.FilterInputStream.read(FilterInputStream.java:111)
    at 
com.wily.introscope.agent.probe.net.ManagedSocketInputStream.read(ManagedSocketInputStream.java:214)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:222)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
    - locked 8e0d7ed8 (a java.io.BufferedInputStream)
    at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:598)
    at org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:535)
    at 
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:663)
    at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
    at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:534)






From: Chetan Chheda chetan_chh...@yahoo.com
To: Tomcat Users List users@tomcat.apache.org
Sent: Tuesday, May 12, 2009 1:32:16 PM
Subject: Re: Tomcat not closing threads

Just wondering if anyone got my message below? 





From: Chetan Chheda chetan_chh...@yahoo.com
To: users@tomcat.apache.org
Sent: Tuesday, May 12, 2009 12:03:49 PM
Subject: Tomcat not closing threads

Hello, 
I am having an issue where I could use some clarity. 
We are using apache 2.0.59 and tomcat 5.5. We are having some growing pains 
with vendor specified modjk and tomcat settings. 
1. Tomcat opens up a number of threads during some transactions but does not 
close them. Is this because the connectionTimeout parameter is missing in the 
AJP connector defination? 
2. I do have the cache_timeout (deprecated , I know ) set to 900 secs. What 
impact does that have on closing idle threads?
3. Today one of the Tomcat's froze and thru jkstatus I saw 409 connections open 
to it. If my connection pool size is 256 (from modjk.log) why are more 
connections being opened?
 
Thanks,
Chetan
 
My workers.properties file looks like this. 
ps=/
worker.list=ajp13App31,ajp13App32,loadbalancer,mystatus
workers.tomcat_home=/coach/app/ptc/tomcat1
worker.ajp13App31.port=8012
worker.ajp13App31.host=localhost
worker.ajp13App31.type=ajp13
worker.ajp13App31.lbfactor=1
worker.ajp13App31.cache_timeout=900
worker.ajp13App31.socket_timeout=0
worker.ajp13App31.retries=3
worker.ajp13App31.recycle_timeout=900
worker.ajp13App32.port=8013
worker.ajp13App32.host=localhost
worker.ajp13App32.type=ajp13
worker.ajp13App32.lbfactor=1
worker.ajp13App32.cache_timeout=900
worker.ajp13App32.socket_timeout=0 
worker.ajp13App32.retries=3
worker.ajp13App32.recycle_timeout=900
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp13App31,ajp13App32
worker.loadbalancer.method=Request
worker.loadbalancer.sticky_session=true
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)tomcat.jar
worker.inprocess.cmd_line=start
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr
worker.mystatus.type=status
worker.mystatus.mount=/admin/status/jk
 
And here is the AJP13 connector from one of the tomcat's server.xml : 
Connector URIEncoding=UTF-8 acceptCount=100 debug=1 port=8012 
protocol=AJP/1.3 
protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler 
redirectPort=8445 tomcatAuthentication=false 

Re: Preventing OutOfMemoryError: Java heap space

2009-05-12 Thread Todd Hivnor

 From: Todd Hivnor [spambox_98...@yahoo.com]

 I would like to proactively avoid running out of heap
 space. I would like people get a Server Too Busy
 message, _before_ the heap is actually exhausted.

 I would rather serve 40 users well than 45 users
 poorly.

 Rather than monitor memory, which is subject to GC
 whims as George points out, I'd suggest monitoring 
 the number of sessions in your  application - find a 
 number of sessions you can live with, keep a (suitably 
 synchronized) counter that's incremented and decremented 
 as  sessions are created and destroyed, and don't start
 new sessions if that counter is higher than your threshold.

 - Peter



Peter / George, thanks for the input. 

I'm not sure I can use session counting, as my
session size is not consistent. I could try to estimate 
the size of each session, and keep a global counter,
but that seems like a lot of work. 

I understand that garbage collection is, err, whimsical, 
but I think I'm going to give it a go anyway.
I will keep in mind that the memory results
from Runtime will probably under-report the
available memory. I'm going to add an explicit
request for garbage collection, _before_ the memory 
becomes seriously depleted. 

Thanks for the suggestions!


  

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: problems with mod_proxy (apache 2.2.9) and tomcat ajp connector (6.0.18)

2009-05-12 Thread Michael Biebl
2009/5/12 André Warnier a...@ice-sa.com:
 Michael Biebl wrote:

 ...
      ProxyRequests Off
      ProxyVia On
      ProxyPass /t/ ajp://localhost:8009/barcooServer/t/
      ProxyPass /ws/ ajp://localhost:8009/barcooServer/ws/
      ProxyPass /reports/ ajp://localhost:8009/barcooServer/reports/
      ProxyPass / ajp://localhost:8009/barcooWebsite/
      ProxyPassReverse / ajp://localhost:8009/barcooWebsite/
      ProxyPassReverseCookiePath /barcooWebsite /
 ...


 As you can see, I have 4 ProxyPass directives. Does that mean that I
 will get 4 ajp connections from apache to tomcat per user request, ie.
 if say 200 users are online I have 800 connections open?

 I don't think so.  I assume the first matching one will immediately cause
 the proxying to happen for this request.

 Is it correct, that apache uses ipv6 for the ajp connection (as the
 log is talking about tcpv6)?

 Dunno.  I presume that this is because port 8009 is just by default opened
 as IPv6.  Though since that whole area is not very clear to me yet, I may be
 talking nonsense here.

 And it is not Tomcat complaining, it is some other system component that
 writes to kernel.log.

 I know, it's the kernel that is dropping the connections.

 So, /what/ in the kernel is dropping connections, and after how many
 connections ?
 I mean, if it is 5000 connections, that thing may be right, but maybe this
 limit is set ridicuously low.

Does anyone know, what the actual kernel limits are? Is that an
absolute number or connection attempts / per timeframe?
Is there a way to tweak this settings (e.g. via sysctl)?


 I'm wondering if there is  a limit of open ajp connections?

 There is obvously a limit set by /something/ as to the number of requests
 for *new* connections to port 8009 within a certain timeframe.

 I run a numer of Linux Debian systems, some of them Lenny.  I have never
 seen this message before.
 My systems use mod_jk as a connector though, not mod_proxy_ajp.

 So maybe you should try mod_jk for a while ?  If the problem suddenly
 disappears, then at least you've got a clue.

 You should also re-read Rainer's answer.  He's THE mod_jk expert on this
 forum.

I somehow had the impression from reading docs and tutorial on the
web, that mod_proxy_ajp is favored nowadays over mod_jk.
(being more actively developed, more flexible and easier to integrate
into apache)

Is that impression wrong?


 What about this :

 Other than that, is there any log facility available in mod_proxy_ajp,
 which
 you could set to debug for a while to see what is really going on from
 that side ?

 It would be interesting to know how many connections mod_ajp *tries* to
 create.

I'll try to get more solid numbers.

Thanks for the hints so far,

Michael


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Preventing OutOfMemoryError: Java heap space

2009-05-12 Thread André Warnier

Todd Hivnor wrote:

From: Todd Hivnor [spambox_98...@yahoo.com]



I would like to proactively avoid running out of heap
space. I would like people get a Server Too Busy
message, _before_ the heap is actually exhausted.
I would rather serve 40 users well than 45 users
poorly.



Rather than monitor memory, which is subject to GC
whims as George points out, I'd suggest monitoring 
the number of sessions in your  application - find a 
number of sessions you can live with, keep a (suitably 
synchronized) counter that's incremented and decremented 
as  sessions are created and destroyed, and don't start

new sessions if that counter is higher than your threshold.



- Peter




Peter / George, thanks for the input. 


I'm not sure I can use session counting, as my
session size is not consistent. I could try to estimate 
the size of each session, and keep a global counter,
but that seems like a lot of work. 

I understand that garbage collection is, err, whimsical, 
but I think I'm going to give it a go anyway.

I will keep in mind that the memory results
from Runtime will probably under-report the
available memory. I'm going to add an explicit
request for garbage collection, _before_ the memory 
becomes seriously depleted. 


Thanks for the suggestions!

Sorry for jumping in as a naive and frankly incompetent java and Tomcat 
programmer, and do not feel obliged to respond if the question is really 
stupid.
But would it not be easier to catch the OOM exception and then return a 
sorry, server overloaded page to the browser ?

(and maybe then also trigger a GC just for tidiness)

Or a more ambitious scheme : at Tomcat startup, a thread is created 
which immediately allocates some largish object and keeps it.  Then this 
thread starts listening for OOM exceptions (I just imagine that this can 
be done).  When one occurs, the thread releases the object and triggers 
a GC.  Then it tries to allocate the object again.  Then.. I'm running 
out of ideas and technique.  It was just a thought, in the direction of 
making GC a bit more deterministic.


(I would mischievously also add a suggestion to buy some more RAM, as an 
even cheaper alternative).


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: problems with mod_proxy (apache 2.2.9) and tomcat ajp connector (6.0.18)

2009-05-12 Thread André Warnier

No need to copy me personally, I also get the list.

Michael Biebl wrote:
...


Does anyone know, what the actual kernel limits are? Is that an
absolute number or connection attempts / per timeframe?
Is there a way to tweak this settings (e.g. via sysctl)?


There I believe you are starting to ask the right questions..
I've asked my own private Debian expert, but he hasn't deigned answering 
yet.




I somehow had the impression from reading docs and tutorial on the
web, that mod_proxy_ajp is favored nowadays over mod_jk.
(being more actively developed, more flexible and easier to integrate
into apache)

Is that impression wrong?


I'll paraphrase something in some previous post on this list :
I'm now selling hard hats and flak jackets.

Seriously,
I have never used mod_proxy_ajp so I cannot really comment on it.
I have however been using mod_jk for a long time, I am quite satisfied 
of it, and have never seen the type of kernel message you mention.


It is being said, very politely and not by me, that mod_jk has a lot 
more mileage behind it than mod_proxy_ajp, and that consequently mod_jk 
may be more stable than mod_proxy_ajp which, maybe, despite its rapid 
improvement in recent versions, still may have some teething problems to 
work through.

This is purely hearsay and speculative, you understand ?



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Unable to serialize delta request for sessionid [Tomcat 6.0.16 and jdk1.6.0_04]

2009-05-12 Thread athal berth
Hello everyone:

Unable to serialize delta request for sessionid [Tomcat 6.0.16 and
jdk1.6.0_04]

I have a Java Application running under Tomcat 6.0.16 [JDK 1.6.0_04]on Red
Hat Enterprise Linux Server release 5.1.

The application run apparently good but when i look in the catalina.out i
see this:

May 12, 2009 8:54:55 PM org.apache.catalina.ha.session.DeltaManager
requestCompleted
SEVERE: Unable to serialize delta request for sessionid
[BEA32BA6C7D1ACD5E326589AA08C90B8.jvmroute-1]
java.io.NotSerializableException: mx.org.FIA.sij.util.ligas.LigasGraficas
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at
org.apache.catalina.ha.session.DeltaRequest$AttributeInfo.writeExternal(DeltaRequest.java:374)
at
org.apache.catalina.ha.session.DeltaRequest.writeExternal(DeltaRequest.java:272)
at
org.apache.catalina.ha.session.DeltaRequest.serialize(DeltaRequest.java:287)
at
org.apache.catalina.ha.session.DeltaManager.serializeDeltaRequest(DeltaManager.java:633)
at
org.apache.catalina.ha.session.DeltaManager.requestCompleted(DeltaManager.java:1108)
at
org.apache.catalina.ha.tcp.ReplicationValve.send(ReplicationValve.java:548)
at
org.apache.catalina.ha.tcp.ReplicationValve.sendMessage(ReplicationValve.java:535)
at
org.apache.catalina.ha.tcp.ReplicationValve.sendSessionReplicationMessage(ReplicationValve.java:517)
at
org.apache.catalina.ha.tcp.ReplicationValve.sendReplicationMessage(ReplicationValve.java:428)
at
org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:362)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)

More descriptions:
WAR
sij2009.war
/usr/local/TOMCAT/conf/Catalina/localhost
sij2009.xml
Context docBase=sij path=/sij crossContext=true
Environment name=proxy/bpType type=java.lang.String value=/

/usr/local/TOMCAT/webapps/sij2009/WEB-INF
web-app
display-nameTEST/display-name
distributable/
description
 Test
/description

The application run in a cluster and when i start Tomcat each node sees the
other

I dont know if the problem is my configuration or the application, anyone
can help me.
Thnks in advanced
Regards.


RE: Preventing OutOfMemoryError: Java heap space

2009-05-12 Thread Caldarale, Charles R
 From: André Warnier [mailto:a...@ice-sa.com]
 Subject: Re: Preventing OutOfMemoryError: Java heap space
 
  I'm going to add an explicit request for garbage 
  collection, _before_ the memory becomes seriously
  depleted.

To the OP: explicitly calling GC is a complete waste of time.  You have to do 
something to free up memory by shutting down sessions or otherwise terminating 
activity within the JVM.  Your calling GC won't accomplish anything that the 
JVM automatically calling GC doesn't do.

 But would it not be easier to catch the OOM exception and then 
 return a sorry, server overloaded page to the browser ?

It's difficult to do that when the OOME may occur in Tomcat code, outside of 
control of the webapp.

 (and maybe then also trigger a GC just for tidiness)

Again, a waste of time - the OOME is not presented until after a major GC has 
been attempted.

 Then this thread starts listening for OOM exceptions (I just 
 imagine that this can be done).

I don't know of any means to do that.

 (I would mischievously also add a suggestion to buy some more RAM,
 as an even cheaper alternative).

That's the only reasonable solution, if the OP is unwilling to implement the 
throttling Peter suggested.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat not closing threads

2009-05-12 Thread Caldarale, Charles R
 From: Chetan Chheda [mailto:chetan_chh...@yahoo.com]
 Subject: Re: Tomcat not closing threads
 
 I managed to get a thread dump during one such tomcat hangs. Most of
 the threads are in the following status ...

The ones you show are simply waiting for input from httpd; that's a pretty 
normal state.  When looking at a thread dump, it's often the oddball thread 
that's not doing what the rest are that is causing a problem.  However, if all 
of the threads are just waiting to receive something from httpd, then you may 
have to look outside of Tomcat for the cause.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Unable to serialize delta request for sessionid [Tomcat 6.0.16 and jdk1.6.0_04]

2009-05-12 Thread Caldarale, Charles R
 From: athal berth [mailto:athal.be...@gmail.com]
 Subject: Unable to serialize delta request for sessionid [Tomcat 6.0.16
 and jdk1.6.0_04]
 
 java.io.NotSerializableException:
 mx.org.FIA.sij.util.ligas.LigasGraficas
 
 I dont know if the problem is my configuration or the application,

It's the application.  You've put an object of type 
mx.org.FIA.sij.util.ligas.LigasGraficas into the session; however, that type is 
not serializable, so it cannot be transmitted to the other nodes.  You need to 
do whatever it takes to make that class serializable, or avoid adding it to the 
session.  Sometimes all you need is to add implements Serializable to the 
class definition.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Preventing OutOfMemoryError: Java heap space

2009-05-12 Thread Todd Hivnor

 But would it not be easier to catch the OOM exception and then
 return a sorry, server overloaded page to the browser ?

 It's difficult to do that when the OOME may occur in Tomcat code, 
 outside of control of the webapp.

Wow I had assumed I could always catch this type of exception. 
Thanks for clarifying.

In any case, tho, I specifically don't want the OOME exception to occur, 
largely because it takes so much _time_ to occur. In my tests, as the RAM 
becomes depleted, the server response becomes slower and slower. 
The actual OOME takes over a minute to appear. Apparently the JVM 
is making a heroic effort to satisfy the request.

 (I would mischievously also add a suggestion to buy some more RAM,
 as an even cheaper alternative).

That's the only reasonable solution, if the OP is unwilling to 
 implement the throttling Peter suggested.

Yes of course I can throw more RAM at the problem. 
But I would still like to have a graceful response to the 
overloaded scenario. More RAM is just delaying the
problem. 

I was hoping there was a simple solution I had overlooked.

One challenge with Peter's suggestion of tracking the
number of sessions myself is that I have a collection
of webapps. So I can't just set up a shared static counter;
I need a counter which works across multiple webapps.
The only way I know to do that is to use a text file, 
and take care about locking the file before updating it.
Or perhaps I can use ServletContext.

Overall session counting sounds like my best option.

Again, thanks for all the clues  suggestions. 


  

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Form Based Authentication creates user session before it is authenticated?

2009-05-12 Thread umeshkavade

No, you'd have to write your own authentication mechanism. Tomcat is
required to store the request that triggered authentication for re-play
after a successful authentication. If not the request, where else should
it be stored?

Christopher, thanks for the reply.

This is inline with my analysis.

Actually, I am trying to address 'Session Fixation' issue in my web
application. I saw your reply on thread
http://www.nabble.com/How-to-avoid-session-fixation--td15311806.html.

In one of the reply you gave following suggestion to address the issue:

- a custom valve contains the whole implementation 
- requests to the servlet/URI j_security_check are intercepted 
- for intercepted requests the current session is destroyed 
  and a new one is created: 

  -- snip -- 
  ... 
  request.getSession().invalidate(); 
  request.getSession(true); 
  ... 
  -- snap -- 

- to have a proper redirect to the originally requested page 
  the original request has to be copied from the old session 
  to the new one. 
  I filter out any references to the old session id, although I'm 
  not sure whether this is really necessary. 

I think, this would solve my problem. The only blocker for me is step:
requests to the servlet/URI j_security_check are intercepted. I did not
get good info on google which would teach me how I can do this.

Pointers on this would be of great help.

Thanks,
Umesh

P.S: BTW, is Tomcat planning to resolve this vulnerability in near future?


-- 
View this message in context: 
http://www.nabble.com/Form-Based-Authentication-creates-user-session-before-it-is-authenticated--tp23455945p23515249.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Form Based Authentication creates user session before it is authenticated?

2009-05-12 Thread umeshkavade

Christopher, I got the solution.

Thanks.
Umesh
-- 
View this message in context: 
http://www.nabble.com/Form-Based-Authentication-creates-user-session-before-it-is-authenticated--tp23455945p23515281.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org