'org.apache.http.TruncatedChunkException

I am getting this issue when trying performance testing with jmeter. the application built on spring and ui with bootstrap with angularjs. this application working fine with 500 concurrent user with 0 error, for 750 users I am getting this error. This page don't have any database related things.

org.apache.http.TruncatedChunkException: Truncated chunk ( expected size: 8192; actual size: 7692)
at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:198)
at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:135)
at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:148)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.readResponse(HTTPSamplerBase.java:1814)
at org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.readResponse(HTTPAbstractImpl.java:440)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:433)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.followRedirects(HTTPSamplerBase.java:1542)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.resultProcessing(HTTPSamplerBase.java:1636)
at org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.resultProcessing(HTTPAbstractImpl.java:519)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:493)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1189)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1178)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:491)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:425)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:254)
at java.lang.Thread.run(Thread.java:745)


Solution 1:[1]

Your server is closing the connection prior to JMeter can fully read the response due to truncated chunk in chunked stream. Most probably server closes the connection before JMeter fully reads the response.

There could be different reasons for it.

  • An issue with your application code when open connections can be forcefully closed for some reason
  • Your application simply lacks resources. Make sure it has enough headroom in terms of CPU, Memory, Swap, Disk, etc. Make sure you monitor these metrics on application under test side during your test and correlate them with the increasing load. See How to Monitor Your Server Health & Performance During a JMeter Load Test
  • Application (or web server) configuration. It might be the case that when you add more virtual users response time increases (this is not what business wants, but in majority of cases it is so). Check response time trend with i.e. Response Times Over Time listener, it might be the case that requests last longer than your application server allows them to be run so they are closed (like TimeOut directive for Apache HTTP server)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dmitri T