pokt-network/pocket

[Utility] Optimize usage of HTTP client for performing relays

adshmh opened this issue · 2 comments

Objective

Optimize usage of HTTP client, e.g. for connection reuse, by the servicer. This can be very important depending on the volume of relays a servicer is expected to handle.

Origin Document

Part of work on #754

Starting point, from #803:

image

and

image

Goals

  • Investigate settings for optimal performance of HTTP clients (and the underlying Transport in the standard HTTP library of GOLANG): examples include Connection Reuse, Connection Pools, etc.
  • Implement the requied optimization in the servicer when serving the relay.

Deliverable

  • Documentation of the expected volume of relays a servicer should be able to handle, possibly defined as multiple SLAs.
  • Documentation of the optimizations deemed necessary to achieve the expected performance
  • Updating the code of servicer and other related components.

Non-goals / Non-deliverables

General issue deliverables

  • Update any relevant local/global README(s)
  • Update relevant source code tree explanations
  • Add or update any relevant or supporting mermaid diagrams

Testing Methodology

  • Task specific tests or benchmarks: make ...
  • New tests or benchmarks: make ...
  • All tests: make test_all
  • LocalNet: verify a LocalNet is still functioning correctly by following the instructions at docs/development/README.md
  • k8s LocalNet: verify a k8s LocalNet is still functioning correctly by following the instructions here

Creator: @adshmh
Co-Owners: @Olshansk

@adshmh NIT (no action but for future reference): If there is a screenshot you can take of the code, PR or documentation as part of the origin document, I've found it really helps both the owner (in case a lot of time goes by), myself and others.

For this one, I could find anything perfect, but this from #778 is a good starting point to look at the code

Screenshot 2023-06-20 at 10 41 27 AM

@adshmh NIT (no action but for future reference): If there is a screenshot you can take of the code, PR or documentation as part of the origin document, I've found it really helps both the owner (in case a lot of time goes by), myself and others.

For this one, I could find anything perfect, but this from #778 is a good starting point to look at the code

Thank you for the suggestion. I updated the Issue description with 2 screenshots which focus on the specific area this issue is about.