spierce7
01/27/2023, 2:37 PMjw
01/27/2023, 2:42 PMDominik Sandjaja
01/27/2023, 2:43 PMjw
01/27/2023, 2:43 PMspierce7
01/27/2023, 2:45 PMDominik Sandjaja
01/27/2023, 2:46 PM[...] stay fast - Running [...] in serverless environmentIsn't this a bit of a contradiction? Isn't the whole idea to only handle a single request and then quickly shut down again?
spierce7
01/27/2023, 2:47 PMYou can use CIO instead of Jetty/Netty which doesn't take multiple seconds to start.@jw This is interesting. I've been hesitant to use CIO, and stayed away from it because I assumed no one else was using it. Plus why would I use it when I could use something like Netty 😛 Maybe Netty is the problem though.
jw
01/27/2023, 2:49 PMspierce7
01/27/2023, 2:53 PMDominik Sandjaja
01/27/2023, 2:55 PMktor
one.spierce7
01/27/2023, 2:58 PMCasey Brooks
01/27/2023, 3:07 PMjw
01/27/2023, 3:07 PMpsh
01/27/2023, 3:17 PMAndrew O'Hara
01/27/2023, 3:56 PMJAVA_TOOL_OPTIONS: -XX:+TieredCompilation -XX:TieredStopAtLevel=1
4. I have no idea why and how you're running Netty in a Lambda to serve your traffic. You would ideally use an adapter to convert Ktor to the serverless programming model, without running an embedded server. This can apparently be done with Kotless (as shown above), but http4k's smaller footprint and modular architecture gives it an an edge in serverless environments. https://www.http4k.org/guide/reference/serverless/
5. Eliminate reflection on app init. No AoP or DI tools (unless done at compile-time)jw
01/27/2023, 3:58 PMOptimize JVM AoT compilation for cold-starts.This does not do anything for AOT. This is disabling C2. Both C1 and C2 are JIT compilers since they run at runtime, not ahead-of-time.
Andrew O'Hara
01/27/2023, 4:00 PMThis does not do anything for AOTYes. I meant JiT. Corrected.
Both aspect-oriented and DI libraries can be used provided they run at compile-time and not runtime.Good point
spierce7
01/27/2023, 4:45 PMI have no idea why and how you're running Netty in a Lambda to serve your traffic.lol! I'm not. hahaha I'm using Cloud Run. Cloud run lets you run a docker container, and then it stays running. Cloud Run scales at the docker container level. IMO it's much better than something like functions or lambda.
Having fast start and fast run would be having your cake and eating it too.It'd be nice if I could focus on fast starts, and then transition to fast run.
jw
01/27/2023, 4:52 PMspierce7
01/27/2023, 4:54 PMcom.sun.management.HotSpotDiagnosticMXBean#setVMOption(String, String)
I don't know if it would actually have an effectYou could set the tier 2 and 3 thresholds to be equal to tier 4 and then set tier 4@jw What thresholds?
jw
01/27/2023, 4:55 PMspierce7
01/27/2023, 4:56 PMjw
01/27/2023, 4:56 PMspierce7
01/27/2023, 4:56 PMjw
01/27/2023, 4:57 PMspierce7
01/27/2023, 4:57 PMCompileThreshold
and Tier2CompileThreshold
.
For some reason CompileThreshold
default is 10k, but Tier2CompileThreshold
default is 0 with Tier3CompileThreshold
at 2k.
Tier1CompileThreshold
doesn't exist, and based on the defaults, I'd assume that CompileThreshold
isn't Tier1.Tier2CompileThreshold=10000
Tier3CompileThreshold=10000
Tier4CompileThreshold=10000
But how would I set Tier1 to 0? Based on the defaults, it seems like CompileThreshold
is not Tier1.jw
01/27/2023, 5:55 PMspierce7
01/28/2023, 5:29 AM