diff options
author | drebs <drebs@riseup.net> | 2018-01-08 21:37:16 -0200 |
---|---|---|
committer | drebs <drebs@riseup.net> | 2018-01-08 21:37:16 -0200 |
commit | dffcd8a954225dedc51beae01baf0966ce92e155 (patch) | |
tree | edfff05dc22d0147b58e5318e44204f709604606 /blobs-multiprocess/makefile | |
parent | 3e8df5c794656e8bad5e620673d457af86de745d (diff) |
use ab in blobs multiprocess test
Diffstat (limited to 'blobs-multiprocess/makefile')
-rw-r--r-- | blobs-multiprocess/makefile | 74 |
1 files changed, 54 insertions, 20 deletions
diff --git a/blobs-multiprocess/makefile b/blobs-multiprocess/makefile index 4a8cbaa..a58bb60 100644 --- a/blobs-multiprocess/makefile +++ b/blobs-multiprocess/makefile @@ -1,44 +1,78 @@ -DIR = /tmp/blobs -PORT = 8000 -URI = http://127.0.0.1:8000/blobs/user -UUID = $(shell uuidgen) -PROCS ?= 4 +DIR = /tmp/blobs +PORT = 8000 +BASE_URI = http://127.0.0.1:8000 +BLOBS_URI = $(BASE_URI)/blobs/user +UUID = $(shell uuidgen) +PROCS ?= 4 +SIZE ?= 56 all: multiproc -server: killall +server: python blobs-server.py $(DIR) $(PORT) -multiproc: +multiproc: roundrobin python multiproc.py --procs $(PROCS) -roundrobin: killall +roundrobin: kill-haproxy /usr/sbin/haproxy -D -f haproxy/roundrobin-$(PROCS).cfg -killall: +kill-haproxy: -killall -9 haproxy +kill-server: + pid=$$(ps aux | grep python\ blobs-server.py | grep -v grep | awk "{print \$$2}"); \ + kill -9 $${pid} + data: - dd if=/dev/urandom of=/tmp/data bs=1024 count=100 + dd if=/dev/urandom of=/tmp/data bs=1024 count=$(SIZE) list: - curl -X GET $(URI)/ + curl -X GET $(BLOBS_URI)/ -put: - curl -X PUT $(URI)/$(UUID) --data-binary @/tmp/data +put: data + curl -X PUT $(BLOBS_URI)/$(UUID) --data-binary @/tmp/data get: UUID=$(UUID); \ - curl -X PUT $(URI)/$${UUID} --data-binary @/tmp/data; \ - curl -X GET $(URI)/$${UUID} > /dev/null + curl -X PUT $(BLOBS_URI)/$${UUID} --data-binary @/tmp/data; \ + curl -X GET $(BLOBS_URI)/$${UUID} > /dev/null delete: UUID=$(UUID); \ - curl -X PUT $(URI)/$${UUID} --data-binary @/tmp/data; \ - curl -X DELETE $(URI)/$${UUID} + curl -X PUT $(BLOBS_URI)/$${UUID} --data-binary @/tmp/data; \ + curl -X DELETE $(BLOBS_URI)/$${UUID} + +stress-baseline-ab: clean + ab -c 10 -n 1000 http://127.0.0.1:8000/ + +stress-baseline: clean + siege --concurrent=50 -t 5s http://127.0.0.1:8000/ + +stress-put: clean + #ab -c 10 -n 1000 -T /tmp/data $(BLOBS_URI)/$(UUID) + ab -c 10 -n 1000 -T /tmp/data $(BLOBS_URI)/$(UUID) + +stress-get: + @ab -c 10 -n 1000 -q $(BASE_URI)/ | grep ^Requests | awk '{print $$4}' + +ab-get: + @ab -c 10 -n 1000 -q -m GET $(URI) | grep ^Requests | awk '{print $$4}' + +ab-put: + @ab -c 10 -n 1000 -q -u /tmp/data $(URI) | grep ^Requests | awk '{print $$4}' + +ab-flag: + @ab -c 10 -n 1000 -q -p /tmp/flag $(URI) | grep ^Requests | awk '{print $$4}' + +ab-delete: + @ab -c 10 -n 1000 -q -m DELETE $(URI) | grep ^Requests | awk '{print $$4}' + +clean: + rm -rf /tmp/blobs/* -put-ab: - ab -c 10 -n 1000 -T /tmp/data $(URI)/$(UUID) +flag: + echo '["PROCESSING"]' > /tmp/flag -.PHONY: server multiproc roundrobin killall +.PHONY: server multiproc roundrobin kill-server kill-haproxy |