Fork me on GitHub
#ring
<
2017-03-24
>
mattsfrey15:03:20

has anyone had issues where continuous requests start to take longer and longer and then eventually start timing out?

weavejester15:03:06

Continuous requests?

mattsfrey16:03:31

just having a client repeatedly make requests over a period of time

mattsfrey16:03:47

polling for data basically

mattsfrey16:03:12

it usually runs under 250ms but then every so often just starts to take more and more time, until its in the hundreds of seconds

mattsfrey16:03:35

eventually the healtcheck request from the instance manager times out and it restarts the machine

mattsfrey16:03:42

and the problem is gone again for a period of time

mattsfrey16:03:12

seems like some sort of resource is getting tied up, threads arent being freed or something but I don't know enough about the underlying server architecture to really know whats going on

weavejester16:03:28

Which adapter are you using? Are you using async or synchronous handlers? If you’re just using ring-jetty with synchronous handlers, which is the most common setup, you might have something in your handler that’s holding resources but not releasing them.

weavejester16:03:42

Ring-Jetty with sync handlers doesn’t keep anything open by default.

seancorfield17:03:24

250ms is a pretty slow request in the first place. I’m curious as to what work you’re doing in such a request @mattsfrey ?

mattsfrey17:03:36

it has to essentially make multiple calls out to s3 before returning a response

mattsfrey17:03:42

so thats causing the larger times

mattsfrey17:03:40

using async I believe

weavejester17:03:03

Does it use async handlers? Maybe it’s not closing the response?

weavejester17:03:30

Or maybe you’re keeping I/O connections open

mattsfrey17:03:59

do you know of an easy way inherent to ring to view whats going on behind the scenes? I'm at the point of hooking up a jvm profiler really

weavejester17:03:23

It doesn’t sound like it’s Ring specifically that’s the problem, but what’s going on in your handler after Ring has passed off the request to it.

weavejester17:03:40

A profiler is a good place to start.

mattsfrey19:03:47

yeah haven't hooked up the profiler but checking our datadog logs it seems to be using an increasing amount of memory until it breeches the box's allocation

mattsfrey19:03:57

so something is using memory and not freeing it