Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/diogok/klj-api
Demo Clojure API
https://github.com/diogok/klj-api
clojure docker graalvm native-image
Last synced: about 1 month ago
JSON representation
Demo Clojure API
- Host: GitHub
- URL: https://github.com/diogok/klj-api
- Owner: diogok
- Created: 2019-07-30T12:49:40.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-24T09:08:54.000Z (over 4 years ago)
- Last Synced: 2025-01-10T00:08:32.292Z (about 1 month ago)
- Topics: clojure, docker, graalvm, native-image
- Language: Clojure
- Size: 43 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Demo Clojure Server project
Just to keep up to date with current frameworks.
## Dependencies
- [Clojure deps tools](https://clojure.org/guides/deps_and_cli)
## Featuring
- Clojure 1.10
- Dockerfile with multistage build
- Dockerfile with with native-image using graalvmThe docker image use openjdk 14 with ZGC for low latency GC set to 85% of RAM available to the container.
The native docker image uses graalvm with Java 11, and has minimal size.
### Native using GraalVM
A few notes on non production or limited environments:
- Java docker image comes at 430MB and native image at 23MB
- Initial memory usage of java is at 150MB while native is at 3MB
- After load memory usage was similar, with native usig about 10% more memory
- Under load, the java version handler more requests
- The benchmark was very limited
- Tracing is not working on native### Utils
- environ for config
- clojure.logging using log4j
- prometheus metrics
- opentracing with jaeger, zipking or log### HTTP
- Ring
- jetty (http)
- reitit for routing
- cheshire for json### Environment configurations:
TODO
## Tasks
`clj repl` start a generic REPL
`clj -A:jar` to create a jar
`clj -A:uberjar` uberjar standalone
`clj run` start the server with autoreload
`docker build -f Dockerfile -t diogok/klj-api .` to build docker image
`docker build -f Dockerfile.native -t diogok/klj-api:native .` to build graalvm native docker image
## License
MIT