Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-1000

java.util.Hashtable limits the throughput of org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Works as Designed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Core
    • Labels:

      Description

      org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive uses java.util.Hashtable.get(Object) implementation to the get url stream handler for marshaling.

      This HashTable implementation is known to be quite poor in terms of performance in a highly concurrent environment. Latency/throughput of the implementing application can be found below.

      E2ELatency.png

      I'm attaching the JFR stack trace of the related calls, showing contention. This increases as the concurrency increases.

      Contention.png

      "Stack Trace";"Count";"Duration"
      "java.util.Hashtable.get(Object)";"1,903";"11,916,392,176"
      "   java.net.URL.getURLStreamHandler(String)";"1,903";"11,916,392,176"
      "      java.net.URL.<init>(URL, String, URLStreamHandler)";"1,903";"11,916,392,176"
      "         java.net.URL.<init>(URL, String)";"1,903";"11,916,392,176"
      "            java.net.URL.<init>(String)";"1,903";"11,916,392,176"
      "               java.net.JarURLConnection.parseSpecs(URL)";"1,903";"11,916,392,176"
      "                  java.net.JarURLConnection.<init>(URL)";"1,903";"11,916,392,176"
      "                     org.springframework.boot.loader.jar.JarURLConnection.<init>(URL, JarFile, JarURLConnection$JarEntryName)";"1,903";"11,916,392,176"
      "                        org.springframework.boot.loader.jar.JarURLConnection.get(URL, JarFile)";"1,903";"11,916,392,176"
      "                           org.springframework.boot.loader.jar.Handler.openConnection(URL)";"1,903";"11,916,392,176"
      "                              java.net.URL.openConnection()";"1,903";"11,916,392,176"
      "                                 sun.misc.URLClassPath$Loader.findResource(String, boolean)";"1,903";"11,916,392,176"
      "                                    sun.misc.URLClassPath$1.next()";"1,903";"11,916,392,176"
      "                                       sun.misc.URLClassPath$1.hasMoreElements()";"1,903";"11,916,392,176"
      "                                          java.net.URLClassLoader$3$1.run()";"1,903";"11,916,392,176"
      "                                             java.net.URLClassLoader$3$1.run()";"1,903";"11,916,392,176"
      "                                                java.security.AccessController.doPrivileged(PrivilegedAction, AccessControlContext)";"1,903";"11,916,392,176"
      "                                                   java.net.URLClassLoader$3.next()";"1,903";"11,916,392,176"
      "                                                      java.net.URLClassLoader$3.hasMoreElements()";"1,903";"11,916,392,176"
      "                                                         sun.misc.CompoundEnumeration.next()";"1,903";"11,916,392,176"
      "                                                            sun.misc.CompoundEnumeration.hasMoreElements()";"1,903";"11,916,392,176"
      "                                                               sun.misc.CompoundEnumeration.next()";"1,903";"11,916,392,176"
      "                                                                  sun.misc.CompoundEnumeration.hasMoreElements()";"1,903";"11,916,392,176"
      "                                                                     java.util.ServiceLoader$LazyIterator.hasNextService()";"1,903";"11,916,392,176"
      "                                                                        java.util.ServiceLoader$LazyIterator.hasNext()";"1,903";"11,916,392,176"
      "                                                                           java.util.ServiceLoader$1.hasNext()";"1,903";"11,916,392,176"
      "                                                                              javax.xml.transform.FactoryFinder$1.run()";"1,795";"11,303,335,460"
      "                                                                                 java.security.AccessController.doPrivileged(PrivilegedAction)";"1,795";"11,303,335,460"
      "                                                                                    javax.xml.transform.FactoryFinder.findServiceProvider(Class)";"1,795";"11,303,335,460"
      "                                                                                       javax.xml.transform.FactoryFinder.find(Class, String)";"1,795";"11,303,335,460"
      "                                                                                          javax.xml.transform.TransformerFactory.newInstance()";"1,795";"11,303,335,460"
      "                                                                                             com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer.<init>()";"1,795";"11,303,335,460"
      "                                                                                                com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer.newTransformer()";"1,795";"11,303,335,460"
      "                                                                                                   com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl.output(OutputStream)";"1,701";"10,734,490,000"
      "                                                                                                      com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl.output(OutputStream, boolean)";"1,701";"10,734,490,000"
      "                                                                                                         com.sun.xml.internal.messaging.saaj.soap.SOAPPartImpl.getContentAsStream()";"1,701";"10,734,490,000"
      "                                                                                                            com.sun.xml.internal.messaging.saaj.soap.MessageImpl.getHeaderBytes()";"1,701";"10,734,490,000"
      "                                                                                                               com.sun.xml.internal.messaging.saaj.soap.MessageImpl.saveChanges()";"1,701";"10,734,490,000"
      "                                                                                                                  org.springframework.ws.soap.saaj.SaajSoapMessage.writeTo(OutputStream)";"1,701";"10,734,490,000"
      "                                                                                                                     org.springframework.ws.transport.AbstractWebServiceConnection.send(WebServiceMessage)";"1,701";"10,734,490,000"
      "                                                                                                                        org.springframework.ws.client.core.WebServiceTemplate.sendRequest(WebServiceConnection, WebServiceMessage)";"1,701";"10,734,490,000"
      "                                                                                                                           org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(MessageContext, WebServiceConnection, WebServiceMessageCallback, WebServiceMessageExtractor)";"1,701";"10,734,490,000"
      "                                                                                                                              org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(String, WebServiceMessageCallback, WebServiceMessageExtractor)";"1,701";"10,734,490,000"
      "                                                                                                                                 org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(String, Object, WebServiceMessageCallback)";"1,701";"10,734,490,000"
      "                                                                                                                                    org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(String, Object)";"1,701";"10,734,490,000"
      "                                                                                                                                       com.hotels.booking.discos.loyalty.client.LoyaltyWebServiceGateway.sendAndReceive(AbstractLoyaltyRequest)";"1,701";"10,734,490,000"
      "                                                                                                                                          com.hotels.booking.discos.loyalty.client.LoyaltyWebServiceGateway.retrieveApplicableRewards(LoyaltyApplicableRewardRetrievalRequest)";"1,660";"10,525,361,114"
      "                                                                                                                                             sun.reflect.GeneratedMethodAccessor216.invoke(Object, Object[])";"1,660";"10,525,361,114"
      "                                                                                                                                                sun.reflect.DelegatingMethodAccessorImpl.invoke(Object, Object[])";"1,660";"10,525,361,114"
      "                                                                                                                                                   java.lang.reflect.Method.invoke(Object, Object[])";"1,660";"10,525,361,114"
      "                                                                                                                                                      com.hotels.thermos.proxy.GenericProxyCircuitBreaker.execute()";"1,660";"10,525,361,114"
      "                                                                                                                                                         com.hotels.thermos.AbstractCircuitBreaker.run()";"1,660";"10,525,361,114"
      "                                                                                                                                                            com.hotels.thermos.HystrixCommandWrapper.run()";"1,660";"10,525,361,114"
      "                                                                                                                                                               com.netflix.hystrix.HystrixCommand$1.call(Subscriber)";"1,660";"10,525,361,114"
      "                                                                                                                                                                  com.netflix.hystrix.HystrixCommand$1.call(Object)";"1,660";"10,525,361,114"
      "                                                                                                                                                                     rx.Observable$2.call(Subscriber)";"1,660";"10,525,361,114"
      "                                                                                                                                                                        rx.Observable$2.call(Object)";"1,660";"10,525,361,114"
      "                                                                                                                                                                           rx.Observable$2.call(Subscriber)";"1,660";"10,525,361,114"
      "                                                                                                                                                                              rx.Observable$2.call(Object)";"1,660";"10,525,361,114"
      "                                                                                                                                                                                 rx.Observable$2.call(Subscriber)";"1,660";"10,525,361,114"
      "                                                                                                                                                                                    rx.Observable$2.call(Object)";"1,660";"10,525,361,114"
      "                                                                                                                                                                                       rx.Observable.unsafeSubscribe(Subscriber)";"1,660";"10,525,361,114"
      "                                                                                                                                                                                          com.netflix.hystrix.AbstractCommand$5.call(Subscriber)";"1,660";"10,525,361,114"
      "                                                                                                                                                                                             com.netflix.hystrix.AbstractCommand$5.call(Object)";"1,660";"10,525,361,114"
      

      Can an alternative implementation, like the one mentioned at https://issues.apache.org/jira/browse/SPARK-16826, be used to circumvent this issue?

      1. Contention_removed.png
        42 kB
      2. Contention.png
        29 kB
      3. Contention.png
        29 kB
      4. E2ELatency.png
        25 kB

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            sasidharsmit Sasidhar Sekar
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: