https://github.com/hendisantika/spring-boot-virtual-thread
Spring Boot Virtual Thread Demo
https://github.com/hendisantika/spring-boot-virtual-thread
Last synced: about 2 months ago
JSON representation
Spring Boot Virtual Thread Demo
- Host: GitHub
- URL: https://github.com/hendisantika/spring-boot-virtual-thread
- Owner: hendisantika
- Created: 2023-09-23T04:56:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-07T23:16:15.000Z (2 months ago)
- Last Synced: 2025-04-13T00:13:56.847Z (about 2 months ago)
- Language: Java
- Size: 673 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# spring-boot-virtual-thread
### Things todo list
Now let’s setup our JMeter. We will have 1000 requests, which will ramp up in 3 seconds. And it will continue like this
for a duration of 200 seconds. Every 3 seconds, 1000 GET (“/thread”) requests will be fired. We have also added a
Response Time Graph Listener.
Clearly, now the response time for concurrent 1000 requests is nearly just above 1000 ms and at some point, shoots up to
1400 seconds, which is far better than when we were using normal threads.Clearly, when we need to utilise the underlying CPU to the fullest, we should start embracing virtual threads in our
application, and suddenly we can see that the throughput of our application has increased manifold for the same
hardware.This is much better than switching to reactive programming, which means rewriting all your code, which is very hard to
maintain and even harder to debug.Simply put, more users can use the application and get their response simultaneously as the first user.
1. Clone this repository: `cd https://github.com/hendisantika/spring-boot-virtual-thread.git`
2. Navigate to the folder: `cd spring-boot-virtual-thread`
3. Change your DB credentials in `application.properties` file
4. Run the application: `mvn clean spring-boot:run`JMeter Config
Run JMeter CLI: `jmeter -n -t Thread\ Group.jmx -l -e -o report/report.csv `

Normal Thread

Virtual Thread

Link: https://qaprovider.com/discussion/show/how-to-run-jmeter-from-command-line-non-gui-mode/40
Run Performance Testing with k6:
1. Install k6 [here](https://k6.io/docs/get-started/installation/)
2. Run test script `k6 --duration '200s' --vus 1000 run k6.js`