Note that there are some explanatory texts on larger screens.

plurals
  1. POCause of Lag in Axis2 Web Service
    primarykey
    data
    text
    <p>I have a Java SOAP web service initially designed in Axis 1 which isn't meeting my performance requirements.</p> <p>The request I'm most concerned about is one used to add lots (millions of rows) of data to the database. On the client side, I'll just be looping through files, pushing this data up to my web service. Each row has three elements, so the request looks something like:</p> <pre><code>&lt;SOAP Envelope/Header/Body&gt; &lt;AddData&gt; &lt;Data&gt; &lt;FirstName&gt;John&lt;/FirstName&gt; &lt;LastName&gt;Smith&lt;/LastName&gt; &lt;Age&gt;42&lt;/Age&gt; &lt;/Data&gt; &lt;/AddData&gt; &lt;/SOAP Envelope/Body&gt; </code></pre> <p>I'm finding the following performance trends:</p> <ul> <li>When I do one row per request, I can get around 720 rows per minute.</li> <li>When I encapsulate multiple rows into a single request, I can get up to 2,400 rows per minute (100 rows per request).</li> </ul> <p>Unfortunately, that performance isn't going to meet our requirements, as we have hundreds millions of rows to insert (at 2,500 rows per minute, it would take about 2 months to load all the data in).</p> <p>So I've been looking into the application to see where our bottleneck is. Each request of 100 rows is taking about 2.5 seconds (I've tried a few different servers and get similar results). I've found the following:</p> <ul> <li>Client-side overhead is negligible (from monitoring the performance of my own client and using SOAP UI)</li> <li>The database activity only accounts for about 10% (.2s) of the total time, so Hibernate caching, etc. won't help out much.</li> <li>The network overhead is negligible (&lt;1ms ping time from client to server, getting >10MB/s throughput with each request sending &lt;20KB).</li> </ul> <p>So this leaves some 2 seconds unaccounted for. The only other piece of this puzzle that I can point a finger at is the overhead of deserializing the incoming requests on the server side. I noticed that Axis 2 claims speed improvements in this area, so I ported this function over the an Axis 2 web service but didn't get the speedup I was looking for (the overall time per request improved by about 10%).</p> <p>Am I underestimating the amount of time needed to deserialize 100 of the elements described above? I can't imagine that that deserialization could possibly take ~2 seconds. </p> <p>What can I do to optimize the performance of this web application and cut down on that 2 second overhead?</p> <p>Thanks in advance!</p> <p>========= The next day.... =========== The plot thickens...</p> <p>At the recommendation of @millhouse, I investigated single row requests one a production server a bit more. I found that they could be suitably quick on good hardware. So I tried adding 1,000 rows using increments ranging from 1 (1,000 separate requests) to 1,000 (a single request). </p> <ul> <li>1 row / Request - 14.5 seconds</li> <li>3/req - 5.8s</li> <li>5/req - 4.5s</li> <li>6/req - 4.2s</li> <li>7/req - 287s</li> <li>25/req - 83s</li> <li>100/req - 22.4s</li> <li>1000/req - 4.4s</li> </ul> <p>As you can see, the extra 2 second lag kicks in ay 7 rows per request (approximately 2 extra seconds per request when compared to 6 rows per request). I can reproduce this consistently. Larger numbers of requests all had similar overhead, but that became less noticeable when inserting 1,000 rows per request. Database time grew linearly and was still fairly negligible compared to the overall request time.</p> <p>So I've found that I get best performance using either 6 rows per request, or thousands of rows per request.</p> <p>Is there any reason why 7 would have such lower performance than 6 rows per request? The machine has 8 cores, and we have 10 connections in the session pool (i.e. I have no idea where the threshold of 6 is coming from).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload