sometimes i end up with way too many rust-analyzer instances running, and the obvious solution is to just pkill rust-analyzer, but eglot will simply go "oh, the language server crashed, i should restart it"
What about using M-x eglot-shutdown or M-x eglot-shutdown-all.
If Emacs is starting to many rust-analyzer's due to browsing dependencies with go to definition, then you can have eglot reuse the same rust analyzer instance.
that could work if i catch the degrading performance early enough, but due to the singlethreaded nature of emacs, it has pretty poor performance on an overloaded system.
I actually tried the pkill rust-analyzer on my setup and... Eglot did not restart rust-analyzer. However, opening a new file with rust mode did trigger my (add-hook 'rust-mode #'eglot-ensure)
which started up a new rust-analyzer instance.
On my setup, I could run M-x remove-hookrust-mode-hookeglot-ensure to stop this behavior for the rest of the session.