DoSomething / bertly

🔗 A serverless link shortener.
https://dosome.click/wq544
MIT License
2 stars 1 forks source link

Occasional 500s when following shortlinks. #28

Closed DFurnes closed 6 years ago

DFurnes commented 6 years ago

I ran a quick load-test on visiting shortlinks and noticed some occasional 500s:

Load Test Results ``` $ siege -c 10 -r 30 "https://dosome.click/zkp8v" ** SIEGE 4.0.4 ** Preparing 10 concurrent users for battle. The server is now under siege... HTTP/1.1 500 0.11 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.11 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.11 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.12 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.12 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.12 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.12 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.17 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.17 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.10 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.07 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.11 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.10 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.12 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.07 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.07 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.11 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.12 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.11 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.07 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.07 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.13 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.06 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.07 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.06 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 1.26 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.11 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.13 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.14 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.06 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.07 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 1.14 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.12 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 1.05 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.12 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 1.10 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.15 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.06 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.07 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.85 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.06 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.14 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.14 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.07 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.15 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.48 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.40 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.83 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.68 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.07 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.11 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.12 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.12 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.07 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.07 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.17 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.06 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.10 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.15 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.24 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.12 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.12 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.11 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.11 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.16 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.14 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.12 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.12 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.14 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.13 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.07 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.12 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.14 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.10 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.14 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.27 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.27 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.13 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.11 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.11 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.10 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.12 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.13 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.11 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.13 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.11 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.16 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.11 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.27 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.29 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.29 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.29 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.29 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.28 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.25 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.25 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.10 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.12 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.12 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.19 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.19 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.07 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.08 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 500 0.10 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.06 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.06 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.06 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.07 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.06 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.06 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.10 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.07 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 500 0.09 secs: 291 bytes ==> GET /zkp8v HTTP/1.1 302 0.09 secs: 353 bytes ==> GET /zkp8v HTTP/1.1 302 0.08 secs: 353 bytes ==> GET /zkp8v Transactions: 200 hits Availability: 66.67 % Elapsed time: 4.45 secs Data transferred: 0.10 MB Response time: 0.18 secs Transaction rate: 44.94 trans/sec Throughput: 0.02 MB/sec Concurrency: 8.20 Successful transactions: 200 Failed transactions: 100 Longest transaction: 1.26 Shortest transaction: 0.06 ```


It looks like these are caused by race-conditions creating the primary key on clicks:

IntegrityError: (psycopg2.IntegrityError) duplicate key value violates unique constraint "clicks_pkey"
DETAIL: Key (click_id)=(zkp8v1528223743.52) already exists.
[SQL: 'INSERT INTO clicks (click_id, click_time, shortened, target_url) VALUES (%(click_id)s, %(click_time)s, %(shortened)s, %(target_url)s)'] [parameters: {'click_id': u'zkp8v1528223743.52', 'shortened': u'zkp8v', 'target_url': u'https://vote.dosomething.org/member-drive?userId=5543dfd6469c64ec7d8b46b3', 'click_time': datetime.datetime(2018, 6, 5, 18, 35, 43, 517637)}] (Background on this error at: http://sqlalche.me/e/gkpj)

We should be able to avoid this problem by auto-incrementing IDs in that column (or by generating IDs with something like uuid.uuid4 that'd be less likely to have collisions under load).

DFurnes commented 6 years ago

Deployed this to production, and confirming that this endpoint functions happily under load:

$ siege -c 30 -r 30 "https://dosome.click/p6c56"
** SIEGE 4.0.4
** Preparing 30 concurrent users for battle.
The server is now under siege...
HTTP/1.1 302     0.19 secs:     329 bytes ==> GET  /p6c56
HTTP/1.1 302     0.21 secs:     329 bytes ==> GET  /p6c56
HTTP/1.1 302     0.21 secs:     329 bytes ==> GET  /p6c56
HTTP/1.1 302     0.25 secs:     329 bytes ==> GET  /p6c56
....
HTTP/1.1 302     0.08 secs:     329 bytes ==> GET  /p6c56
HTTP/1.1 302     0.12 secs:     329 bytes ==> GET  /p6c56
HTTP/1.1 302     0.07 secs:     329 bytes ==> GET  /p6c56
HTTP/1.1 302     0.14 secs:     329 bytes ==> GET  /p6c56
HTTP/1.1 302     0.10 secs:     329 bytes ==> GET  /p6c56
HTTP/1.1 302     0.07 secs:     329 bytes ==> GET  /p6c56
HTTP/1.1 302     0.08 secs:     329 bytes ==> GET  /p6c56
HTTP/1.1 302     0.07 secs:     329 bytes ==> GET  /p6c56
HTTP/1.1 302     0.08 secs:     329 bytes ==> GET  /p6c56
HTTP/1.1 302     0.08 secs:     329 bytes ==> GET  /p6c56
HTTP/1.1 302     0.07 secs:     329 bytes ==> GET  /p6c56
HTTP/1.1 302     0.09 secs:     329 bytes ==> GET  /p6c56
HTTP/1.1 302     0.08 secs:     329 bytes ==> GET  /p6c56
HTTP/1.1 302     0.15 secs:     329 bytes ==> GET  /p6c56
HTTP/1.1 302     0.08 secs:     329 bytes ==> GET  /p6c56

Transactions:                900 hits
Availability:             100.00 %
Elapsed time:              10.98 secs
Data transferred:           0.28 MB
Response time:              0.23 secs
Transaction rate:          81.97 trans/sec
Throughput:             0.03 MB/sec
Concurrency:               18.92
Successful transactions:         900
Failed transactions:               0
Longest transaction:            6.38
Shortest transaction:           0.07