Browse Source

Merge pull request #2042 from Vort/ssu2_spikes

lower SSU2 resend traffic spikes
pull/2043/head
orignal 8 months ago committed by GitHub
parent
commit
5412e29ff5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      libi2pd/SSU2.h
  2. 2
      libi2pd/SSU2Session.cpp

4
libi2pd/SSU2.h

@ -21,8 +21,8 @@ namespace transport @@ -21,8 +21,8 @@ namespace transport
{
const int SSU2_TERMINATION_CHECK_TIMEOUT = 25; // in seconds
const int SSU2_CLEANUP_INTERVAL = 72; // in seconds
const int SSU2_RESEND_CHECK_TIMEOUT = 400; // in milliseconds
const int SSU2_RESEND_CHECK_TIMEOUT_VARIANCE = 100; // in milliseconds
const int SSU2_RESEND_CHECK_TIMEOUT = 40; // in milliseconds
const int SSU2_RESEND_CHECK_TIMEOUT_VARIANCE = 10; // in milliseconds
const int SSU2_RESEND_CHECK_MORE_TIMEOUT = 10; // in milliseconds
const size_t SSU2_MAX_RESEND_PACKETS = 128; // packets to resend at the time
const uint64_t SSU2_SOCKET_MIN_BUFFER_SIZE = 128 * 1024;

2
libi2pd/SSU2Session.cpp

@ -537,7 +537,7 @@ namespace transport @@ -537,7 +537,7 @@ namespace transport
if (m_SentPackets.empty ()) return 0;
std::map<uint32_t, std::shared_ptr<SSU2SentPacket> > resentPackets;
for (auto it = m_SentPackets.begin (); it != m_SentPackets.end (); )
if (ts >= it->second->sendTime + it->second->numResends*m_RTO)
if (ts >= it->second->sendTime + (it->second->numResends + 1) * m_RTO)
{
if (it->second->numResends > SSU2_MAX_NUM_RESENDS)
{

Loading…
Cancel
Save