forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6d01541
committed
Lower default value of autovacuum_worker_slots in initdb as needed.
Commitc758119 increased the default number of semaphoresrequired for autovacuum workers from 3 to 16. Unfortunately, somesystems have very low default settings for SEMMNS, and this changemoved the minimum required for Postgres well beyond that limit (seecommit38da053 for more details).With this commit, initdb will lower the default value forautovacuum_worker_slots as needed, just like it already does forparameters such as max_connections and shared_buffers. We testfor (max_connections / 6) slots, which conveniently has thefollowing properties:* For the initial max_connections default of 100, the default of autovacuum_worker_slots will be 16, which is its initial default value specified in the documentation and in guc_tables.c.* For the lowest possible max_connections default of 25, the default of autovacuum_worker_slots will be 4, which means we only need one additional semaphore for autovacuum workers (as compared to before commitc758119). This leaves some wiggle room for new auxiliary workers, etc. on systems with low SEMMNS, and it ensures that the default number of slots will be greater than or equal to the default value of autovacuum_max_workers (3).Reported-by: Tom LaneSuggested-by: Andres FreundReviewed-by: Tom LaneDiscussion:https://postgr.es/m/1346002.1736198977%40sss.pgh.pa.us1 parent0e5b144 commit6d01541
2 files changed
+37
-8
lines changedLines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8639 | 8639 |
| |
8640 | 8640 |
| |
8641 | 8641 |
| |
8642 |
| - | |
8643 |
| - | |
| 8642 | + | |
| 8643 | + | |
| 8644 | + | |
8644 | 8645 |
| |
8645 | 8646 |
| |
8646 | 8647 |
| |
|
Lines changed: 34 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
196 | 196 |
| |
197 | 197 |
| |
198 | 198 |
| |
| 199 | + | |
199 | 200 |
| |
200 | 201 |
| |
201 | 202 |
| |
| |||
273 | 274 |
| |
274 | 275 |
| |
275 | 276 |
| |
276 |
| - | |
| 277 | + | |
| 278 | + | |
277 | 279 |
| |
278 | 280 |
| |
279 | 281 |
| |
| |||
1118 | 1120 |
| |
1119 | 1121 |
| |
1120 | 1122 |
| |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
1121 | 1135 |
| |
1122 | 1136 |
| |
1123 | 1137 |
| |
| |||
1145 | 1159 |
| |
1146 | 1160 |
| |
1147 | 1161 |
| |
1148 |
| - | |
| 1162 | + | |
| 1163 | + | |
1149 | 1164 |
| |
1150 | 1165 |
| |
1151 | 1166 |
| |
1152 | 1167 |
| |
1153 | 1168 |
| |
1154 | 1169 |
| |
1155 | 1170 |
| |
| 1171 | + | |
1156 | 1172 |
| |
1157 | 1173 |
| |
1158 |
| - | |
| 1174 | + | |
1159 | 1175 |
| |
1160 | 1176 |
| |
1161 | 1177 |
| |
| |||
1167 | 1183 |
| |
1168 | 1184 |
| |
1169 | 1185 |
| |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
1170 | 1193 |
| |
1171 | 1194 |
| |
1172 | 1195 |
| |
| |||
1180 | 1203 |
| |
1181 | 1204 |
| |
1182 | 1205 |
| |
1183 |
| - | |
| 1206 | + | |
1184 | 1207 |
| |
1185 | 1208 |
| |
1186 | 1209 |
| |
| |||
1200 | 1223 |
| |
1201 | 1224 |
| |
1202 | 1225 |
| |
1203 |
| - | |
| 1226 | + | |
1204 | 1227 |
| |
1205 | 1228 |
| |
1206 | 1229 |
| |
| |||
1213 | 1236 |
| |
1214 | 1237 |
| |
1215 | 1238 |
| |
| 1239 | + | |
1216 | 1240 |
| |
1217 | 1241 |
| |
1218 | 1242 |
| |
1219 |
| - | |
| 1243 | + | |
1220 | 1244 |
| |
1221 | 1245 |
| |
1222 | 1246 |
| |
| |||
1280 | 1304 |
| |
1281 | 1305 |
| |
1282 | 1306 |
| |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
1283 | 1311 |
| |
1284 | 1312 |
| |
1285 | 1313 |
| |
|
0 commit comments
Comments
(0)