Uptime Monitoring Part 2: Electric Boogaloo (False Positives)
So when setting up my uptime monitor I was noticing there were false positives happening about every 8 to 12 hours. I am on shared hosting so that may have been why, but it was strange.
I ended up asking some peeps on the discord and made a ticket, and eventually I got the owner saying that it was possibly due to an nproc limit being hit. I couldn’t see it in the monitor
but there were several threads called libuv-worker and all together there were about 50 threads. The limit is 50, but this was really strange for having a basic uptime monitor running.
I look into this, and it turns out this is a thing node uses for async work but by default there is meant to be 4. I even look into the code and nothing should be changing it. But these servers are running on CPUs with 96c/192t cpus so something may have been funky.
So I looked more into and I can set UV_THREADPOOL_SIZE to a value and force it. I set it to 2 to be reasonable and... It worked!
But it seems after a bit it decided to spawn two extra threads and become 4 but it is still way more in line at ~20 threads and using less memory.
There should not be any more false positive on the status page hopefully. It's been about a day or two without any so and I have disabled retries so we should be all good!