webminer icon indicating copy to clipboard operation
webminer copied to clipboard

bench_webcash fails with "server_bench.cc:81: void Server_stats(benchmark::State&): Assertion `r->status == 200' failed."

Open jokpine opened this issue 3 years ago • 1 comments

jokpine avatar May 30 '22 19:05 jokpine

Well this is embarrassing. It seems the benchmarks weren't actually working. I forgot that asserts are disabled in optimized mode (and why would you run benchmarks without optimizations?), so I didn't notice. The database wasn't being setup for the benchmark, and there were a few other logic errors as well, so all I was really testing was how quickly the server could serve 500 internal server errors. As it turns out, drogon is pretty fast at that!

Now I've got it fixed, but unfortunately it doesn't seem to want to serve concurrent requests at all. More than one thread spamming the server results in sqlite database timeouts. I'm not sure why this is, to be honest, as I would expect the threads to be handled in a round-robin fashion. For now I've disabled the multithreaded benchmarks, and it might be better use of time to just port to Postgres instead of trying to get concurrent sqlite requests working.

maaku avatar May 31 '22 22:05 maaku