{"action":"created","issue":{"url":"https://api.github.com/repos/zettio/weave/issues/204","labels_url":"https://api.github.com/repos/zettio/weave/issues/204/labels{/name}","comments_url":"https://api.github.com/repos/zettio/weave/issues/204/comments","events_url":"https://api.github.com/repos/zettio/weave/issues/204/events","html_url":"https://github.com/zettio/weave/issues/204","id":49273929,"number":204,"title":"data compression","user":{"login":"inercia","id":1841612,"avatar_url":"https://avatars.githubusercontent.com/u/1841612?v=3","gravatar_id":"","url":"https://api.github.com/users/inercia","html_url":"https://github.com/inercia","followers_url":"https://api.github.com/users/inercia/followers","following_url":"https://api.github.com/users/inercia/following{/other_user}","gists_url":"https://api.github.com/users/inercia/gists{/gist_id}","starred_url":"https://api.github.com/users/inercia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inercia/subscriptions","organizations_url":"https://api.github.com/users/inercia/orgs","repos_url":"https://api.github.com/users/inercia/repos","events_url":"https://api.github.com/users/inercia/events{/privacy}","received_events_url":"https://api.github.com/users/inercia/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/zettio/weave/labels/icebox","name":"icebox","color":"ededed"},{"url":"https://api.github.com/repos/zettio/weave/labels/performance","name":"performance","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-11-18T18:26:15Z","updated_at":"2015-02-18T10:06:35Z","closed_at":null,"body":"Maybe Weave could support data compression for traffic. Encapsulation packets could include a compression field where we could specify an optional compression algorithm for payload. The standard [compress/lzw](http://golang.org/pkg/compress/lzw/) algorithm could be used, or maybe something like [lz4](https://github.com/bkaradzic/go-lz4)... A feature like this could be specially helpful for containers running text-based services like Memcache, Redis, etc..."},"comment":{"url":"https://api.github.com/repos/zettio/weave/issues/comments/74840160","html_url":"https://github.com/zettio/weave/issues/204#issuecomment-74840160","issue_url":"https://api.github.com/repos/zettio/weave/issues/204","id":74840160,"user":{"login":"rade","id":109109,"avatar_url":"https://avatars.githubusercontent.com/u/109109?v=3","gravatar_id":"","url":"https://api.github.com/users/rade","html_url":"https://github.com/rade","followers_url":"https://api.github.com/users/rade/followers","following_url":"https://api.github.com/users/rade/following{/other_user}","gists_url":"https://api.github.com/users/rade/gists{/gist_id}","starred_url":"https://api.github.com/users/rade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rade/subscriptions","organizations_url":"https://api.github.com/users/rade/orgs","repos_url":"https://api.github.com/users/rade/repos","events_url":"https://api.github.com/users/rade/events{/privacy}","received_events_url":"https://api.github.com/users/rade/received_events","type":"User","site_admin":false},"created_at":"2015-02-18T10:06:35Z","updated_at":"2015-02-18T10:06:35Z","body":">  enable it by default and apply an adaptative algorithm that could switch it off\r\n\r\nNice idea, but it makes this issue an order of magnitude more complex. So best left to a follow-on.\r\n\r\n>  low-CPU and high-CPU compressions\r\n\r\nIn most deployments, weave is going to be CPU-bound, so I reckon low-CPU compression is all we need.\r\n\r\nAs for how we determine whether to compress/decompress...\r\n\r\n1. make that an all-or-nothing choice, like encryption, i.e. all peers in a weave network must be configured with the same choice, and will refuse to establish connections to peers otherwise.\r\n2. make compression a per-router choice, i.e. when selected with, say, `weave launch --compressed`, a router will compress all outbound traffic. The flag gets exchanged with peers on connection establishment, so they know which inbound udp packets require decompression based on that. Alternatively, we can add a flag to the udp packet itself, which is less fragile and more amenable to packet inspection.\r\n3. make compression a per-link choice. Now, we wouldn't want a user to have to specify that per-link, since there are potentially O(peer_count^2) links. The zones idea from #82 would work well here, I think.\r\n \r\n"}}