{"action":"created","issue":{"url":"https://api.github.com/repos/tpo/debian-goodies/issues/2","labels_url":"https://api.github.com/repos/tpo/debian-goodies/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/tpo/debian-goodies/issues/2/comments","events_url":"https://api.github.com/repos/tpo/debian-goodies/issues/2/events","html_url":"https://github.com/tpo/debian-goodies/pull/2","id":52308439,"number":2,"title":"POC: Checkrestart performance improvements","user":{"login":"bisscuitt","id":785224,"avatar_url":"https://avatars.githubusercontent.com/u/785224?v=3","gravatar_id":"","url":"https://api.github.com/users/bisscuitt","html_url":"https://github.com/bisscuitt","followers_url":"https://api.github.com/users/bisscuitt/followers","following_url":"https://api.github.com/users/bisscuitt/following{/other_user}","gists_url":"https://api.github.com/users/bisscuitt/gists{/gist_id}","starred_url":"https://api.github.com/users/bisscuitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bisscuitt/subscriptions","organizations_url":"https://api.github.com/users/bisscuitt/orgs","repos_url":"https://api.github.com/users/bisscuitt/repos","events_url":"https://api.github.com/users/bisscuitt/events{/privacy}","received_events_url":"https://api.github.com/users/bisscuitt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-12-17T23:52:17Z","updated_at":"2015-01-15T15:16:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/tpo/debian-goodies/pulls/2","html_url":"https://github.com/tpo/debian-goodies/pull/2","diff_url":"https://github.com/tpo/debian-goodies/pull/2.diff","patch_url":"https://github.com/tpo/debian-goodies/pull/2.patch"},"body":"This is a proof of concept to remove the requirement of `lsof` from `checkrestart`\r\n\r\n`lsof` can take a long time to return on systems with a large number of files, causing `checkrestart` to take minutes to run. `lsof` also appears to use lots of CPU resources on systems with a large number of open files:\r\n\r\n    # time checkrestart -p\r\n    Found 1 processes using old versions of upgraded files\r\n    (1 distinct program)\r\n    (1 distinct packages) \r\n    These processes do not seem to have an associated init script to restart them:\r\n    ruby1.9.1:\r\n            8408    /usr/bin/ruby1.9.1\r\n    \r\n    real    1m3.366s\r\n    user    0m33.206s\r\n    sys     0m31.298s```\r\n\r\nBy utilising `/proc/<pid>/fd` to find open files natively in python and `pmap` to find mmap'd files in processes we can significantly reduce the processing time:\r\n\r\n    # time /home/luser/checkrestart -p\r\n    Found 1 processes using old versions of upgraded files\r\n    (1 distinct program)\r\n    (1 distinct packages)\r\n    These processes do not seem to have an associated init script to restart them:\r\n    ruby1.9.1:\r\n            8408    /usr/bin/ruby1.9.1\r\n    \r\n    real    0m0.463s\r\n    user    0m0.136s\r\n    sys     0m0.144s```\r\n\r\nI've also added an option to ignore specific pids during the check. Our MySQL servers have a ton of open files and we can reduce processing by ignoring the mysql daemon completely:\r\n\r\n```/home/luser/checkrestart -p -e`cat /var/run/mysqld/mysqld.pid` ```"},"comment":{"url":"https://api.github.com/repos/tpo/debian-goodies/issues/comments/70100194","html_url":"https://github.com/tpo/debian-goodies/pull/2#issuecomment-70100194","issue_url":"https://api.github.com/repos/tpo/debian-goodies/issues/2","id":70100194,"user":{"login":"tpo","id":247241,"avatar_url":"https://avatars.githubusercontent.com/u/247241?v=3","gravatar_id":"","url":"https://api.github.com/users/tpo","html_url":"https://github.com/tpo","followers_url":"https://api.github.com/users/tpo/followers","following_url":"https://api.github.com/users/tpo/following{/other_user}","gists_url":"https://api.github.com/users/tpo/gists{/gist_id}","starred_url":"https://api.github.com/users/tpo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpo/subscriptions","organizations_url":"https://api.github.com/users/tpo/orgs","repos_url":"https://api.github.com/users/tpo/repos","events_url":"https://api.github.com/users/tpo/events{/privacy}","received_events_url":"https://api.github.com/users/tpo/received_events","type":"User","site_admin":false},"created_at":"2015-01-15T15:16:08Z","updated_at":"2015-01-15T15:16:08Z","body":"On 11 January 2015 at 19:40, Tomas Pospisek <tpo@sourcepole.ch> wrote:\n\n> Hello Ian,\n>\n> nice patch (Axel, Javier, Paul - see below).\n>\n> The little problem here is that this github repository [1], you are\n> submitting your pull request against is a fork of debian-goodies. It only\n> adds the restart-services tool to the debian-goodies package.\n>\n(...)\n\nHello Ian,\n\nIndeed you are submitting the bug to the wrong repository. If you can, I\nwould appreciate if you open a bug in Debian's Bug Tracking system against\nthe 'debian-goodies' package. I welcome you also to review the open bugs\nthere (http://bugs.debian.org/debian-goodies) and let us know if the patch\nwould also fix some other bugs (such as #758711 <758711@bugs.debian.org>,\n#717210 <717210@bugs.debian.org>, #748055 <748055@bugs.debian.org>, #751729\n<751729@bugs.debian.org>, #767332 <767332@bugs.debian.org> or #767335\n<767335@bugs.debian.org>)\n\nI did not have the time yet to review your patch, but if it does not\nintroduce new bugs, improves the load, reduces the dependency on lsof and\nfixes some of the above bugs we would certainly consider it.\n\n\nThanks and a happy new year to everybody\n> *t\n>\n\nHappy New Year to all of you too!\n\nRegards\n\nJavier"}}