{"id":15344546,"url":"https://github.com/ricardozanini/camel-spring-boot-tuning","last_synced_at":"2025-04-15T03:23:46.257Z","repository":{"id":79133727,"uuid":"148242673","full_name":"ricardozanini/camel-spring-boot-tuning","owner":"ricardozanini","description":"Base repository for the Camel Spring Boot Tuning Guide blog post","archived":false,"fork":false,"pushed_at":"2018-10-09T03:34:03.000Z","size":192,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-23T05:12:10.228Z","etag":null,"topics":["apache-camel","httpd","spring-boot","tomcat","tuning"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ricardozanini.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-11T01:31:48.000Z","updated_at":"2024-02-24T08:36:33.000Z","dependencies_parsed_at":"2023-05-27T02:00:42.520Z","dependency_job_id":null,"html_url":"https://github.com/ricardozanini/camel-spring-boot-tuning","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardozanini%2Fcamel-spring-boot-tuning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardozanini%2Fcamel-spring-boot-tuning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardozanini%2Fcamel-spring-boot-tuning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardozanini%2Fcamel-spring-boot-tuning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ricardozanini","download_url":"https://codeload.github.com/ricardozanini/camel-spring-boot-tuning/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240930427,"owners_count":19880465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache-camel","httpd","spring-boot","tomcat","tuning"],"created_at":"2024-10-01T11:00:10.642Z","updated_at":"2025-02-26T20:30:53.337Z","avatar_url":"https://github.com/ricardozanini.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Camel Spring Boot Tuning\n\nThis is the base repository for the Camel Spring Boot Tuning Guide blog post.\n\nThe goal of this lab is to have an environment ready for load test a simple REST Camel application deployed in two machines. The fist machine `app_default` is the application installed \"as is\", without any kind of tuning or fancy configuration. The second one, `app_tuned`, all the components from the application architecture have been modified to achieve more performatic requests and reliability. The architecture is illustrated below:\n\n```\n+-----------------------+        +---------------------------+      +------------------------------+\n|                       |        |                           |      |                              |\n|     Apache HTTPD      |        |   Camel Spring Boot App   |      |      Internal Mock Web       |\n|     Reverse Proxy     +-------\u003e+     (Embedded Tomcat)     +-----\u003e+ (Python Simple HTTP Server)  |\n|                       |        |                           |      |                              |\n+-----------------------+        +---------------------------+      +------------------------------+\n```\n\nIn general, the VM `app_tuned` performs almost 300% better. See the chart below of one of the load tests run:\n\n![Transactions Per Second](https://raw.githubusercontent.com/ricardozanini/camel-spring-boot-tuning/master/docs/assets/tps.png)\n\nIf we check the VM's load average, there's another surprise:\n\n![Load Average from App Default](https://raw.githubusercontent.com/ricardozanini/camel-spring-boot-tuning/master/docs/assets/load_average_app1.png)\n\n![Load Average from App Tuned](https://raw.githubusercontent.com/ricardozanini/camel-spring-boot-tuning/master/docs/assets/load_average_app2.png)\n\nThe `app_default` has the worst performance, while consuming much more resources than the `app_tuned`.\n\nThe VM `app_default` doesn't handle all the requests (150 simultaneous users) during much time, since in our experiments its JVM always crashes.\n\nPlease read the blog post about what has been done in this lab regarding tuning. Note that is not that much, but people tends to neglect the most obvious tuning aspects all the time. I hope this can be helpful somehow. I love to write and hack configurations, if you'd like to talk about it, reach me out.\n\n## Requirements\n\nTo run this lab, you're going to need:\n\n1. [Vagrant](https://www.vagrantup.com/docs/installation/)\n    1. [VirtualBox](https://www.vagrantup.com/docs/virtualbox/) for Vagrant provider\n    2. Vagrant Plugin [Hostmanager](https://www.vagrantup.com/docs/cli/plugin.html#plugin-install)\n: `vagrant plugin install vagrant-hostmanager`\n2. [VirtualBox](https://www.virtualbox.org/wiki/Downloads)\n3. [Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)\n4. [JMeter](https://jmeter.apache.org/download_jmeter.cgi) for load tests\n5. [PCP Vector](https://rhelblog.redhat.com/2015/12/18/getting-started-using-performance-co-pilot-and-vector-for-browser-based-metric-visualizations/) to collect the VM metrics (optional)\n6. [JVisualVM](https://visualvm.github.io/) to collect JVM metrics like GC behavior (optional)\n7. [Maven](https://maven.apache.org/) to build and deploy the application\n\n## How to use\n\nHaving the requirements installed, run the script `start.sh` that will build the application and provision the machines used in this lab. The Ansible playbooks are going to install all software needed to have this lab set.\n\nThen you can run the [JMeter Load Test](https://github.com/ricardozanini/camel-spring-boot-tuning/blob/master/jmeter/load_test.jmx) to see the results in place. You can `ssh` in the machines (`vagrant ssh app_tuned`) and play with the configurations to see if the application performs even better. If you do, please share your results.\n\nAfter runing your tests, you can destroy your VMs by runing `./destroy.sh` in the project home.\n\n### Generating JMeter Reports\n\n1. Configure the `user.properties` on JMeter home according to the [dashboard documentation](http://jmeter.apache.org/usermanual/generating-dashboard.html)\n2. Save the CSV result file on the `Aggregate Report` tab (`$PROJECT_HOME/jmeter/results.csv`)\n3. Generate the report after performing the load test by running `jmeter -g jmeter/results.csv -o jmeter/results-output`.\n\n### Viewing PCP Metrics\n\nBoth machines are provisioned with `pcp` installed and enabled. To view your metris during your load test, install Vector on your host and open two tabs, pointing each one to `app.local` and `app2.local`:\n\n* http://localhost:44323/vector/index.html#/?host=localhost:44323\u0026hostspec=app.local\n* http://localhost:44323/vector/index.html#/?host=localhost:44323\u0026hostspec=app2.local\n\n### Viewing JVM Metrics\n\nThe JMX management is available at te port `12349`. Just add this port to your favorite JMX management tool and start extracting JVM metrics during your load tests.\n\nEnjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricardozanini%2Fcamel-spring-boot-tuning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fricardozanini%2Fcamel-spring-boot-tuning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricardozanini%2Fcamel-spring-boot-tuning/lists"}