{"action":"created","issue":{"url":"https://api.github.com/repos/systemd/systemd/issues/2460","repository_url":"https://api.github.com/repos/systemd/systemd","labels_url":"https://api.github.com/repos/systemd/systemd/issues/2460/labels{/name}","comments_url":"https://api.github.com/repos/systemd/systemd/issues/2460/comments","events_url":"https://api.github.com/repos/systemd/systemd/issues/2460/events","html_url":"https://github.com/systemd/systemd/issues/2460","id":129440515,"number":2460,"title":"Showing status of service via systemctl is slow (>10s)  if disk journal is used","user":{"login":"XANi","id":147394,"avatar_url":"https://avatars.githubusercontent.com/u/147394?v=3","gravatar_id":"","url":"https://api.github.com/users/XANi","html_url":"https://github.com/XANi","followers_url":"https://api.github.com/users/XANi/followers","following_url":"https://api.github.com/users/XANi/following{/other_user}","gists_url":"https://api.github.com/users/XANi/gists{/gist_id}","starred_url":"https://api.github.com/users/XANi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XANi/subscriptions","organizations_url":"https://api.github.com/users/XANi/orgs","repos_url":"https://api.github.com/users/XANi/repos","events_url":"https://api.github.com/users/XANi/events{/privacy}","received_events_url":"https://api.github.com/users/XANi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/systemd/systemd/labels/journal","name":"journal","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-01-28T12:42:40Z","updated_at":"2016-10-01T17:52:20Z","closed_at":null,"body":"With big (4GB, few months of logs) on-disk journal, `systemctl status service` becomes very slow\r\n\r\n\r\n\r\n     (!) [13:37:30]:/var/log/journal☠ time  systemctl status nginx\r\n    * nginx.service - A high performance web server and a reverse proxy server\r\n       Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)\r\n       Active: active (running) since Thu 2016-01-28 08:25:28 CET; 5h 12min ago\r\n     Main PID: 3414 (nginx)\r\n       CGroup: /system.slice/nginx.service\r\n               |-3414 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;\r\n               |-3415 nginx: worker process\r\n               |-3416 nginx: worker process\r\n               |-3417 nginx: worker process\r\n               `-3418 nginx: worker process\r\n\r\n    Jan 28 08:25:12 ghroth systemd[1]: Starting A high performance web server and a reverse proxy server...\r\n    Jan 28 08:25:28 ghroth systemd[1]: Started A high performance web server and a reverse proxy server.\r\n\r\n    real\t0m12.505s\r\n    user\t0m0.016s\r\n    sys\t0m0.056s\r\n     (!) [13:35:14]:/var/log/journal☠ du -h --max=1\r\n    4,2G\t./46feef66e59512fcd99c7ddc00000108\r\n    4,2G\t.\r\n     (!) [13:40:53]:/var/log/journal☠ strace systemctl status nginx 2>&1 |grep open |grep /var/log |wc -l\r\n    88\r\n\r\n\r\nit is of course faster after it gets to cache... for that service, querying other one is still slow.\r\n\r\nDunno what would be right way to do it.. but opening ~80 log files to just display service status seems a bit excessive\r\n"},"comment":{"url":"https://api.github.com/repos/systemd/systemd/issues/comments/250926577","html_url":"https://github.com/systemd/systemd/issues/2460#issuecomment-250926577","issue_url":"https://api.github.com/repos/systemd/systemd/issues/2460","id":250926577,"user":{"login":"davispuh","id":651800,"avatar_url":"https://avatars.githubusercontent.com/u/651800?v=3","gravatar_id":"","url":"https://api.github.com/users/davispuh","html_url":"https://github.com/davispuh","followers_url":"https://api.github.com/users/davispuh/followers","following_url":"https://api.github.com/users/davispuh/following{/other_user}","gists_url":"https://api.github.com/users/davispuh/gists{/gist_id}","starred_url":"https://api.github.com/users/davispuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davispuh/subscriptions","organizations_url":"https://api.github.com/users/davispuh/orgs","repos_url":"https://api.github.com/users/davispuh/repos","events_url":"https://api.github.com/users/davispuh/events{/privacy}","received_events_url":"https://api.github.com/users/davispuh/received_events","type":"User","site_admin":false},"created_at":"2016-10-01T17:52:20Z","updated_at":"2016-10-01T17:52:20Z","body":"I think some kind of journal indexing is required because it's unbearably slow.\r\n\r\nRight now I've 5411 (43 GiB) journal files and\r\n\r\n```bash\r\n$ time -p journalctl -b --no-pager > /dev/null\r\nreal 13.61\r\nuser 13.37\r\nsys 0.22\r\n```\r\n\r\nit takes 13 seconds to just check current boot log while it's already cached in RAM.\r\n\r\nWhen it's not cached\r\n\r\n```\r\n# echo 3 > /proc/sys/vm/drop_caches\r\n$ time -p journalctl -b --no-pager > /dev/null\r\nreal 69.29\r\nuser 13.51\r\nsys 12.34\r\n```\r\n\r\nthis is on 2x 3TB HDD with RAID1 btrfs.\r\n"}}
{"actor":{"display_login":"davispuh"}}