What is Varnish Caching? You can learn it in my medium post: Varnish nedir, nasıl çalışır?
- Create docker build
➜ varnish-demo git:(master) cd application
➜ application git:(master) docker build -t application .
- Run the application you built.
➜ application git:(master) docker run -e "SPRING_PROFILES_ACTIVE=dev" -p 8080:8080 -t application
- The application is ready. (http://localhost:8080/)
- Page test OK
- Create docker build and run application
➜ varnish-demo git:(master) docker-compose up --build
- The application is ready. (http://localhost:8000/)
- Page test OK
Load Test with Apache Benchmark
- Let's put both apps into load test
Without Varnish: at port 8080, with Varnish: at port 8000
➜ application git:(master) ab -n 5000 -c 100 http://localhost:8080/
➜ varnish-demo git:(master) ab -n 5000 -c 100 http://localhost:8000/
Without Varnish | With Varnish |
---|---|