Re: [RFC] [PATCH] cgroup: limit network bandwidth

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <righiandr@...>
Cc: Balbir Singh <balbir@...>, Naveen Gupta <ngupta@...>, LKML <linux-kernel@...>, David Miller <davem@...>, Ranjit Manomohan <ranjitm@...>
Date: Wednesday, January 23, 2008 - 5:54 am

An approach that we've been experimenting with at Google is much simpler:

- add a "network class id" subsystem, that lets you associated an id
with each cgroup

- propagate this id to sockets created by that cgroup, and from there
to packets sent/received on that socket

- add a new traffic filter that can select based on a packet's cgroup class id

This is a very small amount of kernel code, but it then lets userspace
set up whatever queues/filters/classes it wants using the standard
Linux traffic API, rather than creating a new traffic control API
that's much more limited. So you can easily do things like controlling
guarantees and limits, have different behaviour for local and remote
packets, have packet/byte accounting for different flow classes,
filter on ToS bits in order to let the cgroup prioritize its own
traffic, etc.

We also have plans (have had for months in fact, but haven't had time
for it yet) to let the cgroup network id be selected on in iptables
rules, and possibly add a new iptable for events such as listen(),
bind(), and connect(), to allow very easy control over what network
connections a cgroup can access. This would let you use the full power
of the existing packet/connection matching available in the standard
iptables rules without having to add a new complex (but still limited)
API.

Paul

On Jan 23, 2008 1:09 AM, Andrea Righi <righiandr@users.sourceforge.net> wrote:
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] [PATCH] cgroup: limit network bandwidth, Andrea Righi, (Wed Jan 23, 5:09 am)
Re: [RFC] [PATCH] cgroup: limit network bandwidth, Paul Menage, (Wed Jan 23, 5:54 am)
Re: [RFC] [PATCH] cgroup: limit network bandwidth, Balbir Singh, (Wed Jan 23, 5:24 am)
Re: [RFC] [PATCH] cgroup: limit network bandwidth, Andrea Righi, (Wed Jan 23, 12:48 pm)
Re: [RFC] [PATCH] cgroup: limit network bandwidth, Paul Menage, (Wed Jan 23, 12:59 pm)
Re: [RFC] [PATCH] cgroup: limit network bandwidth, Andrea Righi, (Wed Jan 23, 1:48 pm)