Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kijuky/play-on-graalvm
PlayをGraalVMで動かす
https://github.com/kijuky/play-on-graalvm
graalvm-native-image playframework scala
Last synced: about 8 hours ago
JSON representation
PlayをGraalVMで動かす
- Host: GitHub
- URL: https://github.com/kijuky/play-on-graalvm
- Owner: kijuky
- Created: 2022-04-26T15:00:59.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-01T08:22:23.000Z (about 1 year ago)
- Last Synced: 2023-11-01T18:29:23.881Z (about 1 year ago)
- Topics: graalvm-native-image, playframework, scala
- Language: Scala
- Homepage: https://qiita.com/kijuky/items/ab3d1aecc9e4466145f9
- Size: 48.8 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# play on graalvm
## requirements
- docker or asdf
## Docker を使う場合
ベースイメージは[scala-sbt](https://hub.docker.com/r/sbtscala/scala-sbt/tags?page=1&name=graalvm)を使います。
### build
```shell
docker build .
```### run
```shell
docker run -p 9000:9000 -it --rm <>
``````shell
open http://localhost:9000/
```## ローカル(mac)で実行する場合
asdfでGraalVM環境を設定しているものとします。
### build
```shell
sbt GraalVMNativeImage/packageBin
```### run
```shell
target/graalvm-native-image/play-scala-seed
``````shell
open http://localhost:9000/
```# パフォーマンス比較
[こちらの記事](https://www.playframework.com/blog/play-on-graal)を参考に [wrk](https://github.com/wg/wrk) を使いました。
## GraalVM
```shell
% wrk -t2 -c100 -d1m http://localhost:9000
Running 1m test @ http://localhost:9000
2 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 8.47ms 6.62ms 337.61ms 90.01%
Req/Sec 6.21k 646.17 8.55k 78.08%
741283 requests in 1.00m, 542.22MB read
Requests/sec: 12352.84
Transfer/sec: 9.04MB
```## JVM
```shell
% wrk -t2 -c100 -d1m http://localhost:9000
Running 1m test @ http://localhost:9000
2 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 19.03ms 70.79ms 1.61s 98.58%
Req/Sec 4.50k 1.02k 5.96k 82.11%
535938 requests in 1.00m, 392.02MB read
Requests/sec: 8926.96
Transfer/sec: 6.53MB
```