[opensuse] systemctl command line completion is very slow
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Suppose I type: systemctl status smart[tab][tab] and I get nothing. One second, two seconds... so I insist and hit tab several times, and after several seconds I get (one line per second): Isengard:~ # systemctl status smart smartcard.target smartd.service smartd_generate_opts.path smartd_generate_opts.service Isengard:~ # systemctl status smart smartcard.target smartd.service smartd_generate_opts.path smartd_generate_opts.service Isengard:~ # systemctl status smart smartcard.target smartd.service smartd_generate_opts.path smartd_generate_opts.service Isengard:~ # systemctl status smart and then I can type "d" and enter. Why is it that slow? It is an M2 disk. ie, SSD technology. It responds instantly when completing a normal command: Isengard:~ # smart smart_agetty smartctl smartd Isengard:~ # smart And that system is not busy at all, load 0.20 - -- Cheers Carlos E. R. (from 15.1 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXbWH4Bwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVGVsAn0iKRPoFDlOYkwmj9Y7r OFv4Mt0qAJ9IUPwXKdECRzNyJaD5HiR1dZU6Yg== =lB6T -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Sun, 27 Oct 2019 13:04:48 +0100 (CET) "Carlos E. R." <robin.listas@telefonica.net> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Suppose I type:
systemctl status smart[tab][tab]
and I get nothing. One second, two seconds... so I insist and hit tab several times, and after several seconds I get (one line per second):
FWIW I get nothing either, and no matter how many times I hit TAB I still get nothing. Consider yourself lucky! :)
Isengard:~ # systemctl status smart smartcard.target smartd.service smartd_generate_opts.path smartd_generate_opts.service Isengard:~ # systemctl status smart smartcard.target smartd.service smartd_generate_opts.path smartd_generate_opts.service Isengard:~ # systemctl status smart smartcard.target smartd.service smartd_generate_opts.path smartd_generate_opts.service Isengard:~ # systemctl status smart
and then I can type "d" and enter.
Why is it that slow? It is an M2 disk. ie, SSD technology. It responds instantly when completing a normal command:
Isengard:~ # smart smart_agetty smartctl smartd Isengard:~ # smart
And that system is not busy at all, load 0.20
- -- Cheers
Carlos E. R. (from 15.1 x86_64 at Telcontar)
-----BEGIN PGP SIGNATURE-----
iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXbWH4Bwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVGVsAn0iKRPoFDlOYkwmj9Y7r OFv4Mt0qAJ9IUPwXKdECRzNyJaD5HiR1dZU6Yg== =lB6T -----END PGP SIGNATURE-----
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday, 2019-10-27 at 20:43 -0000, Dave Howorth wrote:
On Sun, 27 Oct 2019 13:04:48 +0100 (CET) "Carlos E. R." <> wrote:
Suppose I type:
systemctl status smart[tab][tab]
and I get nothing. One second, two seconds... so I insist and hit tab several times, and after several seconds I get (one line per second):
FWIW I get nothing either, and no matter how many times I hit TAB I still get nothing. Consider yourself lucky! :)
Ok, then try one that you do have. For instance, systemctl status post[tab][tab] after a few seconds, it autocompletes to: systemctl status postfix.service Why not instantly? It is an SSD drive. - -- Cheers, Carlos E. R. (from openSUSE 15.1 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXbY9cxwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVARsAmgLzFMs5B0u3Jwg+lfqr 0n3oPkbxAJwLNISwTIttnr2iCGgbzbuu5z/F8Q== =o708 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
* Carlos E. R. <robin.listas@telefonica.net> [10-27-19 21:01]:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Sunday, 2019-10-27 at 20:43 -0000, Dave Howorth wrote:
On Sun, 27 Oct 2019 13:04:48 +0100 (CET) "Carlos E. R." <> wrote:
Suppose I type:
systemctl status smart[tab][tab]
and I get nothing. One second, two seconds... so I insist and hit tab several times, and after several seconds I get (one line per second):
FWIW I get nothing either, and no matter how many times I hit TAB I still get nothing. Consider yourself lucky! :)
Ok, then try one that you do have. For instance,
systemctl status post[tab][tab]
after a few seconds, it autocompletes to:
systemctl status postfix.service
Why not instantly? It is an SSD drive.
fwiw: My Tw system responds instantly. -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet freenode -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Carlos E. R. wrote:
systemctl status post[tab][tab]
after a few seconds, it autocompletes to:
systemctl status postfix.service
Why not instantly? It is an SSD drive.
I doubt if it has anything to do with any disk drive. On 42.3 (xen guest with virtual drive on scsi raid), systemctl command line completion seems reasonably fast, less than 1 second certainly. On 15.1, 2-3-4 seconds. (root on nfs, otherwise iscsi). On 12.3, (root on nfs, otherwise iscsi) - very fast, instantaneous. I agree it is very slow on 15.1. To investigate, you could try running an strace from another shell. -- Per Jessen, Zürich (12.8°C) http://www.hostsuisse.com/ - dedicated server rental in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 28/10/2019 07.54, Per Jessen wrote:
Carlos E. R. wrote:
systemctl status post[tab][tab]
after a few seconds, it autocompletes to:
systemctl status postfix.service
Why not instantly? It is an SSD drive.
I doubt if it has anything to do with any disk drive. On 42.3 (xen guest with virtual drive on scsi raid), systemctl command line completion seems reasonably fast, less than 1 second certainly. On 15.1, 2-3-4 seconds. (root on nfs, otherwise iscsi). On 12.3, (root on nfs, otherwise iscsi) - very fast, instantaneous.
I agree it is very slow on 15.1. To investigate, you could try running an strace from another shell.
On that machine (Isengard) it was slow also on 15.0, but this machine (Telcontar) was "normal", I think. Now this machine is also slow, even slower. Sometime ago, I saw a flurry of syslog messages when I did the tab-tab thing. Apparently something was exploring the disk. strace on what process? Google "systemctl completion" autocompletes to "slow". There is a redhat bugzilla, another issue on github, another bug on launchpad... The redhat bugzilla was attempted to be closed several times for bureaucratic reasons (end of life), but after two years they got a possible patch, then another attempt to close the bug... Problem: bash completion of systemctl command is very slow or totally hanged up for minutes in case of a great number of systemd units (>250). Reason: Completion routines calls systemctl as times as many systemd units exist. Solution: Patch file I don't think I'm going to try trace, this is far above me this time. The problem is known worldwide. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Carlos E.R. wrote:
strace on what process?
The shell.
Google "systemctl completion" autocompletes to "slow". There is a redhat bugzilla, another issue on github, another bug on launchpad...
Ah, very interesting.
I don't think I'm going to try trace, this is far above me this time. The problem is known worldwide.
Okay, so maybe a patch is already underway to 15.1 - Patrick wrote he had no problem on TW. -- Per Jessen, Zürich (13.5°C) http://www.dns24.ch/ - your free DNS host, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 28/10/2019 13.07, Per Jessen wrote:
Carlos E.R. wrote:
strace on what process?
The shell.
Google "systemctl completion" autocompletes to "slow". There is a redhat bugzilla, another issue on github, another bug on launchpad...
Ah, very interesting.
I don't think I'm going to try trace, this is far above me this time. The problem is known worldwide.
Okay, so maybe a patch is already underway to 15.1 - Patrick wrote he had no problem on TW.
I'll try bugzilla. "search" does not find duplicates. Bug 1155207. Amazing! There is still no systemd component. - -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXbb1PAAKCRC1MxgcbY1H 1XMUAKCR7j9rfCQIkiRSrqcvuJfTJcmeMQCeNRxx71jfkysrx5VrLeY3EiBXVtM= =IsKP -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2019/10/28 02:37, Carlos E.R. wrote:
On 28/10/2019 07.54, Per Jessen wrote:
I agree it is very slow on 15.1. To investigate, you could try running an strace from another shell.
For bash, it would be far more 'profitable' to set PS4 and "-x" and then try the completion. It will still generate a huge amount of output. When I'm debugging shell, I use PS4 set to:
echo "$PS4" ${BASH_SOURCE:+${BASH_SOURCE/$HOME/\~}}#${LINENO}${FUNCNAME:+(${FUNCNAME})}>
That gives you the source file and line number as well as what function it is in.
Problem: bash completion of systemctl command is very slow or totally hanged up for minutes in case of a great number of systemd units (>250). Reason: Completion routines calls systemctl as times as many systemd units exist. Solution: Patch file
In comparison, to scan through the kernel modules (>500) and filter out ones that are already loaded (~55) and offer the rest as possible completions takes less than a second: Try:
modprobe<space><tab>: ---i.e.: modprobe Display all 494 possibilities? (y or n) ...
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 31/10/2019 11.02, L A Walsh wrote:
On 2019/10/28 02:37, Carlos E.R. wrote:
On 28/10/2019 07.54, Per Jessen wrote:
I agree it is very slow on 15.1. To investigate, you could try running an strace from another shell.
For bash, it would be far more 'profitable' to set PS4 and "-x" and then try the completion. It will still generate a huge amount of output.
When I'm debugging shell, I use PS4 set to:
echo "$PS4" ${BASH_SOURCE:+${BASH_SOURCE/$HOME/\~}}#${LINENO}${FUNCNAME:+(${FUNCN AME})}>
That gives you the source file and line number as well as what function it is in.
Too complex for me... Not the setting it up, but understanding what it prints then.
Problem: bash completion of systemctl command is very slow or totally hanged up for minutes in case of a great number of systemd units (>250). Reason: Completion routines calls systemctl as times as many systemd units exist. Solution: Patch file
In comparison, to scan through the kernel modules (>500) and filter out ones that are already loaded (~55) and offer the rest as possible completions takes less than a second:
Try:
modprobe<space><tab>: ---i.e.: modprobe
Display all 494 possibilities? (y or n) ...
Wow! Well, there is a bugzilla now, so the ball is not in my park. - -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXbrM1wAKCRC1MxgcbY1H 1RGEAJ9BthIPkzJYux7J43wDr0ZSm+LLKwCfT7O6f1J5+mB7iJFrzwZeZ+J7it0= =QLJm -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
* Carlos E. R. <robin.listas@telefonica.net> [10-31-19 08:02]:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 31/10/2019 11.02, L A Walsh wrote:
On 2019/10/28 02:37, Carlos E.R. wrote:
On 28/10/2019 07.54, Per Jessen wrote:
I agree it is very slow on 15.1. To investigate, you could try running an strace from another shell.
[...]
Too complex for me... Not the setting it up, but understanding what it prints then.
Problem: bash completion of systemctl command is very slow or totally hanged up for minutes in case of a great number of systemd units (>250). Reason: Completion routines calls systemctl as times as many systemd units exist. Solution: Patch file
In comparison, to scan through the kernel modules (>500) and filter out ones that are already loaded (~55) and offer the rest as possible completions takes less than a second:
Try:
modprobe<space><tab>: ---i.e.: modprobe
Display all 494 possibilities? (y or n) ...
Wow!
Well, there is a bugzilla now, so the ball is not in my park.
why not? you are quite able to support and contribute to *any* bug report, not just others that volunteer to do so. -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet freenode -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 31/10/2019 14.00, Patrick Shanahan wrote:
* Carlos E. R. <> [10-31-19 08:02]:
On 31/10/2019 11.02, L A Walsh wrote:
On 2019/10/28 02:37, Carlos E.R. wrote:
On 28/10/2019 07.54, Per Jessen wrote:
...
Well, there is a bugzilla now, so the ball is not in my park.
why not? you are quite able to support and contribute to *any* bug report, not just others that volunteer to do so.
Nope. I know next to nothing about the issue, I can not contribute. When some contributor ask me to do some test, submit some further information, that of course I will do. The ball to ask those questions is not in my park. - -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXbri4AAKCRC1MxgcbY1H 1RIwAJ4lm6lvMmKx+fXGrp5460OzwKD2bgCdEosREvicSoIawKXBHSTZtwieIcg= =W7Kv -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Monday, 28 October 2019 00:59:31 GMT Carlos E. R. wrote:
On Sunday, 2019-10-27 at 20:43 -0000, Dave Howorth wrote:
On Sun, 27 Oct 2019 13:04:48 +0100 (CET) "Carlos E. R." <> wrote:
Suppose I type:
systemctl status smart[tab][tab]
and I get nothing. One second, two seconds... so I insist and hit tab several times, and after several seconds I get (one line per second):
FWIW I get nothing either, and no matter how many times I hit TAB I still get nothing. Consider yourself lucky! :)
Ok, then try one that you do have. For instance,
systemctl status post[tab][tab]
after a few seconds, it autocompletes to:
mine is a little slow if using your example and there are more than one statuses to show, eg. postfix and postgres. But if i change to systemctl status postg[tab][tab] then its fast. my system is on a SSD too.
systemctl status postfix.service
Why not instantly? It is an SSD drive.
-- Cheers, Carlos E. R. (from openSUSE 15.1 x86_64 at Telcontar)
-- opensuse:tumbleweed:20191023 Qt: 5.13.1 KDE Frameworks: 5.63.0 - KDE Plasma: 5.17.0 - kwin 5.17.0 kmail2 5.12.2 - akonadiserver 5.12.2 - Kernel: 5.3.6-1-default - xf86-video-nouveau: 1.0.15 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Mon, 28 Oct 2019 01:59:31 +0100 (CET) "Carlos E. R." <robin.listas@telefonica.net> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Sunday, 2019-10-27 at 20:43 -0000, Dave Howorth wrote:
On Sun, 27 Oct 2019 13:04:48 +0100 (CET) "Carlos E. R." <> wrote:
Suppose I type:
systemctl status smart[tab][tab]
and I get nothing. One second, two seconds... so I insist and hit tab several times, and after several seconds I get (one line per second):
FWIW I get nothing either, and no matter how many times I hit TAB I still get nothing. Consider yourself lucky! :)
Ok, then try one that you do have. For instance,
$ systemctl status smartd ● smartd.service - Self Monitoring and Reporting Technology (SMART) Daemon Loaded: loaded (/usr/lib/systemd/system/smartd.service; enabled; vendor preset:> Active: active (running) since Sun 2019-07-28 00:16:43 BST; 3 months 1 days ago Docs: man:smartd(8) man:smartd.conf(5) Main PID: 1305 (smartd) Tasks: 1 (limit: 4915) CGroup: /system.slice/smartd.service └─1305 /usr/sbin/smartd -n Warning: Journal has been rotated since unit was started. Log output is incomplete> That's the point. I do have smartd.service. What I don't have is autocompletion.
systemctl status post[tab][tab]
after a few seconds, it autocompletes to:
systemctl status postfix.service
Why not instantly? It is an SSD drive.
- -- Cheers, Carlos E. R. (from openSUSE 15.1 x86_64 at Telcontar)
-----BEGIN PGP SIGNATURE-----
iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXbY9cxwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVARsAmgLzFMs5B0u3Jwg+lfqr 0n3oPkbxAJwLNISwTIttnr2iCGgbzbuu5z/F8Q== =o708 -----END PGP SIGNATURE-----
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
27.10.2019 13:04, Carlos E. R. пишет:
Suppose I type:
systemctl status smart[tab][tab]
and I get nothing. One second, two seconds... so I insist and hit tab several times, and after several seconds I get (one line per second): [...]
Just FYI, with zsh and zsh grml config [0] the completion is instant. It is probably bash or bash configuration to blame. [0] <https://grml.org/zsh/#grmlzshconfig> -- Regards, Oleksii Vilchanskyi -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2019/10/28 13:38:59 +0100, Oleksii Vilchanskyi wrote:
27.10.2019 13:04, Carlos E. R. пишет:
Suppose I type:
systemctl status smart[tab][tab]
and I get nothing. One second, two seconds... so I insist and hit tab several times, and after several seconds I get (one line per second): [...]
Just FYI, with zsh and zsh grml config [0] the completion is instant. It is probably bash or bash configuration to blame.
No it is not as the completion is from systemd upstream, sigh! Run rpm -qf /usr/share/bash-completion/completions/systemctl and see. Werner -- "Having a smoking section in a restaurant is like having a peeing section in a swimming pool." -- Edward Burr
participants (9)
-
Carlos E. R.
-
Carlos E.R.
-
Dave Howorth
-
Dr. Werner Fink
-
Ianseeks
-
L A Walsh
-
Oleksii Vilchanskyi
-
Patrick Shanahan
-
Per Jessen