Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an opt-in TLS contention benchmark to
mina-core. It exercises concurrent writes over one TLS connection and a burst of TLS connections after warmup. The benchmark records JFRjdk.JavaMonitorEnterandjdk.ThreadParkevents, prints measured rates and distinct client TLS session IDs, and asserts only functional completion. It does not change production code or enforce a performance threshold in CI.Run either mode with Java 17 or newer:
Measurements
On one Linux host with Oracle JDK 21.0.3, using loopback TLS 1.2 and JFR enabled, three runs of each default workload produced:
For one sample, JFR recorded 40,632 monitor-enter events and 33 thread-park events during the write workload, and 591 monitor-enter events and 44 thread-park events during the connection workload. The recordings are generated locally under
mina-core/target/and are not part of this PR.Limits and validation
These are short, same-process loopback runs on one host. They include JSSE/provider behavior, allocation, scheduling, echo handling, and JFR collection overhead; they are not production throughput estimates or evidence that a particular lock change helps. TLS 1.2, test key material, and the default JDK random provider are fixed for these measurements. Compare multiple runs on the same host and JDK before drawing performance conclusions.
Validation: both opt-in modes passed in all three measured runs.
mvn -q -pl mina-core -Dtest=SslContentionBenchmarkTest,SslFilterScheduledWriteMessagesTest testpassed (three tests, zero failures; benchmark skipped by default).git diff --checkpassed. A separateSslEnd2EndTestrun was stopped after more than two minutes because that existing parameterized test sends 4,096 messages for each of two protocol cases; it did not complete in this validation window.