Timeouts

45 views
Skip to first unread message

dan....@stonebridgeprojects.com

unread,
Apr 2, 2017, 4:44:58 PM4/2/17
to sparkjava
Hello,

I have written an application in Java that exposes an HTTP API through SPARK.  It works well in manual tests using the REST Web Services Client in Chrome and in low volume automated Java tests using the Unirest API.  When I run fast, repetitive automated single threaded Java tests with the Unirest API, the test times out and fails after as little as a few thousand or as many as over a hundred thousand repetitions.  Prior to the timeout there is no apparent degradation in response times. 

If I run the same repetitive test workload bypassing HTTP and calling the application Java directly there are no problems, even with a million repetitions and several concurrent client threads. Based on this behaviour I suspect (but I could be wrong) that the problem could be in Spark or in Jetty or in Unirest.  I would like to know whether any members of this Spark group have experience with a problem like mine or can offer any tips for debugging it.  

I have turned up the Jetty logging to debug and I am attaching the end of the log. I don't see anything in the log that explains the problem but I don't know Spark or Jetty well.

Thanks very much.

-Dan
Spark Log - April 2 2017

domin...@gmail.com

unread,
Apr 3, 2017, 4:40:47 AM4/3/17
to sparkjava
I've not run any specific stress or load tests that could be comparable for you, but have you looked at http://sparkjava.com/documentation.html#threadpool ?

You may get different (better) results by "tweaking" these settings. 

dan....@stonebridgeprojects.com

unread,
Apr 3, 2017, 3:42:56 PM4/3/17
to sparkjava
Many thanks for the reply and the suggestion.

-Dan

domin...@gmail.com

unread,
Apr 4, 2017, 2:32:00 AM4/4/17
to sparkjava
I'm interested in your results so please post any updates, if you would.
Regards

dan....@stonebridgeprojects.com

unread,
Apr 4, 2017, 2:29:07 PM4/4/17
to sparkjava
Hi Dominic,

I changed max threads from 10 to 100 and am still seeing the same behavior.

Thanks again for your help.

-Dan

domin...@gmail.com

unread,
Apr 5, 2017, 3:27:33 AM4/5/17
to sparkjava
Shame...

Is your project available for a fork?

dan....@stonebridgeprojects.com

unread,
Apr 5, 2017, 9:22:40 AM4/5/17
to sparkjava
Hi Dominic,

Do you mean that you would take the time to look at my code?

-Dan

domin...@gmail.com

unread,
Apr 7, 2017, 4:41:11 AM4/7/17
to sparkjava
sure. no promises. 

dan....@stonebridgeprojects.com

unread,
Apr 8, 2017, 1:52:37 AM4/8/17
to sparkjava
Hi Dominic,

I have found the problem.  It was in my code, not Spark or Jetty or Unirest.

Thanks again for your help and your offer to help even more.

-Dan
Reply all
Reply to author
Forward
0 new messages