missing headers

2024-05-01 Thread Piyush Sharma
Hi,

How to forward custom headers from frontend tomcat to backend tomcat witn
mod_jk?

*Scenario :*

1. APP1 : Apache (mod_jk) + Tomcat
2. APP2 : Apache (mod_jk) + Tomcat

Now, when a user accesses APP1 it add fews headers via SSO app user details
etc..
I can see in Tomcat logs as by adding filters. Now when the request goes to
APP2 (backend Tomcat via Apache), it drops those custom headers. I came to
know that *mod_jk does not use the http protocol to talk to the tomcat
server.* Is there any way to forward all the custom headers from frontend
application to backend applications.

https://stackoverflow.com/questions/18998715/http-response-header-not-coming-with-apache-tomcat-connection-using-mod-jk


Thanks


SPNEGO GSSCaller {UNKNOWN} No Delegated Creds

2024-05-01 Thread Tom Delaney

Tom Delaney has sent you an email via Gmail confidential mode:

[image: Gmail logo]SPNEGO GSSCaller {UNKNOWN} No Delegated Creds 


This message was sent on May 1, 2024 at 12:51:56 PM PDT
You can open it by clicking the link below. This link will only work for 
users@tomcat.apache.org.

View the email 


Gmail confidential mode gives you more control over the messages you send. The 
sender may have chosen to set an expiration time, disable printing or 
forwarding, or track access to this message. Learn more 

Gmail: Email by Google
Use is subject to the Google Privacy Policy 

Google LLC, 1600 Amphitheatre Parkway, Mountain View, CA 94043, USA
You have received this message because someone sent you an email via Gmail 
confidential mode.
[image: Google logo]


Re: Monitoring and Tuning Tomcat

2024-05-01 Thread Christopher Schultz

Mark and Jerry,

On 5/1/24 04:00, Mark Thomas wrote:

On 30/04/2024 21:24, Jerry Malcolm wrote:
I'm trying to optimize my instance, CPU, tuning, and size requirements 
for Tomcat.  It's easy to see CPU usage.  But this TC instance is 
running a lot of microservices that are often in and out fairly 
quickly.  So there can be a huge number of requests coming in.  I'm 
not sure that CPU starving is my biggest concern. I'm more interested 
is getting an understanding of TC front end bottlenecks and also JDBC 
data connection bottlenecks.   So I need a bit of education.   Am I 
correct that maxThreads on the connector throttles the number of 
requests that can come in at one time?


Not quite.

maxThreads is the maximum number of concurrent requests that Tomcat can 
process. This excludes:

- connections in keep-alive
- requests that have entered async mode and have exited the original
   container thread
This includes:
- multiple requests received on a single HTTP/2 connection

The maximum number of connections is controlled by maxConnections.

And connectionTimeout is the time to wait to get in the door if 
threads are maxed out before giving up and failing, correct?


No. It is the maximum time Tomcat will wait from the point the 
connection is accepted to reading the first byte of data.


I'd really like to track total threads in use and then track wait time 
if total threads are maxed out.  Likewise, with database connections.


You can track the status of the thread pool but wait time isn't 
available as Tomcat has no visibility into the accept queue (see 
acceptCount). Your OS might provide some stats here.


  I'd like to monitor the jdbc connection pool as well and see when 
and where the code is having to wait for a db connection and how long 
the average wait is.  I assume there are jms hooks to monitor this?


Correct. You probably want the stats from the o.a.t.u.dbcp.pool2.impl 
package.


But I don't want to reinvent the wheel.  Are there tools out there to 
assist with this already? Thx


Generally, I start with a profiler when looking at questions like this. 
I use YourKit because they given me a free copy to use for Tomcat 
development but there are lots of different profilers available.


There are some good places to look in this monitoring presentation from 
ApacheCon:


https://tomcat.apache.org/presentations.html#latest-monitoring-with-jmx

It's easy to set up periodic monitoring of those various values and then 
use your tool of choice to graph, investigate, etc. how those values 
change over time and possibly correlate.


Tomcat is unlikely to be the bottleneck in any of these cases. You are 
likely to find that your database is the limiting factor. On the other 
hand, if your database is beefy but your JDBC connection pool is limited 
to 10 connections and you have a lot of concurrency, then your database 
is probably sitting idle while your application server has lots of 
waiting requests.


Just be careful about ramping things up on the database side. Not all 
database queries are equal ;)


-chris

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



Re: Monitoring and Tuning Tomcat

2024-05-01 Thread Mark Thomas

On 30/04/2024 21:24, Jerry Malcolm wrote:
I'm trying to optimize my instance, CPU, tuning, and size requirements 
for Tomcat.  It's easy to see CPU usage.  But this TC instance is 
running a lot of microservices that are often in and out fairly 
quickly.  So there can be a huge number of requests coming in.  I'm not 
sure that CPU starving is my biggest concern. I'm more interested is 
getting an understanding of TC front end bottlenecks and also JDBC data 
connection bottlenecks.   So I need a bit of education.   Am I correct 
that maxThreads on the connector throttles the number of requests that 
can come in at one time?


Not quite.

maxThreads is the maximum number of concurrent requests that Tomcat can 
process. This excludes:

- connections in keep-alive
- requests that have entered async mode and have exited the original
  container thread
This includes:
- multiple requests received on a single HTTP/2 connection

The maximum number of connections is controlled by maxConnections.

And connectionTimeout is the time to wait to 
get in the door if threads are maxed out before giving up and failing, 
correct?


No. It is the maximum time Tomcat will wait from the point the 
connection is accepted to reading the first byte of data.


I'd really like to track total threads in use and then track 
wait time if total threads are maxed out.  Likewise, with database 
connections.


You can track the status of the thread pool but wait time isn't 
available as Tomcat has no visibility into the accept queue (see 
acceptCount). Your OS might provide some stats here.


  I'd like to monitor the jdbc connection pool as well and 
see when and where the code is having to wait for a db connection and 
how long the average wait is.  I assume there are jms hooks to monitor 
this?


Correct. You probably want the stats from the o.a.t.u.dbcp.pool2.impl 
package.


But I don't want to reinvent the wheel.  Are there tools out there 
to assist with this already? Thx


Generally, I start with a profiler when looking at questions like this. 
I use YourKit because they given me a free copy to use for Tomcat 
development but there are lots of different profilers available.


Mark

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



Re: Disabling OPTIONS HTTP method with * path

2024-05-01 Thread Mark Thomas

On 30/04/2024 19:56, Oleg Frenkel wrote:

This issue exists in 9.0.88 and 10.1.23.

I am looking to disable the following HTTP request (note 'OPTIONS *' in the 
request):


Why?


Please confirm if this is a bug in Tomcat or if I am missing something in 
Tomcat configuration.


Neither. Tomcat is working as designed.

Mark

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