I have a very simple web server:
import vibe.vibe;
import std.getopt;
import std.stdio;
ushort serverPort = 8080;
int main(string[] args)
{
getopt(args, "port|p", &serverPort);
auto settings = new HTTPServerSettings;
settings.port = serverPort;
listenHTTP(settings, &handleRequest);
return runEventLoop();
}
void handleRequest(HTTPServerRequest req,
HTTPServerResponse res)
{
res.writeBody("Hello World","text/plain");
}
When I run ab against it the first time, the results look great.
But every time I rerun it, it gets worse and worse until it slows down to a crawl.
Restarting the app resets it back to its initial speed and then it slows down again.
for example "ab -n 10000 -c 20" gives me:
a) run 1: 5000 TPS
b) run 2: 2800 TPS
c) run 3: 1900 TPS
etc.
I am on latest DMD, on Mint 64-bit.
Is this a GC problem or something else altogether?
Thanks
Jacek