I think geometric rows are a common choice. Here's what it looks like 10 * 1.2**N:
irb(main):009:0> (0..20).map{|i| 10 * 1.2**i }
=> [10.0, 12.0, 14.399999999999999, 17.279999999999998, 20.735999999999997, 24.883199999999995,
29.85983999999999, 35.831807999999995, 42.99816959999998, 51.597803519999985, 61.917364223999975,
74.30083706879996, 89.16100448255996, 106.99320537907195, 128.39184645488632, 154.0702157458636,
184.8842588950363, 221.86111067404354, 266.23333280885225, 319.4799993706227, 383.3759992447472]
You can also check the cumulative time before the timeout announcement.
irb(main):010:0> (0..20).map{|i| 10 * 1.2**i }.inject(:+)
=> 2250.255995468484
FYI, Linux TCP SYN retry uses a more aggressive slowdown factor 3 * 2**N
irb(main):011:0> (0..5).map{|i| 3 * 2**i }
=> [3, 6, 12, 24, 48, 96]
irb(main):012:0> (0..5).map{|i| 3 * 2**i }.inject(:+)
=> 189
source
share