Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add benchmarks #8

Draft
wants to merge 39 commits into
base: master
Choose a base branch
from
Draft

chore: add benchmarks #8

wants to merge 39 commits into from

Conversation

vasco-santos
Copy link
Member

@vasco-santos vasco-santos commented Jan 11, 2021

This PR adds a benchmark setup to stress test a rendezvous server and gather some metrics (CPU Usage, Memory Usage and Response Times).

With the benchmark setup, there is also a script to run a benchmark with different operations and scales. These operations and scales scenarios are documented in a README file, with the results in the side and some notes on them.

In overview, a single rendezvous server seems to operate in an acceptable fashion when dealing with operations of 100 clients at the same time. However, we should probably try to avoid getting to such numbers otherwise some requests might have unacceptable time responses (this happens in a local setup running 100 clients in the same process, but things would be better when in a "real environment" as the clients would not be bottlenecks). A more extensive summary of the results is included in the README file for the benchmarks.

We can look into 2 other things in order to improve the performance of the system:

  1. Discover does not wait to update the cookies table before responding the discover query
  • If the cookies table update fails for some reason, the follow up discovery query would return the same peers
  • This might create some inconsistencies, but the same peers will likely be returned when they update their registration. So, the client side already needs to take this into account.
  • This might cause redundant discovery requests in case of error
    • Not guaranteed as the discovery query is ordered by the registrations with more validity, so it would be possible to actually receive some new results
  1. Number of connections in the Database Connection pool
  • According to some statements regarding the Database Connection pool size, the maximum size of this pool should be 15-20 for a generic machine. We can look into increasing this a bit, as I have seen some claims of people using 100. The more connections we have, the more memory consumption we will have. As there will be a lot of rendezvous clients connected over time, I feel that we should not increase this a lot, unless we will be using machines powered with lot's of memory. This is configurable, so I would just focus on finding a good default for now.

Needs:

@vasco-santos vasco-santos changed the title Chore/add benchmarks chore: add benchmarks Jan 11, 2021
@vasco-santos vasco-santos force-pushed the chore/add-benchmarks branch 4 times, most recently from 05a6ea1 to 7a67642 Compare January 15, 2021 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant