Score:0

Why did the SSH API of my Jenkins instance get so slow?

us flag

Accessing my Jenkins 2.319.1 instance via SSH get very slow a few days ago. I don't know what changed.

To narrow it down: Accessing Jenkins via HTTPS API is OK. The performance of the Web API is OK, too.

$ java -jar jenkins-cli.jar -s https://my-jenkins-server help # ~3s => OK

However, with the SSH API:

$ java -jar jenkins-cli.jar -s https://my-jenkins-server -ssh -i ~/.ssh/id_rsa -user my-user-name help
Jan 23, 2023 6:18:48 PM io.jenkins.cli.shaded.org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar getOrCreateProvider
INFO: getOrCreateProvider(EdDSA) created instance of io.jenkins.cli.shaded.net.i2p.crypto.eddsa.EdDSASecurityProvider
Jan 23, 2023 6:18:49 PM io.jenkins.cli.shaded.org.apache.sshd.common.io.DefaultIoServiceFactoryFactory getIoServiceProvider
INFO: No detected/configured IoServiceFactoryFactory using Nio2ServiceFactoryFactory
Jan 23, 2023 6:18:49 PM io.jenkins.cli.shaded.org.apache.sshd.client.config.hosts.ConfigFileHostEntryResolver reloadHostConfigEntries
INFO: resolveEffectiveResolver([email protected]:50022) loaded 1 entries from /home/my-user-name/.ssh/config
io.jenkins.cli.shaded.org.apache.sshd.common.SshException: DefaultAuthFuture[ssh-connection]: Failed to get operation result within specified timeout: 10000
        at io.jenkins.cli.shaded.org.apache.sshd.common.future.AbstractSshFuture.formatExceptionMessage(Abstrac[..]

To work around the timeout of jenkins-cli.jar and to get more output, I use raw ssh:

ssh -v -a -x my-jenkins-server -l my-username -p 50022 help # 10 to 60 seconds

10 to 60 seconds for a simple help call! Same for who-am-i!

The debug output tells me that the SSH API of Jenkins stalls after some requests of the SSH client. Here is the interesting part of ssh ... |& ts -i:

00:00:00 debug1: Next authentication method: publickey
00:00:00 debug1: Offering RSA public key: /home/my-username/.ssh/id_rsa
00:00:05 debug1: Server accepts key: pkalg ssh-rsa blen 407
00:00:04 debug1: Authentication succeeded (publickey).
00:00:00 Authenticated to my-jenkins-server.
00:00:00 debug1: channel 0: new [client-session]
00:00:00 debug1: Entering interactive session.
00:00:00 debug1: pledge: network
00:00:00 debug1: Sending environment.
00:00:00 debug1: Sending env LC_PAPER = de_DE
00:00:00 debug1: Sending env LANG = C
00:00:00 debug1: Sending env LC_CTYPE = en_US.UTF-8
00:00:00 debug1: Sending command: help
00:00:04   add-job-to-view
00:00:00     Adds jobs to view.
[more help output]

Any idea about the performance issue of the SSH API?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.