title: Large File Upload Fails with JMeter
body: <p>I am trying to use Apache JMeter to test a server's performance in a file upload scenario. Specifically, I am using the HTTP Test Script Recorder to create a test plan to realize this curl command:</p>
  
  <pre><code>$ curl -k -x localhost:8888 -XPOST -d @filename.json -H "Content-Type: application/json" "https://hostname:port"
  </code></pre>
  
  <p>I have had success with this method before when filename.json was only several dozen lines long, but now when I want to test a json with roughly 72,000 lines (a ~5.1M file), I get the following error:</p>
  
  <pre><code>java.net.SocketException: Broken pipe
  at java.net.SocketOutputStream.socketWrite0(Native Method)
  at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
  at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
  at sun.security.ssl.OutputRecord.writeBuffer(OutputRecord.java:431)
  at sun.security.ssl.OutputRecord.write(OutputRecord.java:417)
  at sun.security.ssl.SSLSocketImpl.writeRecordInternal(SSLSocketImpl.java:876)
  at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:847)
  at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123)
  at org.apache.http.impl.io.AbstractSessionOutputBuffer.write(AbstractSessionOutputBuffer.java:181)
  at org.apache.http.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:115)
  at org.apache.http.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:122)
  at org.apache.http.entity.StringEntity.writeTo(StringEntity.java:169)
  at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:96)
  at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:112)
  at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:117)
  at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:265)
  at org.apache.http.impl.conn.ManagedClientConnectionImpl.sendRequestEntity(ManagedClientConnectionImpl.java:216)
  at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.sendRequestEntity(MeasuringConnectionManager.java:207)
  at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:237)
  at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:122)
  at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:686)
  at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:488)
  at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:884)
  at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
  at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
  at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:619)
  at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:379)
  at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
  at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1146)
  at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:240)
  </code></pre>
  
  <p>Indeed, I believe this problem lies with JMeter somehow, because the raw curl command that doesn't involve JMeter</p>
  
  <pre><code>curl -XPOST -d @filename.json -H "Content-Type: application/json" "https://hostname:port"
  </code></pre>
  
  <p>uploads the file without a hitch.</p>
  
  <p>Has anyone encountered this problem? Any help would greatly be appreciated. Thank you.</p>