How do you deal with unresponsive qubes (VMs)?

tl;dr How to fix or gracefully shut down an unresponsive qube?

I have a Fedora qube with Deluge that becomes unresponsive after a while and I have to restart it, but since I can’t detach the volume the qube had attached, Qubes sometimes stops letting me attach it again when I restart the Deluge VM. So I’m looking for a way to fix the unresponsive qube.

I can’t increase the RAM when the qube is running and I can’t find a way to kill Deluge or the offending process. I tried sudo xl console -t pv torrentVM, but it was unresponsive as well and timed out after a while. I even had to kill the xl process since it was unresponsive as well (or maybe I just don’t know to how properly close it - I tried CTRL-C and CTRL-D, but it didn’t work).

I hope the unresponsiveness is a bug with Deluge or something else that will hopefully get resolved in a few weeks, but until then I want to have a working torrent VM. I remember seeing Deluge taking up a lot of RAM a few days ago, so that’s possibly why the qube becomes unresponsive. I could try making a script that just kills Deluge when it starts taking too much RAM, but that seems brutish.

I assume that anything along the lines of qvm-run -p.... is also
unresponsive?
In that case qvm-kill is likely best option.

To detach from the xl console use <CTRL> ]

I would allocate as much RAM as you dare, and keep a console open
watching RAM use.