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

Setup keep alive connections #342

Merged
merged 2 commits into from
Nov 29, 2021
Merged

Setup keep alive connections #342

merged 2 commits into from
Nov 29, 2021

Conversation

eguzki
Copy link
Member

@eguzki eguzki commented Nov 24, 2021

Currently, each 3scale admin API call required to setup a new TCP/HTTP connection. For 3scale commands running multiple 3scale API calls, the toolbox spends a lot of time on TCP/HTTP connection setup. Specially true for TLS connections.

With this change, by default, the connection opened by the 3scale toolbox command (if the command requires opening a connection) will be setup to keep alive. Thus, all API calls required for the command will reuse the connection.

If, for whatever reason, the Connection: close behavior is desired, the PR includes a new top level option parameter:

--disable-keep-alive       Disable keep alive HTTP connection mode

@codecov-commenter
Copy link

codecov-commenter commented Nov 24, 2021

Codecov Report

Merging #342 (017545f) into main (6886696) will decrease coverage by 9.08%.
The diff coverage is 100.00%.

❗ Current head 017545f differs from pull request most recent head 8979ea7. Consider uploading reports for the commit 8979ea7 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #342      +/-   ##
==========================================
- Coverage   98.54%   89.46%   -9.09%     
==========================================
  Files         337      224     -113     
  Lines       16714     8131    -8583     
==========================================
- Hits        16470     7274    -9196     
- Misses        244      857     +613     
Impacted Files Coverage Δ
lib/3scale_toolbox/3scale_client_factory.rb 95.23% <100.00%> (-4.77%) ⬇️
lib/3scale_toolbox/base_command.rb 93.75% <100.00%> (+0.41%) ⬆️
lib/3scale_toolbox/commands/3scale_command.rb 77.27% <100.00%> (+1.08%) ⬆️
spec/shared_oas3_contexts.rb 3.44% <0.00%> (-96.56%) ⬇️
spec/shared_swagger_contexts.rb 3.70% <0.00%> (-96.30%) ⬇️
lib/3scale_toolbox/openapi/oas3.rb 36.17% <0.00%> (-61.71%) ⬇️
lib/3scale_toolbox/cli/error_handler.rb 47.69% <0.00%> (-52.31%) ⬇️
...x/commands/policy_registry_command/copy_command.rb 45.65% <0.00%> (-50.00%) ⬇️
lib/3scale_toolbox/entities/account.rb 51.02% <0.00%> (-48.98%) ⬇️
lib/3scale_toolbox/proxy_logger.rb 46.66% <0.00%> (-40.00%) ⬇️
... and 178 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6886696...8979ea7. Read the comment docs.

@@ -42,17 +42,6 @@ OPTIONS
ActiveDocs
--skip-swagger-validations Specify it to skip validation of the
Swagger specification

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where this docs pending to be regenerated before this PR? I see several removals for different docs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those removals do not belong to this PR. They are common options, not for the specific command being documented, but for the base commands. I think the options for the base commands is not necessary to document here. I added a new option to the top level command 3scale and I had to update all the docs for all the subcomands. So I decided to remove.

To be clear, the base command options are still printed when you invoke help, it is just removed from the docs.

Copy link
Contributor

@miguelsorianod miguelsorianod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take a look at the comment I left and if that is expected it can be merged

@eguzki eguzki merged commit b181cbe into main Nov 29, 2021
@eguzki eguzki deleted the setup-keep-alive-connections branch November 29, 2021 16:20
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.

None yet

3 participants