/java-perf-workshop

Guided walkthrough to understand the performance aspects of a Java web service

Primary LanguageJavaApache License 2.0Apache-2.0

Java Performance Workshop

A tutorial workshop that will dive in understanding "what's going on in your JVM".

This workshop has the following components:

  • Part 1: Basics with OS, processes, and thread
  • Part 2: Java Mission Control and Flight Recorder
  • Part 3: Advanced Flight Recorder
  • Part 4: Java Heap Analysis
  • Part 5: Garbage Collections

This workshop is utilizing a basic web service that is included, which isn't exactly optimal in how it performs. The goal is to use this service as an interactive example and identify its poor performing elements. To learn more about this web service that is included, see the following notes.

Service

The web service is a simple dropwizard server, which has a single API to search for talks from kcdc.info, and returns results about these talks.

Running

Assemble the service:

mvn clean package

Start the service:

java -jar java-perf-workshop-server/target/java-perf-workshop-server-1.0-SNAPSHOT.jar server server.yml

Configuration

Example configuration of service:

server:
  applicationConnectors:
    - type: http
      port: 80
  adminConnectors:
    - type: http
      port: 8071
  requestLog:
    timeZone: UTC
    appenders:
      - type: file
        currentLogFilename: /var/log/java-perf-workshop-server-access.log
        threshold: ALL
        archive: true
        archivedLogFilenamePattern: /var/log/java-perf-workshop-server-access.%d.log.gz
        archivedFileCount: 5
logging:
  level: INFO
  appenders:
    - type: file
      currentLogFilename: /var/log/java-perf-workshop-server.log
      threshold: ALL
      archive: true
      archivedLogFilenamePattern: /var/log/java-perf-workshop-server-%d.log
      archivedFileCount: 5
      timeZone: UTC

Testing

The service will return back results from the KCDC website on sessions that are available which contain a substring in their title, abstract, or tags. Example:

http://localhost:8080/search?q=clojure

Example results:

{
  "results" : [ {
    "title" : "Concurrency Options on the JVM",
    "presenter" : "Jessica Kerr"
  }, {
    "title" : "Fast, Parallel, or Reliable: Pick 3, a tour of Elixir",
    "presenter" : "Jordan Day"
  } ]
}

Reference