red envelope system. 红包秒杀系统
1.rocketmq
http://rocketmq.apache.org/docs/quick-start/
nohup sh bin/mqnamesrv &
nohup sh bin/mqbroker -n localhost:9876 &
2.reids
./src/redis-server
RedEnvelopeApplication main
POST http://localhost:8080/red-envelope/create
body:
{
"user": "lewiszlw",
"type": "ORDINARY",
"amount": 10000,
"size": 5
}
GET http://localhost:8080/red-envelope/grab?envelopeId=1&grabber=lewis
envelopeId idgrabber
GET http://localhost:8080/red-envelope/verify?envelopeIds=3,4,5,6
1.locust
https://docs.locust.io/en/latest/index.html
pip3 install locustio
2.locustfile.py
locustfile.pyENVELOPE_IDid
locust --host=http://127.0.0.1:8080
4.Locust web
ps.slaveRPS (Requests per second)