I was curious about how the server side rendering in terms of req/sec can go, dotnet and nextjs perform. So I created a simple server side rendering application in all three technologies and benchmarked them using wrk.
Golang
Golang was setup with gofiber and gotemplate. It performed well with around 14k req/sec. using minimal ram (~21mb)
10 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 34.05ms 31.00ms 119.93ms 77.11%
Req/Sec 1.40k 411.25 4.61k 68.91%
419491 requests in 30.10s, 638.89MB read
Socket errors: connect 0, read 413, write 0, timeout 0
Requests/sec: 13936.30
Transfer/sec: 21.23MB
Dotnet Razor
Dotnet razor performed well with around 11k req/sec. using a bit over idle ram (~53mb)
10 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 37.24ms 30.45ms 186.08ms 64.63%
Req/Sec 1.18k 593.27 3.09k 67.87%
351889 requests in 30.09s, 597.01MB read
Socket errors: connect 0, read 419, write 0, timeout 0
Requests/sec: 11695.17
Transfer/sec: 19.84MB
Dotnet MVC
Dotnet MVC was similar to dotnet razor with around 11k req/sec. using a bit over idle ram (~51mb)
10 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 37.46ms 31.30ms 185.38ms 69.29%
Req/Sec 1.18k 565.67 2.61k 65.66%
353636 requests in 30.10s, 618.86MB read
Socket errors: connect 0, read 333, write 0, timeout 0
Requests/sec: 11748.86
Transfer/sec: 20.56MB
Dotnet Blazor
Dotnet blazor performed with around 4.9k req/sec. using much more ram (~80mb)
10 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 80.93ms 25.94ms 185.06ms 77.09%
Req/Sec 495.58 114.60 1.00k 75.19%
148247 requests in 30.10s, 531.83MB read
Socket errors: connect 0, read 278, write 0, timeout 0
Requests/sec: 4925.94
Transfer/sec: 17.67MB
Nextjs
Nextjs performed with around 1.8k req/sec. using more ram (~80mb)
10 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 119.94ms 73.82ms 1.99s 82.30%
Req/Sec 188.81 58.71 484.00 69.59%
56352 requests in 30.09s, 512.48MB read
Socket errors: connect 0, read 389, write 0, timeout 263
Requests/sec: 1872.59
Transfer/sec: 17.03MB
Conclusion
This is just a simple benchark without much implementations, anyway it’s good to know how well these perform in terms of req/sec on a base level.
Golang and Dotnet razor, mvc performed well. with over 10k req/sec.
Wasn’t surprised to see nextjs rendering out react with less throughput.
Hoping to see blazor perform better in the future, it’s still in the early stages and looks promising overall with the server side rendering and the interactive server approach.