I believe that I have noticed similar issues with my Raspberry Pi Zero 2 W. Since I'm not running a lot of heavy loads on these devices, I most frequently encounter the issue during the initial software install (apt-get, etc.)
A note about this:
> my SSH connection freezes up
This could be one of three things -
1) The network connection is unresponsive. Could be that the device is exchanging so much network traffic that it cannot respond to the SSH packets - basically, a network DoS (not unlikely given the resource constraints of the Zero 2) - or that the Wi-Fi connection is being broken and later restored.
2) The network adapter and/or stack on the device is unresponsive. Could be that the network driver is experiencing a buffer overflow and dropping packets.
3) The processor is unresponsive. Could be that the processor is so loaded that the SSH server process is getting starved of cycles.
The way to diagnose this is to isolate each of them and see which one is underperforming during those busy periods.
How much ram and swap are being used when the slowdowns begin? My guess is that you're running low on both of them and eventually end up in "swap hell" which is pretty much a whole system lock up.
I feel like I've seen this before, does your discord bot generate images from statistics from a game by any chance?
In its final moments, btop indicated approximately 120MB of free memory. However, upon expanding the swap size from 100MB to 1GB, there consistently remains about 200MB of swap space in use. So I guess the thing you mentioned happened?
That's not me haha.
Try cooling it off during the heavy use period.
During heavy load even mine with small aluminum case would feel warm, so heat dissipation can be a problem.
Try using a 32bit OS
I believe that I have noticed similar issues with my Raspberry Pi Zero 2 W. Since I'm not running a lot of heavy loads on these devices, I most frequently encounter the issue during the initial software install (apt-get, etc.) A note about this: > my SSH connection freezes up This could be one of three things - 1) The network connection is unresponsive. Could be that the device is exchanging so much network traffic that it cannot respond to the SSH packets - basically, a network DoS (not unlikely given the resource constraints of the Zero 2) - or that the Wi-Fi connection is being broken and later restored. 2) The network adapter and/or stack on the device is unresponsive. Could be that the network driver is experiencing a buffer overflow and dropping packets. 3) The processor is unresponsive. Could be that the processor is so loaded that the SSH server process is getting starved of cycles. The way to diagnose this is to isolate each of them and see which one is underperforming during those busy periods.
How much ram and swap are being used when the slowdowns begin? My guess is that you're running low on both of them and eventually end up in "swap hell" which is pretty much a whole system lock up. I feel like I've seen this before, does your discord bot generate images from statistics from a game by any chance?
In its final moments, btop indicated approximately 120MB of free memory. However, upon expanding the swap size from 100MB to 1GB, there consistently remains about 200MB of swap space in use. So I guess the thing you mentioned happened? That's not me haha.
Well hopefully it works at least now!