Skip to content

Latest commit

 

History

History

01-classic-spring

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Shows classical approaches to concurrency

Most of the commands here should be executed within the workbench container created by the docker-compose.yaml at the root of the project.

Counters

watch -n 0.1 curl -s -XGET http://classic:7070/counter/v1

# with ApacheBench
ab -c 1000 -n 100000 -m POST http://classic:7070/counter/v1

# with Siege
siege -q -c 1000 -r 100 'http://classic:7070/counter/v1 POST'

Java Memory Model

NOTE: this example does not work on JDK 17 and needs to be re-worked

curl -XPOST http://classic:7070/jmm/v1
ab -c 1000 -n 1000000 -m POST http://classic:7070/jmm/v1

Wait For Result

curl -XGET http://classic:7070/wait/v1

ab -c 1000 -n 100000 -m GET http://classic:7070/wait/v1
jstack "$(ps -o pid,args -C java | grep app.jar | awk '{ print $1 }')" | view -

Combine Results

curl -XGET http://classic:7070/combine/v1
ab -c 10 -n 100 -m GET http://classic:7070/combine/v1
ab -c 100 -n 100000 -m GET http://classic:7070/combine/v1