Created
March 28, 2024 21:30
-
-
Save lbialy/c1f8eebe5ad5f715ef3b6f96ed119fc6 to your computer and use it in GitHub Desktop.
Have fun Anton
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sbt new http4s/http4s.g8 --branch 1.0-scala3 | |
// use all the defaults, just set sbt to 1.9.9 | |
$ cd quickstart | |
$ sbt assembly | |
$ cat Dockerfile # create this file with these contents: | |
FROM ghcr.io/graalvm/jdk-community:22 | |
RUN mkdir /opt/app | |
COPY target/scala-3.3.3/quickstart-assembly-0.0.1-SNAPSHOT.jar /opt/app/http4s.jar | |
CMD ["java", "-jar", "/opt/app/http4s.jar"] | |
$ docker build . -t http4s:graalvm | |
$ docker run -d -m 250m -p 8080:8080 http4s:graalvm | |
$ wrk -t5 -c25 -d15s http://127.0.0.1:8080/hello/fren | |
Running 15s test @ http://127.0.0.1:8080/hello/fren | |
5 threads and 25 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 4.37ms 5.23ms 85.59ms 96.15% | |
Req/Sec 1.36k 221.39 1.63k 86.67% | |
101463 requests in 15.05s, 15.19MB read | |
Requests/sec: 6741.57 <<<<<<<<<< HTTP4S GOES BRRRRRRRRR | |
Transfer/sec: 1.01MB | |
$ docker ps -a | grep http4s | |
3db82b1cf410 http4s:graalvm "java -jar /opt/app/…" 6 minutes ago Up 6 minutes 0.0.0.0:8080->8080/tcp great_greider | |
// DID NOT CRASH UNDER LOAD, -m 250m, thank me later |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I love the myth that Scala can't go fast in low mem environments 😆