systemctl completion is slow

Bug #1471723 reported by Serhiy
50
This bug affects 11 people
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Every time I'm trying to autocomplete some service name for systemctl command it takes up to 5 seconds to do it.

AFAIU the file is /usr/share/bash-completion/completions/systemctl but I haven't read it yet.

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: bash-completion 1:2.1-4ubuntu1
ProcVersionSignature: Ubuntu 3.19.0-21.21-generic 3.19.8
Uname: Linux 3.19.0-21-generic x86_64
ApportVersion: 2.17.2-0ubuntu1.1
Architecture: amd64
CurrentDesktop: KDE
Date: Mon Jul 6 12:33:40 2015
PackageArchitecture: all
SourcePackage: bash-completion
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Serhiy (xintx-ua) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in bash-completion (Ubuntu):
status: New → Confirmed
Revision history for this message
Evgeny Markov (evgenymarkov) wrote :

This bug appears in journalctl too. I observe this behavior in every distro.

Revision history for this message
Evgeny Markov (evgenymarkov) wrote :

So.. In latest Ubuntu 16.04 i see big improvements in systemd completion speed. It works almost instantly.

Changed in bash-completion (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Behrooz Amoozad (behrooz0az) wrote :

same here, it's much much worse than ubuntu(17.10) in archlinux. I don't know what is different there but it might give you some clue if you do know.

Revision history for this message
Brandon Bell (brandonbell) wrote :

I suppose it depends on your definition of 'instantly'. While it doesn't always take 5+ seconds for me, it does take around 3 seconds and sometimes longer in Bionic (18.04.1 LTS).

Any other completion on my system happens in an estimated 25-100ms. Even completing 'apt-cache show', which returns over 64,000 results, still happens in less than a quarter second.

So I don't consider this issue resolved.

Serhiy (xintx-ua)
Changed in bash-completion (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Damiön la Bagh (kat-amsterdam) wrote :

When is the fix going to be released? 18.04.1LTS takes still around 10 seconds to complete after

sudo systemctl start nameofser{TAB}

Revision history for this message
Eliezer Croitoru (eliezer) wrote :

A fix and enhancement was submitted at:
https://github.com/systemd/systemd/issues/7185#issuecomment-455410941

and seems to improve this a lot..
The main issue is with `systemctl start <TAB>` and the results can be seen for a search like:
`systemctl start apac<TAB>`.

Revision history for this message
halfgaar (wiebe-halfgaar) wrote :

For me the main issue is 'journalctl -u <TAB>'. Not always, but often this takes very long. I just time a run of 38 seconds, on a 8 core 32GB machine. A process called 'journalctl -F _SYSTEMD_UNIT' takes 100% CPU doing it.

If systemd is going to replace traditional rotated log files where you can just do 'cat logfile|grep', this kind of thing should really be fixed.

Revision history for this message
halfgaar (wiebe-halfgaar) wrote :

It gets worse. On one particular server, 'journalctl -u <tab>' takes an infinite amount of time. 'journalctl -F _SYSTEMD_UNIT' prints out lines like this forever:

session-1033145.scope
session-1033143.scope
session-1033140.scope
session-1033138.scope
session-1033136.scope

See it in action:

https://files.halfgaar.net/permanent/2022-07/20220720_1016_journalctl_tab_hang_launchpad_1471723.mp4

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.