Fork me on GitHub
#pedestal
<
2020-09-25
>
Zebra15:09:08

Hello, everyone how to deal with sharp latency increases during load in pedestal jetty based server? When querying db and sending large json response to 1 request latency is around 700ms, and as i increase requests to 15-25 per second response times grow to 16-27s, how to deal with this? (Standard settings, prod mode, full async and nio)

souenzzo16:09:19

can you exemplify this? Did you use time macro to check if this time is from j/query or any other component? You are using json? cheshire? how do you benchmark it?

Zebra16:09:05

Muuntaja for encoding, wrk2 for testing

Zebra16:09:12

Also yeah, i used time to look for handler time, it uses fixedthreadpool for queries and does a bit of mapping, the time it takes to complete handler takes 450-550ms

souenzzo16:09:14

What the request does? Are you sure that your operation isn't blocking the async threads?

Zebra16:09:00

Queries are submitted to a fixedsizethreadpool that returns a chan on completion, other than that nothing blocking

chrisulloa15:09:36

Is there anything built into pedestal to let the client specify keys? /posts/42?fields=subject,author_name kind of thing

chrisulloa16:09:07

writing an interceptor but also curious if anything is already baked in

Zebra16:09:12

Query params are parsed by default if im not mistaken

Zebra16:09:02

/posts/42?fields[]=subject&fields[]=author_name

👍 3
souenzzo16:09:06

@christian.gonzalez you end up re-writting (a part of) graphql

chrisulloa16:09:37

thank you! checking that out, not sure yet if i need to specify nested keys