I've a Debian 9 VPS set up with Apache and PHP-FPM. It connects to another VPS to access a common database server VPS via an SSH tunnel. Mostly this works fine.
Running a test for broken links imposes high load on the web server. For the first 350 or so pages, everything runs smoothly. The SSH CPU demand is about 2% and a couple of FPM processes seem to be coping. The database shows related processes, but these quickly change.
But then, for no obvious reason, the CPU for SSH goes up to around 20%. The number of FPM processes tends to increase. The web server is still responding. There are now often sleeping processes on the database server, connected to the web server.
Some while later, the server usually goes into a state where hardly anything is visibly happening. The database server shows the same five processes, usually all sleeping. The web site is extremely sluggish or times out. Yet the SSH CPU is still running at 20% to 30% or more, and the FPM processes are all taking significant CPU. I really don't know what all this CPU is doing - with nothing external to show for it.
While this is going on and the web site is at a stand still, I can still make a new connection to the database and get speedy results from queries. So the tunnel is still usable from a command line.
Throughout all this the database server seems fine, and is responding promptly to requests from other web servers.
What can be happening and why? Is this an FPM problem or an SSH problem?