Commit 59310e8
committed
pping: Preallocate memory for aggregation maps
When maps are not preallocated, the creation of map entries may
sometimes unpredictably fail with ENOMEM, despite plenty of free
memory being available. Solving this memory allocation issue may take
some time, so in the mean time let's just preallocate the memory for
the aggregation maps as well.
Preallocating the maps means the memory usage will be the same
regardless of the amount of traffic actually observed (i.e. regardless
of the number of aggregation entries that need to be created). To
compensate for this higher out-of-the-box memory usage, decrease the
histogram resolution from 1000 1ms bins to 250 4ms bins.
The memory usage (for the aggregation maps) should be approximately:
(56 + NR_BINS * 4) * CPUS * MAP_AGGREGATION_SIZE * 4
With the current values, that translates to roughly 66 MiB per CPU
core (down from ~254 MiB/core with 1000 bins).
Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>1 parent aadc753 commit 59310e8
2 files changed
+2
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
| 30 | + | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
163 | 162 | | |
164 | 163 | | |
165 | 164 | | |
166 | 165 | | |
167 | 166 | | |
168 | 167 | | |
169 | 168 | | |
170 | | - | |
171 | 169 | | |
172 | 170 | | |
173 | 171 | | |
174 | 172 | | |
175 | 173 | | |
176 | 174 | | |
177 | 175 | | |
178 | | - | |
179 | 176 | | |
180 | 177 | | |
181 | 178 | | |
182 | 179 | | |
183 | 180 | | |
184 | 181 | | |
185 | 182 | | |
186 | | - | |
187 | 183 | | |
188 | 184 | | |
189 | 185 | | |
| |||
0 commit comments