Once a year I feel like checking for potential (new) goto VPS offerings for small projects. This time I went with some of Hetzner's sub €10 VPSs and TLDR - they're not bad =)
- bla todo ... and explain about fgci cache, redis, mysql, php configs
"Cheap" route with small gzipped response. All ran while having a consistent MySQL backend load of ~1100qps.
- single query to small MySQL table (just over 2m rows) to fetch a single row
- result (everything within data property) is cached in Redis (10s TTL for this route)
- subsequent request go to fcgi_cache with 3s TTL first, then Redis, then fgci_cache again etc
{
"success": true,
"runtime": 0.006,
"data": {
"marketCap": 2578507436281,
"sentiment": 75
}
}
[CPX11 AMD 2-Core / 2GB RAM] € 5.18
neun@neunbox:~$ wrk -t4 -c 100 --latency https://api1.dummy.org/v1/market-cap
Running 10s test @ https://api1.dummy.org/v1/market-cap/
4 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 20.51ms 7.96ms 240.85ms 88.28%
Req/Sec 1.21k 210.71 1.61k 75.26%
Latency Distribution
50% 17.59ms
75% 21.34ms
90% 29.89ms
99% 51.65ms
47174 requests in 10.03s, 15.65MB read
Requests/sec: 4705.16
Transfer/sec: 1.56MB
[CX21 Intel 2-Core / 4GB RAM] € 6.37
neun@neunbox:~$ wrk -t4 -c 100 --latency https://api2.dummy.org/v1/market-cap
Running 10s test @ https://api2.dummy.org/v1/market-cap/
4 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 20.14ms 8.96ms 124.16ms 87.36%
Req/Sec 1.24k 319.23 1.78k 68.37%
Latency Distribution
50% 16.50ms
75% 22.03ms
90% 31.26ms
99% 54.29ms
48410 requests in 10.03s, 16.06MB read
Requests/sec: 4827.79
Transfer/sec: 1.60MB
[CPX21 AMD 3-Core / 4GB RAM] € 8.98
neun@neunbox:~$ wrk -t4 -c 100 --latency https://api3.dummy.org/v1/market-cap
Running 10s test @ https://api3.dummy.org/v1/market-cap/
4 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 18.49ms 10.32ms 253.91ms 91.54%
Req/Sec 1.36k 265.28 1.77k 71.65%
Latency Distribution
50% 15.87ms
75% 18.63ms
90% 26.91ms
99% 48.03ms
52578 requests in 10.02s, 17.45MB read
Requests/sec: 5247.69
Transfer/sec: 1.74MB
[CAX21 ARM 4-Core / 8GB RAM] € 7.72
neun@neunbox:~$ wrk -t4 -c 100 --latency https://api4.dummy.org/v1/market-cap
Running 10s test @ https://api4.dummy.org/v1/market-cap/
4 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 19.76ms 8.97ms 138.15ms 88.39%
Req/Sec 1.26k 293.43 1.76k 71.43%
Latency Distribution
50% 16.34ms
75% 21.43ms
90% 30.02ms
99% 54.96ms
49656 requests in 10.03s, 16.48MB read
Requests/sec: 4951.53
Transfer/sec: 1.64MB