java-perf-workshop icon indicating copy to clipboard operation
java-perf-workshop copied to clipboard

Update workshop to include containers

Open cchesser opened this issue 5 years ago • 3 comments

It is common where Java workloads are within a Linux container, and they aren't aware of all the sizing that can occur which feeds into the overall container size. Furthermore, using some of the available tooling requires making adaptations to use these and connect it to the container.

  • Provide prerequisite for running the service workload as a container locally (ex. Docker)
  • Simulate an example: OutOfMemoryError: Unable to create native thread
  • Share common tooling to understand to inspect contents of the container to understand the Java process and OS resource usage
  • Share differences and JVM options to acknowledge, like Metaspace limits (diff from PermGen -> Metaspace where it is unlimited by default). Also share documentation on what influences this (classloading).

cchesser avatar Dec 09 '20 22:12 cchesser

Share common tooling to understand to inspect contents of the container to understand the Java process and OS resource usage

@cchesser is there any opensource tooling you use besides the provided Docker Dashboard ?

AnEmortalKid avatar Mar 21 '21 17:03 AnEmortalKid

Yeah, it may be good to highlight memory settings that previously would spend time calculating with approaches like in java-buildpack-memory-calculator but that can be minimized with many of the JVM improvements since Java 8u191+ that auto-calculates this limits based on cgroup limitations being set.

Another tool which can be used to then look at the image to then make sense of its composition is dive. This could be used if we want to highlight the latency of container spin-ups that can be optimized with Class Data Sharing, which could show how to including the jsa file via -XX:SharedArchiveFile=.

cchesser avatar Mar 22 '21 03:03 cchesser

I'm going to close this out as a result of #48. Will create a new one for the Docker setup, which currently refers to Docker's documentation that will use Docker Desktop (which will no longer be available for free use).

cchesser avatar Sep 04 '21 19:09 cchesser