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

Add option to enable multuple H/3 connections #1998

Merged
merged 5 commits into from
Sep 18, 2024

Conversation

ManickaP
Copy link
Contributor

@@ -15,6 +15,7 @@ public class ClientOptionsBinder : BinderBase<ClientOptions>
public static Option<int> ConcurrencyPerHttpClientOption { get; } = new Option<int>("--concurrencyPerHttpClient", () => 1, "Number of concurrect requests per one HttpClient");
public static Option<int> Http11MaxConnectionsPerServerOption { get; } = new Option<int>("--http11MaxConnectionsPerServer", () => 0, "Max number of HTTP/1.1 connections per server, 0 for unlimited");
public static Option<bool> Http20EnableMultipleConnectionsOption { get; } = new Option<bool>("--http20EnableMultipleConnections", () => true, "Enable multiple HTTP/2.0 connections");
public static Option<bool> Http30EnableMultipleConnectionsOption { get; } = new Option<bool>("--http30EnableMultipleConnections", () => true, "Enable multiple HTTP/3.0 connections");
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we maybe should keep the default as false for the time being.
Otherwise if we merge it like that, all the CI tests will start using that by default, but I think it should be a clear parameter as with H/2 (h2 vs h2multiconn)
It's not a blocker, just a way not to mix up measurements.

Or we can change both crank config yml and ci test config yml right away to include the parameter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

???
Do you want me to change something here or not?

Copy link
Contributor

Choose a reason for hiding this comment

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

(1)
"Keep the default as false" -- Minimal change

- ... new Option<bool>(..., () => true, ...);
+ ... new Option<bool>(..., () => false, ...);

-OR-

(2)
"Change crank config yml" -- Modify scenarios/httpclient.benchmarks.yml to include new parameter as a variable (with default value = false), e.g.:

http20EnableMultipleConnections: true

and pass it to client, e.g.: --http20EnableMultipleConnections {{http20EnableMultipleConnections}}
arguments: '--address {{host}} --port {{serverPort}} --useHttps {{useHttps}} --path /{{scenario}} --scenario {{scenario}} --httpVersion {{httpVersion}} --numberOfHttpClients {{numberOfHttpClients}} --concurrencyPerHttpClient {{concurrencyPerHttpClient}} --http11MaxConnectionsPerServer {{http11MaxConnectionsPerServer}} --http20EnableMultipleConnections {{http20EnableMultipleConnections}} --useWinHttpHandler {{useWinHttpHandler}} --useHttpMessageInvoker {{useHttpMessageInvoker}} --collectRequestTimings {{collectRequestTimings}} --contentSize {{requestContentSize}} --contentWriteSize {{requestContentWriteSize}} --contentFlushAfterWrite {{requestContentFlushAfterWrite}} --contentUnknownLength {{requestContentUnknownLength}} {{headersDictionary[requestHeaders]}} --generatedStaticHeadersCount {{generatedStaticRequestHeadersCount}} --generatedDynamicHeadersCount {{generatedDynamicRequestHeadersCount}} --useDefaultRequestHeaders {{useDefaultRequestHeaders}} --warmup {{warmup}} --duration {{duration}}'

-OR-

(3)
"Change both crank config yml and ci test config yml" -- (2) AND modify build/httpclient-scenarios.yml to include new parameter with both true and false to test matrix, e.g.:

- displayName: "HTTP/2.0"
arguments: --variable httpVersion=2.0 --variable useHttps=true --variable http20EnableMultipleConnections=false --property httpversion=h2
- displayName: "HTTP/2.0 (mult conn)"
arguments: --variable httpVersion=2.0 --variable useHttps=true --variable http20EnableMultipleConnections=true --property httpversion=h2multconn

and as httpVersion is already passed to the scenario (we're not adding a new dimension), it should then appear automatically in "pretty graphs" as soon as the new value will appear in the result table.


Do you want me to change something here or not?

It is hard for me to understand how urgently you'd like to merge the changes (I guess not really, given the PR's in draft), and how much effort are you willing to put into it.

My preferred option is (3) but it can be done as a follow-up, as long as the default is false.

But I am open to the discussion about the default as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is hard for me to understand how urgently you'd like to merge the changes

Not urgent at all, it just wasn't obvious to me from the original comment whether you expect any changes to this PR or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I attempted to do (3). I searched for all http20EnableMultipleConnections occurrences and added h3 equivalents.

But I am open to the discussion about the default as well.

I copy pasted H/2 settings everywhere. If that's not what you wanted, we can chat, but I think it should follow the same approach as H/2.

arguments: --variable httpVersion=3.0 --variable useHttps=true --property httpversion=h3
arguments: --variable httpVersion=3.0 --variable useHttps=true --variable http30EnableMultipleConnections=false --property httpversion=h3
- displayName: "HTTP/3.0 (mult conn)"
arguments: --variable httpVersion=3.0 --variable useHttps=true --variable http30EnableMultipleConnections=true --property httpversion=h3mulconn
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
arguments: --variable httpVersion=3.0 --variable useHttps=true --variable http30EnableMultipleConnections=true --property httpversion=h3mulconn
arguments: --variable httpVersion=3.0 --variable useHttps=true --variable http30EnableMultipleConnections=true --property httpversion=h3multconn

@CarnaViire
Copy link
Contributor

Changes LGTM -- have you tried to use the updated config YML to verify it works?

You can do it this way:

  1. in <local-path-to-repo>/scenarios/httpclient.benchmarks.yml, change the pointers to the sources for the client job (jobs.httpClient.source.repository and jobs.httpClient.source.branchOrCommit) to point at your branch:
      repository: https://github.com/ManickaP/aspnet-benchmarks.git
      branchOrCommit: h3-mul-conns
  1. use this local config file (instead of the remote one) in crank, and verify that both true and false values for the new parameter are passed and used correctly, e.g.:
-crank --config https://raw.githubusercontent.com/..../httpclient.benchmarks.yml --scenario ....
+crank --config <local-path-to-repo>/scenarios/httpclient.benchmarks.yml         --scenario .... --variable http30EnableMultipleConnections=false

HOW-TO: verify parameter is passed correctly

  1. go to the job metadata on the agent (e.g. http://asp-citrine-lin:5001/jobs/100) and check the command line used to start the app, e.g.:
{
"driverVersion": ....,
....
"arguments": "--address .... --http30EnableMultipleConnections false ....",
....
}

-AND/OR-

  1. go to the job logs on the agent (e.g. http://asp-citrine-lin:5001/jobs/100/output) and check the options printed, e.g.
[10:10:50.344] HttpClient benchmark
[10:10:50.353] Options: Address=....; .... Http30EnableMultipleConnections=False; ....
....

@ManickaP
Copy link
Contributor Author

Resurrecting this PR, I rebased this on main and tested it:

So unless you have any more comments, can we get this in @CarnaViire ?

@ManickaP ManickaP marked this pull request as ready for review September 11, 2024 14:58
@ManickaP ManickaP changed the title [DRAFT] Add option to enable multuple H/3 connections Add option to enable multuple H/3 connections Sep 12, 2024
Copy link
Contributor

@CarnaViire CarnaViire left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@CarnaViire CarnaViire merged commit eb7e583 into aspnet:main Sep 18, 2024
1 check passed
@ManickaP ManickaP deleted the h3-mul-conns branch September 19, 2024 07:21
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.

2 participants