Few notes on the JMX-enabled ThreadPool effort.
The goal is to see what the pool and each thread is doing - and maybe stop hunged threads.
First, the thread pool itself should provide basic info - how many thread are active, how many threads died. Changing parameters ( increasing maxthreads ) at runtime is tricky - we avoid sync for performance, so we'll probably need to create a new array and switch.
The second issue is information about what's each thread doing. Currently I'm using ThreadWithAttributes - so we can just cast and have O(1) access to attributes. I already changed Http and Jk connectors to provide info about the stage and current request. I implemented the changes - seems ok, but need to cleanup before committing it.
One issue is security. Right now a guard is used ( the ThreadPool for now ), and only components that have access to it can read/write. JMX policy protection will be vital - and we need to find ways to protect if the SecurityManager is not enabled. With the current code, if user code gets access to JMX it can see what
all other threads are doing - a problem for web hosting environments.
Update:
Done. You can use it with any tomcat version ( if j-t-c is built from HEAD ). The name is "DOMAIN:type=ThreadPool,worker=http,name=http%8080" and
"DOMAIN:type=ThreadPool,worker=jk,name=0.0.0.0%8009" ( the local part needs cleanup ).
What is available is the string version (threadStatusString) and 2 String[] with the
current status ( parsing, service, ended, etc ) and last request. More info is collected per request, in RequestProcessors object ( bytes sent, etc ).
Since we may have a lot of threads, there is a single manageable object that controls all threads in a pool ( corresponding to the ThreadPoolMX )
Open issue: should we treat "status" as pure informative and let servlets set it ? Long running servlets could provide some debugging info.
Technical stuff
Friday, January 10, 2003
JMX support in ThreadPool
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2003
(44)
-
▼
January
(23)
- Authorization and security
- Kde3.1 on RedHat 8
- Java security
- Tahoe
- JMX-enable a bean in 3 easy steps
- TLD listeners and context initialization
- int[] versus Integer or IntHolder
- Weblog and wiki
- Load balancing in jk
- Configurable TagPool in 50
- It's already done - nntp/rss gateway
- Using context params or JNDI for configuration
- SingleThreadedModel may be usefull
- Precompile the JSPs
- Classloader fun with JDK1.4
- More JMX in tomcat5
- Extension points in tomcat5
- UserDatabase needs changes
- Ser2xml
- Starting to "blog"
- Ant: delayed task creation
- import in ant
- JMX support in ThreadPool
-
▼
January
(23)
No comments:
Post a Comment