Monday, Debtember 04, 2023
The Gopher Situation
Over the past few days,
I've been battling a pernicious bug in my gopher server wherein it becomes CPU bound and cause other issues on the server.
I then have to go in and kill the gopher process
(and the one time I couldn't even do that—I had to have the virtual server restarted).
I initially attributed this to an over-aggressive bot crawling my site and blocked it with iptables
but even that didn't solve the issue.
The problem is—nothing to my knowledge has changed on my virtual server, nor the server that it is running under, nor the network it's on. My Gemini server gets way more traffic than my gopher site and it's fine, and the only difference between the two is—the Gemini server uses TLS but otherwise, is nearly identical to the gopher server.
It's very odd.
The other day I added some code (in a branch, not in the main line version) to log memory usage, number of threads (technically, Lua coroutines), number of running threads, number of waiting threads, and number of active sockets. And since adding that, the gopher server has been running fine, but just now I do see a potential problem—the number of threads is two higher than the number of actual connections, which “shouldn't” happen.
Woot! I now have a lead on the problem!
But I do wonder what recently caused the issue? The code hasn't changed since April, and now I'm wondering if my Gemini server has a similar issue, since the code bases are similar in nature.