Giter VIP home page Giter VIP logo

go-java-go's Introduction

Java vs Go load test

This repository contains the Java (JAX-RS and Helidon) and Go implementation of a tiny microservice.

The service provides the following endpoints:

  • /uppercase converts the input string s to uppercase
  • /count returns the length of the input string s
  • /metrics returns Prometheus formatted metrics for the runtime and application metrics

Load test

Set JMETER_HOME enviroment variable to the JMeter installation directory. Set GRAALVM_HOME environment variable to the GraalVM installation.

Set the desired JAVA_HOME. Java implementation requires JDK11+.

Scripts are written and tested using MacOS.

Go

Use the run-go-tests.sh script which builds, runs the microservices application and JMeter. Parameters:

  1. logging|no-logging (mandatory): Switching log level between INFO (logging) and ERROR (no-logging). This option is introduced because logging can cause significant performance degradation.
  2. warmup (optional): 1000 "warm up" calls before the load test.

For example:

run-go-tests.sh no-logging warmup

Console log contains information about RSS memory size. Before the warmup, before the load test and at the end of the load test.

Java (Helidon implementation)

Use the run-helidon-tests.sh script which builds, runs the microservices application and JMeter. Parameters are the following:

  1. logging|no-logging (mandatory): Switching log level between INFO (logging) and ERROR (no-logging). This option is introduced because logging can cause significant performance degradation.
  2. warmup|no-warmup (mandatory): 1000 "warm up" calls before the load test.
  3. nmt|no-nmt (mandatory): Native Memory Tracking to get details about Java/JVM memory usage. Note that enabling this will cause 5-10% performance overhead.
  4. Xms/Xmx (mandatory): The initial and minimum Java heap size in MB. Both will get the same value.
  5. javaopts (optional): Additional JVM options e.g. -XX:+UseG1GC

For example:

run-helidon-tests.sh no-logging warmup no-nmt 32

In case of Native Memory Tracking console log contains initial memory snapshot and increment at the end of the load test.

For the record the script saves the available and selected/used JDK version into a java.version.txt in the corresponding test-result folder.

Native Image (Helidon implementation compiled with Graal Native Image)

Use the run-nativeimage-tests.sh script which builds, runs the microservices application and JMeter. Parameters are the following:

  1. logging|no-logging (mandatory): Switching log level between INFO (logging) and ERROR (no-logging). This option is introduced because logging can cause significant performance degradation.
  2. warmup|no-warmup (mandatory): 1000 "warm up" calls before the load test.
  3. nobuild (optional): Skip Native Image build which can take a lot of time. In this case trying to use previously built executable binary.

For example:

run-nativeimage-tests.sh no-logging warmup

Console log contains information about RSS memory size. Before the warmup, before the load test and at the end of the load test.

Test results

After the successful run the test results available in the test-results folder.

go-java-go's People

Contributors

markxnelson avatar nagypeter avatar tomas-langer avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.