JAX WS Server performance issue for Linux JVM?

I ran into a very strange problem. The embedded implementation of the JAX WS server runs 100 times slower on Linux machines, and then on Mac OS X or Windows.

I created and shared the JMH test: https://github.com/Andremoniy/linuxjvmjaxwstest

This basically does the following:

  • starts JAX WS with one SOAP method:

    endpoint = Endpoint.publish (" http: // localhost: 8888 / ", new FooServiceImpl ());

  • Fulfills client requests to this method:

    String result = state.client.foo (state.foo);

On Mac OS X with 2 Intel Core i7 cores, it gives me:

# JMH version: 1.19
# VM version: JDK 1.8.0_151, VM 25.151-b12
# VM invoker: /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/bin/java
...
Result "test.openjdk.MyBenchmark.testMethod":
  3077.813 ±(99.9%) 51.818 ops/s [Average]
  (min, avg, max) = (1718.347, 3077.813, 3315.271), stdev = 219.400
  CI (99.9%): [3025.995, 3129.630] (assumes normal distribution)

# Run complete. Total time: 00:06:49

Benchmark                Mode  Cnt     Score    Error  Units
MyBenchmark.testMethod  thrpt  200  3077.813 ± 51.818  ops/s

The same computer, docker without CPU restrictions:

# JMH version: 1.19
# VM version: JDK 1.8.0_151, VM 25.151-b12
# VM invoker: /usr/java/jdk1.8.0_151/jre/bin/java
...
Result "test.openjdk.MyBenchmark.testMethod":
  19.882 ?(99.9%) 0.169 ops/s [Average]
  (min, avg, max) = (10.031, 19.882, 20.104), stdev = 0.715
  CI (99.9%): [19.714, 20.051] (assumes normal distribution)

# Run complete. Total time: 00:07:01

Benchmark                Mode  Cnt   Score   Error  Units
MyBenchmark.testMethod  thrpt  200  19.882 ? 0.169  ops/s

docker openjdk: 8u151, OracleJava. VirtualBox Ubuntu 16.04, AWS EC2 Ubuntu - Linux- ~ 20 ops/s.

Jetty:

    ContextHandlerCollection contextHandlerCollection = new ContextHandlerCollection();
    server.setHandler(contextHandlerCollection);

    JettyHttpServerProvider.setServer(server);
    HttpContext context = new JettyHttpServerProvider().createHttpServer(new InetSocketAddress(8888), 5).createContext("/");

    Endpoint endpoint = Endpoint.create(new MyBenchmark.FooServiceImpl());
    endpoint.publish(context);

    server.start();

Linux . , HTTP- JRE/OpenJDK Linux. - ?

+4
1

Source: https://habr.com/ru/post/1690248/


All Articles