Commit ad422a7
Replace RequestStarter throttling with simplier logic
The RequestStarter logic was subtly broken in multiple ways:
- Bad interaction between rtt and window estimates would cause your
node to oscillate between starting way more requests than the
network can handle and almost stalling entirely for minutes.
The speed difference may be a factor 100x from one minute to another.
- Nodes patched with the infamous RequestStarter patches would cause
your node to throttle down on number of requests started to their
advantage. This could potentially be exploited by an attacker as well.
- The window estimation would attempt to throttle the speed to target
a certain ratio of requests succeeding without getting dropped due
to rejected-overload. This would avoid meltdown of the network, but
the target was not hard-coded but dependant on average network speed
among other things, in practice ending up allowing 30% of requests
to fail.
- The window estimation was changed according to an AIMD schedule.
This would have encouraged nodes on the network to agree on a speed
collectively, but the logic deviated from AIMD in undocumented ways,
for example by making the incremental step multiplicative. It is
unclear if this would actually cause any agreement on the network.
- All code was completely undocumented, had many seemingly arbitrarily
chosen constants, and multiple lines of code with no effect at all.
- There are other ways to design the estimation of an ideal request
starting speed that avoids most of the above problems, but it would
still require selecting some arbitrary constants, so not obviously
better than replacing all logic altogether with a single constant.
The whole thing can be viewed as a single network constant; the number of
requests per second and peer we can start to cause an ideal load on the
network, assuming distribution of types of requests and idling and busy
nodes looks like it does today. The biggest advantage of this method is
that it causes a very even starting of requests everywhere in the network,
with no oscillating speeding that chokes parts of the space in turns. This
may enable faster speeds with fewer rejected-overloads and peer backoffs.
There are other advantages with this simple method as well. If a future
release does something that improves or worsen rejected-overload ratio or
average request completion time, it will show clearly in the stats. The
network will not try to conceal the change.
The constant was tuned to an empirical value matching todays average
request starting speed. This may need finetuning in future releases if
rejected-overload situation improves and higher speeds are possible.
Made all stats average over whole session, but no persistent. This makes
them more useful to judge state of network.1 parent 95b91d6 commit ad422a7
File tree
20 files changed
+127
-339
lines changed- src/freenet
- clients/http
- l10n
- node
20 files changed
+127
-339
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
547 | | - | |
548 | | - | |
549 | 547 | | |
550 | | - | |
551 | | - | |
552 | 548 | | |
553 | 549 | | |
554 | 550 | | |
555 | 551 | | |
556 | | - | |
557 | | - | |
558 | 552 | | |
559 | 553 | | |
560 | 554 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1757 | 1757 | | |
1758 | 1758 | | |
1759 | 1759 | | |
1760 | | - | |
1761 | 1760 | | |
1762 | 1761 | | |
1763 | 1762 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1985 | 1985 | | |
1986 | 1986 | | |
1987 | 1987 | | |
1988 | | - | |
1989 | 1988 | | |
1990 | 1989 | | |
1991 | 1990 | | |
| |||
2017 | 2016 | | |
2018 | 2017 | | |
2019 | 2018 | | |
2020 | | - | |
2021 | 2019 | | |
2022 | 2020 | | |
2023 | 2021 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1896 | 1896 | | |
1897 | 1897 | | |
1898 | 1898 | | |
1899 | | - | |
1900 | 1899 | | |
1901 | 1900 | | |
1902 | 1901 | | |
| |||
1928 | 1927 | | |
1929 | 1928 | | |
1930 | 1929 | | |
1931 | | - | |
1932 | 1930 | | |
1933 | 1931 | | |
1934 | 1932 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
803 | 803 | | |
804 | 804 | | |
805 | 805 | | |
806 | | - | |
807 | 806 | | |
808 | 807 | | |
809 | 808 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1896 | 1896 | | |
1897 | 1897 | | |
1898 | 1898 | | |
1899 | | - | |
1900 | 1899 | | |
1901 | 1900 | | |
1902 | 1901 | | |
| |||
1928 | 1927 | | |
1929 | 1928 | | |
1930 | 1929 | | |
1931 | | - | |
1932 | 1930 | | |
1933 | 1931 | | |
1934 | 1932 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1741 | 1741 | | |
1742 | 1742 | | |
1743 | 1743 | | |
1744 | | - | |
1745 | 1744 | | |
1746 | 1745 | | |
1747 | 1746 | | |
| |||
1770 | 1769 | | |
1771 | 1770 | | |
1772 | 1771 | | |
1773 | | - | |
1774 | 1772 | | |
1775 | 1773 | | |
1776 | 1774 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1200 | 1200 | | |
1201 | 1201 | | |
1202 | 1202 | | |
1203 | | - | |
1204 | 1203 | | |
1205 | 1204 | | |
1206 | 1205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1465 | 1465 | | |
1466 | 1466 | | |
1467 | 1467 | | |
1468 | | - | |
1469 | 1468 | | |
1470 | 1469 | | |
1471 | 1470 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1838 | 1838 | | |
1839 | 1839 | | |
1840 | 1840 | | |
1841 | | - | |
1842 | 1841 | | |
1843 | 1842 | | |
1844 | 1843 | | |
| |||
1868 | 1867 | | |
1869 | 1868 | | |
1870 | 1869 | | |
1871 | | - | |
1872 | 1870 | | |
1873 | 1871 | | |
1874 | 1872 | | |
| |||
0 commit comments