Where is it???

You can find the URL shortener here.

Benchmarks


These benchmarks were done locally on my Ryzen 7 mini PC using wrk (I edited /etc/hosts to point the domains to my local IP):

Reads/sec:
    $ wrk -t24 -c800 -d30s http://3iq.uk/NF
Running 30s test @ http://3iq.uk/NF
 24 threads and 800 connections
 Thread Stats   Avg      Stdev     Max   +/- Stdev
   Latency     5.78ms    7.92ms 115.55ms   88.49%
   Req/Sec     9.16k     2.38k   59.88k    74.38%
 6589850 requests in 30.10s, 22.01GB read
Requests/sec: 218947.38
Transfer/sec:    748.98MB
    
Writes/sec:
    $ wrk -t24 -c800 -d30s -spost.lua http://system.3iq.uk/submit
Running 30s test @ http://system.3iq.uk/submit
 24 threads and 800 connections
 Thread Stats   Avg      Stdev     Max   +/- Stdev
   Latency    38.25ms   35.23ms 293.85ms   51.33%
   Req/Sec     1.00k   142.66     2.10k    70.68%
 718570 requests in 30.07s, 102.65MB read
Requests/sec:  23896.89
Transfer/sec:      3.41MB
    

The VPS that I'm using to host this service though only has a few vcores so will not provide anywhere near that much reads/writes per second.

Memory usage


Without any URLs stored it uses around 180 mibibytes of memory:
Number of temporary URLs: 0
Number of permanent URLs: 10
Memory usage (from systemctl status): 175.5M
Actual memory usage (from ps -o rss) (in mibibytes): 178.3M
    

With 1 million temporary URLs stored (temporary URLs use up more memory than permanent URLs because there is an expiry time associated, plus a copy of the key and expiry time are placed on a priority queue so they can be efficiently removed when they expire):
Number of temporary URLs: 1000642
Number of permanent URLs: 0
Memory usage (from systemctl status): 2.2G
Actual memory usage (from ps -o rss) (in mibibytes): 402.2M
    

Misc

Future todo list


Click here to go to my home page