Linux killed Kenny, bastard!
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 10 lines · Evgeniy Polyakov
On Mon, Jan 12, 2009 at 03:51:08PM +0000, Alan Cox ([email protected])
Quoted 5 lines
Quoted 2 lines
Well, Kenny has to die, but if we still decide to change the world, here is the fist step.
NAK this entire thing - we have an existing interface that does the job far better.
Mwahaha, I just checked how scores are calculated, so that userspace could adjust them. Let's start with beginning:
[snip]
Quoted 2 lines
Do you _REALLY_ think anyone can calculate it yourself and then properly calculate adjustment used to properly select oom-killed process?
That's easy: Just let your Kenny process run, and check it's score. If it's too low, increase the adjustment until it's just above the other processes' score. Using binary search, you're done in five steps.
Then, while you're at it, protect the important programs by setting their adjustment to -17.
Quoted 8 lines · Bodo Eggert
Quoted 2 lines
Mwahaha, I just checked how scores are calculated, so that userspace could adjust them. Let's start with beginning:
[snip]
Quoted 2 lines
Do you _REALLY_ think anyone can calculate it yourself and then properly calculate adjustment used to properly select oom-killed process?
Quoted 6 lines
That's easy: Just let your Kenny process run, and check it's score. If it's too low, increase the adjustment until it's just above the other processes' score. Using binary search, you're done in five steps.
Then, while you're at it, protect the important programs by setting their adjustment to -17.
This does not work if processes are short-living and are spawned by the parent on demand. If processes have different priority in regards to oom condition, this problem can not be solved with existing interfaces without changing the application. So effectively there is no solution.
Signature · 1 line
Evgeniy Polyakov
Quoted 5 lines · Evgeniy Polyakov
This does not work if processes are short-living and are spawned by the parent on demand. If processes have different priority in regards to oom condition, this problem can not be solved with existing interfaces without changing the application. So effectively there is no solution.
Wrong, you can change how the application is forked. Either immediately adjust /proc/$!/oom_adj or use the adjustment inheritance property and change /proc/$$/oom_adj to the desired value prior to forking. Thanks.
Quoted 9 lines · David Rientjes
Quoted 5 lines
This does not work if processes are short-living and are spawned by the parent on demand. If processes have different priority in regards to oom condition, this problem can not be solved with existing interfaces without changing the application. So effectively there is no solution.
Wrong, you can change how the application is forked. Either immediately adjust /proc/$!/oom_adj or use the adjustment inheritance property and change
/proc/$$/oom_adjto the desired value prior to forking. Thanks.
You and Alan so like bash... Applications are not always forked from shell.
I already pointed multiple times where parent om_adj changes lead, and that this does not work in a real world for some common cases. Existing scheme only works if some daemon (or application itself) explicitely changes oom_adj, but no dameon exists to monitor /proc and applications do not change their own and child's oom_adj because it is way too linuxish to add such hacks to deal with system's oom-killer, which can not be properly configured otherwise.
Signature · 1 line
Evgeniy Polyakov
Quoted 14 lines · Evgeniy Polyakov
Quoted 12 lines · Bodo Eggert
Quoted 2 lines
Mwahaha, I just checked how scores are calculated, so that userspace could adjust them. Let's start with beginning:
[snip]
Quoted 2 lines
Do you _REALLY_ think anyone can calculate it yourself and then properly calculate adjustment used to properly select oom-killed process?
That's easy: Just let your Kenny process run, and check it's score. If it's too low, increase the adjustment until it's just above the other processes' score. Using binary search, you're done in five steps.
Quoted 5 lines
Quoted 2 lines
Then, while you're at it, protect the important programs by setting their adjustment to -17.
This does not work if processes are short-living and are spawned by the parent on demand.
They will have the same name, too. Your Kenny-killer will fail, too.
Quoted 3 lines
If processes have different priority in regards to oom condition, this problem can not be solved with existing interfaces without changing the application. So effectively there is no solution.
ACK, but being a child should count. Maybe the weight for childs should be increased, if it does not do the right thing? Or maybe the childs do share much (most of the) memory, so killing the parent is the right thing if you want to free some RAM?
Signature · 2 lines
The complexity of a weapon is inversely proportional to the IQ of the weapon's operator.
Quoted 4 lines · Bodo Eggert
Quoted 2 lines
This does not work if processes are short-living and are spawned by the parent on demand.
They will have the same name, too. Your Kenny-killer will fail, too.
It is not always the case, processes start executing different binaries and change the names, that's at least what I observed in the particular root case of the discussion.
Quoted 8 lines
Quoted 3 lines
If processes have different priority in regards to oom condition, this problem can not be solved with existing interfaces without changing the application. So effectively there is no solution.
ACK, but being a child should count. Maybe the weight for childs should be increased, if it does not do the right thing? Or maybe the childs do share much (most of the) memory, so killing the parent is the right thing if you want to free some RAM?
There could be lots of heuristics applied for the different cases, but without changing the application, they are somewhat limited to long-living processes only. There are really lots of cases when it does not stand.
Signature · 1 line
Evgeniy Polyakov
Quoted 10 lines · Evgeniy Polyakov
Quoted 4 lines · Bodo Eggert
Quoted 2 lines
This does not work if processes are short-living and are spawned by the parent on demand.
They will have the same name, too. Your Kenny-killer will fail, too.
It is not always the case, processes start executing different binaries and change the names, that's at least what I observed in the particular root case of the discussion.
In that case, you can use a wrapper script.
Quoted 9 lines
Quoted 8 lines
Quoted 3 lines
If processes have different priority in regards to oom condition, this problem can not be solved with existing interfaces without changing the application. So effectively there is no solution.
ACK, but being a child should count. Maybe the weight for childs should be increased, if it does not do the right thing? Or maybe the childs do share much (most of the) memory, so killing the parent is the right thing if you want to free some RAM?
Quoted 4 lines
There could be lots of heuristics applied for the different cases, but without changing the application, they are somewhat limited to long-living processes only. There are really lots of cases when it does not stand.
If it's short-lived enough, the processes will out-die the OOM-Killer. You can only win by by suspending or killing the factory.
Signature · 2 lines
Why do men die before their wives? They want to.
Quoted 10 lines · Bodo Eggert
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
This does not work if processes are short-living and are spawned by the parent on demand.
They will have the same name, too. Your Kenny-killer will fail, too.
It is not always the case, processes start executing different binaries and change the names, that's at least what I observed in the particular root case of the discussion.
In that case, you can use a wrapper script.
That may be a solution, except that not very convenient, since there may be really lots of executables and cooking up a special script for everyone will not scale well.
Quoted 7 lines
Quoted 4 lines
There could be lots of heuristics applied for the different cases, but without changing the application, they are somewhat limited to long-living processes only. There are really lots of cases when it does not stand.
If it's short-lived enough, the processes will out-die the OOM-Killer. You can only win by by suspending or killing the factory.
No, admin will limit/forbid the connection from the DoSing clients, server must always live to handle proper users.
Signature · 1 line
Evgeniy Polyakov
Quoted 10 lines · Evgeniy Polyakov
Quoted 9 lines · Bodo Eggert
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
This does not work if processes are short-living and are spawned by the parent on demand.
They will have the same name, too. Your Kenny-killer will fail, too.
It is not always the case, processes start executing different binaries and change the names, that's at least what I observed in the particular root case of the discussion.
Quoted 5 lines
Quoted 1 line
In that case, you can use a wrapper script.
That may be a solution, except that not very convenient, since there may be really lots of executables and cooking up a special script for everyone will not scale well.
How many different CGI handlers are you going to have?
And how does kill-kenny scale with the number of users on the system? I want my browser not to be killed, while the other user wants his gimp not to be killed. As you can see, it does not even scale for the most simple multi-user system.
Quoted 10 lines
Quoted 7 lines
Quoted 4 lines
There could be lots of heuristics applied for the different cases, but without changing the application, they are somewhat limited to long-living processes only. There are really lots of cases when it does not stand.
If it's short-lived enough, the processes will out-die the OOM-Killer. You can only win by by suspending or killing the factory.
No, admin will limit/forbid the connection from the DoSing clients, server must always live to handle proper users.
If there is no memory, the admin can't even log in.
Signature · 1 line
Programming is an art form that fights back.
Quoted 1 line · Bodo Eggert
How many different CGI handlers are you going to have?
CGIs are usually limited, application server is not.
Quoted 4 lines
And how does kill-kenny scale with the number of users on the system? I want my browser not to be killed, while the other user wants his gimp not to be killed. As you can see, it does not even scale for the most simple multi-user system.
It is not about who should not be killed, but who should _be_ in the first raw.
Quoted 4 lines
Quoted 2 lines
No, admin will limit/forbid the connection from the DoSing clients, server must always live to handle proper users.
If there is no memory, the admin can't even log in.
Admin can observe the situation via kvm or sometimes netconsole and tune the system for the next run.
Signature · 1 line
Evgeniy Polyakov
Quoted 6 lines · Evgeniy Polyakov
Quoted 1 line · Bodo Eggert
How many different CGI handlers are you going to have?
CGIs are usually limited, application server is not.
Quoted 7 lines
Quoted 4 lines
And how does kill-kenny scale with the number of users on the system? I want my browser not to be killed, while the other user wants his gimp not to be killed. As you can see, it does not even scale for the most simple multi-user system.
It is not about who should not be killed, but who should _be_ in the first raw.
If it comes to the killing, it will start with the first row, or using your patch, with the only man in the first row, named kenny. Now imagine a phalanx of spawned kennies protecting a running-wild application from being killed ...
If you set the oom_adj to mark the goat under normal conditions, the system will adjust itself to abnormal conditions.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
No, admin will limit/forbid the connection from the DoSing clients, server must always live to handle proper users.
If there is no memory, the admin can't even log in.
Admin can observe the situation via kvm or sometimes netconsole and tune the system for the next run.
So your kill-kenny does not only require having exactly one goat system-wide and no process having the same process name, but also constant supervision. I think it's a really great design!
Signature · 2 lines
Whenever you have plenty of ammo, you never miss. Whenever you are low on ammo, you can't hit the broad side of a barn.
Quoted 10 lines · Bodo Eggert
Quoted 2 lines
It is not about who should not be killed, but who should _be_ in the first raw.
If it comes to the killing, it will start with the first row, or using your patch, with the only man in the first row, named kenny. Now imagine a phalanx of spawned kennies protecting a running-wild application from being killed ...
If you set the
oom_adjto mark the goat under normal conditions, the system will adjust itself to abnormal conditions.
Admin who sets is up knows what he is doing. Hope you will not argue about the case, when admin will disable the oom-killer and will not be able to log in.
Once again: this is an additional tunable which allows to easily solve the problem showed here multiple times. And whily you did not try to tune oom-adj yourself you continue arguing that it works the best. It does not. Any solution for the showed problem is not a simple and nice-looking, the one I proposed imo looks the most convenient for the people who really work with the systems where described behaviour was observed.
Quoted 11 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
No, admin will limit/forbid the connection from the DoSing clients, server must always live to handle proper users.
If there is no memory, the admin can't even log in.
Admin can observe the situation via kvm or sometimes netconsole and tune the system for the next run.
So your kill-kenny does not only require having exactly one goat system-wide and no process having the same process name, but also constant supervision. I think it's a really great design!
You should reread (better twice) what we are talking about here and what and why patch was proposed. And how it works too.
Signature · 1 line
Evgeniy Polyakov