Commit 595c377
committed
erts: Shrink the adaptive esock rcvbuf via an EWMA
The consecutive-reads counter made shrinking statistically
unreachable on mixed traffic: a single read over a quarter of the
buffer reset it, so a buffer at the cap could stay there through
tens of thousands of smaller reads. Track an EWMA of the read sizes
instead (alpha 1/8, shift arithmetic) and halve the buffer whenever
the average falls below a quarter of it. Bulk bursts still ramp up
unchanged since every filled read doubles the buffer, and once
traffic turns small the average converges within a couple dozen
reads and the buffer halves per read back to the configured size.
An isolated filled read among small ones now also shrinks back
instead of ratcheting.1 parent cfa4e6c commit 595c377
3 files changed
Lines changed: 16 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
525 | | - | |
| 525 | + | |
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8225 | 8225 | | |
8226 | 8226 | | |
8227 | 8227 | | |
8228 | | - | |
8229 | | - | |
8230 | | - | |
| 8228 | + | |
| 8229 | + | |
| 8230 | + | |
8231 | 8231 | | |
8232 | 8232 | | |
8233 | 8233 | | |
| |||
17069 | 17069 | | |
17070 | 17070 | | |
17071 | 17071 | | |
17072 | | - | |
| 17072 | + | |
17073 | 17073 | | |
17074 | 17074 | | |
17075 | 17075 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
215 | | - | |
| 214 | + | |
| 215 | + | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
| 218 | + | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| |||
2850 | 2850 | | |
2851 | 2851 | | |
2852 | 2852 | | |
2853 | | - | |
| 2853 | + | |
2854 | 2854 | | |
2855 | 2855 | | |
2856 | 2856 | | |
| |||
2956 | 2956 | | |
2957 | 2957 | | |
2958 | 2958 | | |
2959 | | - | |
| 2959 | + | |
2960 | 2960 | | |
2961 | 2961 | | |
2962 | 2962 | | |
| |||
3863 | 3863 | | |
3864 | 3864 | | |
3865 | 3865 | | |
| 3866 | + | |
| 3867 | + | |
3866 | 3868 | | |
3867 | 3869 | | |
3868 | 3870 | | |
3869 | | - | |
3870 | 3871 | | |
3871 | | - | |
3872 | | - | |
3873 | | - | |
3874 | | - | |
3875 | | - | |
3876 | | - | |
3877 | | - | |
3878 | | - | |
3879 | | - | |
| 3872 | + | |
| 3873 | + | |
| 3874 | + | |
| 3875 | + | |
3880 | 3876 | | |
3881 | 3877 | | |
3882 | 3878 | | |
| |||
0 commit comments