celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [celix] Oipo opened a new pull request #274: Reuse etcd connection to prevent storm of new sockets
Date Fri, 14 Aug 2020 13:56:51 GMT

Oipo opened a new pull request #274:
URL: https://github.com/apache/celix/pull/274

   In the current setup, when connecting tens to hundreds of publishers/subscribers, the TTL
refresh loop causes a storm of etcd requests. Given that each curl_easy handle got created
and destroyed, no re-use of open connections is possible, leading the code to exceed the sysctl
defaults of 470 connection/s. The error curl then gives in this scenario is that it is unable
to connect to the address.
   This PR stores the created curl_easy handle in the etcdlib struct and surrounds it by mutexes
to prevent data races. This might cause issues if network latency exceeds give or take 50ms,
as each etcdlib instance cannot do multiple requests simultaneously anymore. I think this
would only cause issues if the etcd server given is outside of the same datacentre used by
the program.
   Given the option between exceeding 470 new connections per second, or slightly lowered
theoretical throughput, I would go for the latter option.

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:

View raw message