Mam problem z wysyłaniem jednocześnie żądań usługi odpoczynkowej; Wiadomości w kliencie (Apache JMeter) to "Resetowanie połączenia" dla niektórych żądań, w zależności od numeru żądania, na przykład, wysyłam 100 żądań, a odpowiedź serwera jest w 100% udana, ale jeśli wyślę 500 żądań, to 30 % odpowiedzi to błąd.Resetowanie połączenia zużywającego usługę REST (scala/spray)
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:196)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:166)
at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:90)
at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:281)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:92)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:61)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:254)
at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:289)
at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:252)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:191)
at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.receiveResponseHeader(MeasuringConnectionManager.java:201)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:300)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:127)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:715)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:520)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:517)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:331)
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.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1135)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:434)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261)
at java.lang.Thread.run(Thread.java:745)
zmodyfikowałem "application.conf", treść jest następny:
spray.can {
server {
server-header = spray-can/${spray.version}
ssl-encryption = off
pipelining-limit = 16
idle-timeout = 60 s
request-timeout = 30 s
timeout-timeout = 2 s
timeout-handler = ""
reaping-cycle = 250 ms
stats-support = on
remote-address-header = off
raw-request-uri-header = off
transparent-head-requests = on
chunkless-streaming = off
verbose-error-messages = on
request-chunk-aggregation-limit = 1m
response-header-size-hint = 512
bind-timeout = infinite
unbind-timeout = 1s
registration-timeout = 1s
default-host-header = ""
automatic-back-pressure-handling = on
back-pressure {
noack-rate = 10
reading-low-watermark = infinite
}
parsing = ${spray.can.parsing}
}
client {
user-agent-header = spray-can/${spray.version}
idle-timeout = 60 s
request-timeout = 40 s
reaping-cycle = 250 ms
response-chunk-aggregation-limit = 1m
chunkless-streaming = off
request-header-size-hint = 256
max-encryption-chunk-size = 1m
connecting-timeout = 30s
proxy {
http = default
https = default
}
ssl-tracing = off
parsing = ${spray.can.parsing}
}
host-connector {
max-connections = 80
max-retries = 8
max-redirects = 0
pipelining = enabled
idle-timeout = 30 s
client = ${spray.can.client}
}
}
Ustawienia JVM są:
-Xms1024M
-Xmx2048M
-Xss1M
-XX:MaxPermSize=1024m
WAŻNE: Ponieważ logiki bussines jest necesary że serwer obsługuje jednocześnie transakcje; 500 indywidualnych połączeń (transakcji) w mniej niż 5 sekund.