path | title |
---|---|
/learnings/ops_java_spring |
Learnings: Ops: Java: Spring |
See also:
- Spring_Actuators (includes more complete list)
but here's ops scenarios you're probably running into...
See: Learning_Ops_Java_JMX_HTTP_Solution_Jolokia
/jolokia
<--- automatically there for Spring WebMVC or Jersey apps. If not then you can add it (see link)
See also:
POST a partial entry (or null, meaning reset) to /loggers
this means you can increase log level to debug to temporarily debug an issue, then set it back when you're done!!!
Supported JMX Metrics sent to metrics registries. Sends:
- memory and buffer pools
- GC stats
- thread utilization
- number of classes loaded / unloaded
^^^^^ Note: some breaking changes around here in Spring Boot 2.0
/metrics
can be used to examine metrics collected.
/actuator/metrics/jvm.memory.max?tag=area:nonheap
/heapdump
<-- outputs it in hprof
output format
/dump
<-- outputs it in json format
See also:
Q: How many threads does Tomcat create by default for a Spring Boot App? A: 200 by default, controlled by server.tomcat.max-thread (do a Find in that page...)
- Spring_Actuators_Health
Tomcat provides the following features:
- HTTP Sessions. See some example code about using that directly
- A thread pool for handling connections
- A threadpool for JDBC connections in case your client connections need the database
- A cache for things??
- code
- responses?????
Tomcat is a:
- standalone server you can run .wars in
- embedded server Spring Boot can use
Acceptor thread -> worker thread pool -> worker thread. Worker thread reads data from connection, does the thing and responds. Source.
See Learning_Ops_Java_Spring_Tomcat_Set_Thread
some information about when the aggregated metrics are updated
Published metrics from Tomcat.
Useful metrics from Spring Boot 2.0:
- tomcat.threads.busy <-- busy threads
- tomcat.threads.current <-- busy + free threads
- tomcat.threads.config.max <-- point where thread exhaustion happens. (See below)
Good explanation here at source
How to set tomcat.threads.config.max
: see Learning_Ops_Java_Spring_Tomcat_Set_Threads
GOTCHA when running not embedde Tomcat: make sure you are running > 1.0.7 of micrometer metrics to avoid this bug.