Java EE 8 High Performance
Romain Manni Bucau更新时间:2021-06-30 19:15:07
最新章节:Leave a review - let other readers know what you thinkcoverpage
Title Page
Dedication
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Money – The Quote Manager Application
Setting up the environment
The application architecture
Application project highlights
The build
The persistence layer
The service layer
The JAX-RS layer
The WebSocket layer
Provision some data
Application summary
The application business
The application design
The application server
Testing the application
Get a quote price the JAX-RS way
Get the price the WebSocket way
Setting up MySQL
Conclusion
Summary
Looking Under the Cover – What is This EE Thing?
Context and Dependency Injection – what did you do to my beans?
IoC – a pretty simple example
The main features of CDI
Injections
Scopes
Interceptors/decorators
Events
Dynamic lookups
JAX-RS – the servlet router
The router
Marshalling
Filter and interceptors
@Suspended or asynchronous operation
JPA – the database link
From JPA to the database
Model and implications
The Java Transaction API
Server resources
DataSource configuration
Java EE and performances
Ensure you know the server
Ensure you know your application
Ensure you know your resources
Summary
Monitor Your Application
Java tools to know what my application is doing
The jcmd command – the small command line utility that does a lot
Thread.print
Memory
JVisualVM – the UI for JVM monitoring
How to connect remotely
Java Mission Control
GlassFish ad hoc monitoring
Libraries monitor your application
Counters gauges timers and more
Instrumenting the code
CDI instrumentation
Implementing your own configurable monitoring interceptor
Javaagent – a complex but powerful instrumentation
Sirona javaagent
SQL Monitoring
Data aggregation
Tracing
APM
Summary
Application Optimization – Memory Management and Server Configuration
Java and the memory
Garbage collector
Garbage collector algorithms
The serial collector
Parallel and parallel compacting collectors
Concurrent Mark Sweep (CMS)
Garbage First (G1)
Common memory settings
Debugging GC behavior
Heap dump
Java EE and the resources
DataSource
Java EE and pools
Java EE and HTTP pools
Java EE implicit features
Summary
Scale Up – Threading and Implications
Java EE threading model
Thread data and consistency
Concurrent data access
Java and thread safety
Synchronized
Locks
java.util.concurrent
The volatile data
Java EE and threads
CDI asynchronous events
EJB @Asynchronous
EE concurrency utilities for Java EE
ManagedExecutorService
ManagedScheduledExecutorService
Java EE threads
ContextService
EJB @Lock
HTTP threads
Server side
Client side
Reactive programming and Java EE
Message passing and Java EE
Summary
Be Lazy; Cache Your Data
Caching challenges
How does the cache work?
The cache key
Eviction policy
Least Recently Used (LRU)
First In First Out (FIFO)
Random
Least Frequently Used (LFU)
Cache eviction trigger
Cache storage – memory or not
Consistency of the data
HTTP and caching
Cache-Control
ETag
Vary
HTTP caching and the Java EE API
HTTP 2 promise
JCache – the standard cache of Java EE
Setting up JCache
Programmatic API
JCache configuration
CDI integration
Cache configuration
@CacheDefaults
Cache key
Cache once
Summary
Be Fault-Tolerant
It will fail no doubt!
Load balancing – pick the best one
Transparent load balancing – client versus server
Common strategies
The round-robin algorithm
Random load balancing
Link to failover
Sticky session
The scheduling algorithm
Load balancing or proxy – additional features
Failover
Switching to another system
Local fallback
Fallback code structure
Microprofile to the rescue
Failover extension
Fallback handling – caching an alternative solution
Circuit breaker
Bulk head
Timeouts
Timeouts for code without timeouts
Summary
Loggers and Performances – A Trade-Off
I log you log they log
Logging frameworks and concepts
Logger
Logger Factory
LogRecord
Handler
Filter
Formatter
Level
Logging invocations
Filters
Formatters
Using handlers
Logging components and Java EE
Logging patterns
Testing your level
Using templates in your messages
Asynchronous or not?
Logging implementations – which one to pick
Logging facade – the good bad idea
Logging frameworks
Log4j
Log4j2
Logback
JUL
Choosing an implementation
Summary
Benchmarking Your Application
Benchmarking – validating your application against your SLA
Benchmark benchmark benchmark
Preparing your benchmark
Defining the benchmark criteria
Defining the metric
Defining acceptance criteria
Defining the scenario
Defining the environment
The machines
The network
Databases and remote services
The server
Automatize your scenarios
JMeter
Gatling
Other tools
Ensuring you have support
Time boxing your optimization benchmark
Installing and resetting procedures
Benchmark iterations
Iterating
Changing a single setting at a time
Resetting any state between runs
Warming up your system
After your benchmark
Writing a report
Updating your default configurations
Reviewing the conclusions
Enriching your project backlog
Summary
Continuous Performance Evaluation
Writing performance tests – the pitfalls
Writing performance tests
JMH – the OpenJDK tool
Writing a benchmark with JMH
The state
Creating your first JMH benchmark
BlackHole to be a star
Running the benchmarks
Integrating JMH with JUnit
ContiPerf
Arquillian and ContiPerf – the diabolic pair
JMeter and build integration
Gatling and continuous integration
Deploying your (benchmark) application
Continuous integration platform and performance
Summary
Another Book You May Enjoy
Leave a review - let other readers know what you think
更新时间:2021-06-30 19:15:07