https://kotlinlang.org logo
#http4k
Title
# http4k
d

dave

05/29/2019, 4:27 AM
@krtko not out of the box. We don't provide an API to do this because the options are to many and vary across the backends. But we do expect people to want to tweak the server settings, so we provide the ServerConfig interface (which gives you the to server extension function). You should copy the default version for Apache from our source and modify as required. The code to convert the HttpHandler should be reusable from our code (but let us know if it's not good enough/requires loads of duplication).
k

krtko

05/29/2019, 4:29 AM
Ok thank you. Do you think switching to jetty or undertow would help resolve the issue or help limit thread usage? Unfortunately I'm on Heroku and it has a very strict process limits.
d

dave

05/29/2019, 4:58 AM
Tbh I don't know - alternatively maybe investigate if is there a way to set up Heroku to automatically spin up new dynos based on load levels?
k

krtko

05/29/2019, 5:26 AM
Heroku doesn't have great auto scaling features. The server can easily use more threads than their limit set at 512 for 1gb of memory
The server consumes about 700~ mbs of memory when it hits the limit
d

dave

05/29/2019, 6:42 AM
That seems like a lot of memory. Can I ask what the app is doing? We generally see much lower memory for our services (anything from 50-250mb generally). Although I haven't tried Apache in period myself.. switching out to undertow or jetty may help without any more with.
Which GC settings are you using?
k

krtko

05/29/2019, 2:53 PM
Heap is set to 600mbs, Xss is 512k. It's using the default Java 11 GC. The server talks to AWS SNS a lot. Which can be very slow. Sometimes taking over 15 seconds. Other than that standard database and redis actions. It handles anywhere from 1 - 20 rps. I will try switching to undertow or jetty
d

dave

05/29/2019, 4:11 PM
which library are you using for SNS? Is it the amazon SDK?
k

krtko

05/29/2019, 4:43 PM
Yes 2.5.15 to be exact
3 Views