forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdf8b7bc
committed
Improve our mechanism for controlling the Linux out-of-memory killer.
Arrange for postmaster child processes to respond to two environmentvariables, PG_OOM_ADJUST_FILE and PG_OOM_ADJUST_VALUE, to determine whetherthey reset their OOM score adjustments and if so to what. This is superiorto the previous design involving #ifdef's in several ways. The behavior isnow available in a default build, and both ends of the adjustment --- theoriginal adjustment of the postmaster's level and the subsequentreadjustment by child processes --- can now be controlled in one place,namely the postmaster launch script. So it's no longer necessary for thelaunch script to act on faith that the server was compiled with theappropriate options. In addition, if someone wants to use an OOM scoreother than zero for the child processes, that doesn't take a recompileanymore; and we no longer have to cater separately to the two differenthistorical kernel APIs for this adjustment.Gurjeet Singh, somewhat revised by me1 parent9606619 commitdf8b7bc
File tree
3 files changed
+44
-54
lines changed- contrib/start-scripts
- doc/src/sgml
- src/backend/postmaster
3 files changed
+44
-54
lines changedLines changed: 9 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
46 |
| - | |
47 |
| - | |
48 |
| - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
49 | 50 |
| |
| 51 | + | |
50 | 52 |
| |
51 | 53 |
| |
52 |
| - | |
| 54 | + | |
53 | 55 |
| |
| 56 | + | |
54 | 57 |
| |
55 | 58 |
| |
56 | 59 |
| |
| |||
84 | 87 |
| |
85 | 88 |
| |
86 | 89 |
| |
87 |
| - | |
| 90 | + | |
88 | 91 |
| |
89 | 92 |
| |
90 | 93 |
| |
| |||
97 | 100 |
| |
98 | 101 |
| |
99 | 102 |
| |
100 |
| - | |
| 103 | + | |
101 | 104 |
| |
102 | 105 |
| |
103 | 106 |
| |
|
Lines changed: 17 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1275 | 1275 |
| |
1276 | 1276 |
| |
1277 | 1277 |
| |
1278 |
| - | |
| 1278 | + | |
1279 | 1279 |
| |
1280 | 1280 |
| |
1281 | 1281 |
| |
| |||
1284 | 1284 |
| |
1285 | 1285 |
| |
1286 | 1286 |
| |
1287 |
| - | |
1288 |
| - | |
1289 |
| - | |
1290 |
| - | |
1291 |
| - | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
1292 | 1302 |
| |
1293 | 1303 |
| |
1294 | 1304 |
| |
1295 | 1305 |
| |
1296 | 1306 |
| |
1297 | 1307 |
| |
1298 |
| - | |
1299 |
| - | |
1300 |
| - | |
| 1308 | + | |
1301 | 1309 |
| |
1302 | 1310 |
| |
1303 | 1311 |
| |
|
Lines changed: 18 additions & 39 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
| 34 | + | |
34 | 35 |
| |
35 | 36 |
| |
36 | 37 |
| |
| |||
71 | 72 |
| |
72 | 73 |
| |
73 | 74 |
| |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 |
| - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
80 | 84 |
| |
81 |
| - | |
82 |
| - | |
83 |
| - | |
84 |
| - | |
85 |
| - | |
86 |
| - | |
87 |
| - | |
88 |
| - | |
89 |
| - | |
90 |
| - | |
91 |
| - | |
92 |
| - | |
93 |
| - | |
| 85 | + | |
94 | 86 |
| |
95 |
| - | |
96 |
| - | |
97 |
| - | |
98 |
| - | |
99 |
| - | |
100 |
| - | |
101 |
| - | |
102 |
| - | |
103 |
| - | |
104 |
| - | |
105 |
| - | |
106 |
| - | |
107 |
| - | |
108 |
| - | |
109 |
| - | |
| 87 | + | |
110 | 88 |
| |
111 | 89 |
| |
112 | 90 |
| |
113 | 91 |
| |
114 | 92 |
| |
115 |
| - | |
| 93 | + | |
116 | 94 |
| |
117 | 95 |
| |
118 | 96 |
| |
119 | 97 |
| |
120 |
| - | |
| 98 | + | |
121 | 99 |
| |
122 | 100 |
| |
123 |
| - | |
124 |
| - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
125 | 105 |
| |
126 | 106 |
| |
127 | 107 |
| |
128 | 108 |
| |
129 |
| - | |
130 | 109 |
| |
131 | 110 |
| |
132 | 111 |
| |
|
0 commit comments
Comments
(0)