万本电子书0元读

万本电子书0元读

顶部广告

Java EE 8 High Performance电子书

售       价:¥

4人正在读 | 0人评论 9.8

作       者:Romain Manni-Bucau

出  版  社:Packt Publishing

出版时间:2018-01-30

字       数:48.0万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Get more control of your applications performances in development and production and know how to meet your Service Level Agreement on critical microservices. About This Book ? Learn how to write a JavaEE application with performance constraints (Service Level Agreement—SLA) leveraging the platform ? Learn how to identify bottlenecks and hotspots in your application to fix them ? Ensure that you are able to continuously control your performance in production and during development Who This Book Is For If you're a Java developer looking to improve the performance of your code or simply wanting to take your skills up to the next level, then this book is perfect for you. What You Will Learn ? Identify performance bottlenecks in an application ? Locate application hotspots using performance tools ? Understand the work done under the hood by EE containers and its impact on performance ? Identify common patterns to integrate with Java EE applications ? Implement transparent caching on your applications ? Extract more information from your applications using Java EE without modifying existing code ? Ensure constant performance and eliminate regression In Detail The ease with which we write applications has been increasing, but with this comes the need to address their performance. A balancing act between easily implementing complex applications and keeping their performance optimal is a present-day need. In this book, we explore how to achieve this crucial balance while developing and deploying applications with Java EE 8. The book starts by analyzing various Java EE specifications to identify those potentially affecting performance adversely. Then, we move on to monitoring techniques that enable us to identify performance bottlenecks and optimize performance metrics. Next, we look at techniques that help us achieve high performance: memory optimization, concurrency, multi-threading, scaling, and caching. We also look at fault tolerance solutions and the importance of logging. Lastly, you will learn to benchmark your application and also implement solutions for continuous performance evaluation. By the end of the book, you will have gained insights into various techniques and solutions that will help create high-performance applications in the Java EE 8 environment. Style and approach This book will cover vital concepts implemented through a sample application built throughout the book. This will enable you to apply these concepts to suit your software requirements.
目录展开

Title Page

Copyright and Credits

Java EE 8 High Performance

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

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部