{"action":"closed","issue":{"url":"https://api.github.com/repos/astro/node-collectdout/issues/10","repository_url":"https://api.github.com/repos/astro/node-collectdout","labels_url":"https://api.github.com/repos/astro/node-collectdout/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/astro/node-collectdout/issues/10/comments","events_url":"https://api.github.com/repos/astro/node-collectdout/issues/10/events","html_url":"https://github.com/astro/node-collectdout/issues/10","id":168489417,"number":10,"title":"Extra zero padding on collectd packets","user":{"login":"jhenry82","id":2539113,"avatar_url":"https://avatars.githubusercontent.com/u/2539113?v=3","gravatar_id":"","url":"https://api.github.com/users/jhenry82","html_url":"https://github.com/jhenry82","followers_url":"https://api.github.com/users/jhenry82/followers","following_url":"https://api.github.com/users/jhenry82/following{/other_user}","gists_url":"https://api.github.com/users/jhenry82/gists{/gist_id}","starred_url":"https://api.github.com/users/jhenry82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhenry82/subscriptions","organizations_url":"https://api.github.com/users/jhenry82/orgs","repos_url":"https://api.github.com/users/jhenry82/repos","events_url":"https://api.github.com/users/jhenry82/events{/privacy}","received_events_url":"https://api.github.com/users/jhenry82/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-30T22:08:21Z","updated_at":"2016-07-31T11:01:26Z","closed_at":"2016-07-31T11:01:26Z","body":"I recently deployed the CollectM project (https://github.com/perfwatcher/collectm), which embeds your library, on our Windows servers. I found that after a period of time ranging from minutes to hours, the remote collectd server being written to would start consuming all available memory before finally being nuked by the OOM killer. Which is obviously a horrible bug on the main collectd project's part, but I wanted to see what was different about the traffic coming from node-collectdout to trigger it.\r\n\r\nThe remote server is currently running collectd 5.4.2 and has been handling about 600 Linux clients with no issue for years. As soon as we added the Windows client (using node-collectdout), the problem surfaced. I disabled the 15 or so Windows clients, and it immediately stabilized. \r\n\r\nI captured the traffic between the collectd server and a Windows client, and Wireshark's collectd parser flagged every packet as invalid. Due to a bunch of 0x00 bytes at the end. Looking at the code, it sends a 1024 byte payload every time, regardless of the actual length of the data. A bunch of zeroes are sent after the end of the data to fill out the packet.\r\n\r\nI modified the code to match the packet size to the data. Since deploying that patch, the server has been running with zero issues. I'll submit a pull request shortly. nodejs is definitely not my \"native language\" so I'm open to suggestions on how to do this differently.\r\n\r\nEven if collectd fixes their server to handle this better, it's still preferable not to send hundreds of bytes of pointless zeroes. Not a big deal in the era of 10 gig ethernet, but still :)"}}
{"actor":{"display_login":"astro"}}