forked from apache/mina-sshd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apacheGH-524: Add sshd-benchmarks maven project
The new maven project sshd-benchmarks contains JMH benchmarks. The project is not part of the binary distribution, and the install:install and deploy:deploy targets are skipped. The project is included in the source distribution. The benchmarks are intended to be run locally. Currently the project contains benchmarks for SFTP file uploads, which can be run either against a local container (if the docker engine is running), or against an external SFTP server.
- Loading branch information
Showing
19 changed files
with
1,182 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# JMH Benchmarks | ||
|
||
This project provides a few JMH benchmarks. It is not part of the Apache MINA sshd binary distribution. | ||
|
||
For details about the benchmarks, see the individual READMEs. | ||
|
||
Note that benchmarking or timing individual SSH or SFTP operations is difficult because there are always | ||
at least two servers and a network connection in between involved. Some tests run an SSH peer in a local | ||
docker container. The network connection is fast and has a very low latency, but the machine executing | ||
the benchmarks also executes the docker container, which may skew timings. If tests are run against an | ||
external SSH peer on some other machine, the network may be slower and/or have a higher latency, which | ||
again may give unusable timings. Moreover, if the network is a general-purpose network, other traffic may | ||
influence timings, and if there are firewalls and/or proxies in between, getting meaningful timings may | ||
be even harder. | ||
|
||
Other processes running on the machine executing the benchmarks may also influence timings. In | ||
particular, suspend automatic backups during benchmarking, and try to avoid interference from virus | ||
scanners. Shut down messaging programs (Teams and the like, but also E-Mail programs), maybe even Web | ||
Browsers or programs that may suddenly check for available updates). Don't do other things on the | ||
machine while the benchmark runs; even scrolling in some other window will skew timings. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.apache.sshd</groupId> | ||
<artifactId>sshd</artifactId> | ||
<version>2.14.0-SNAPSHOT</version> | ||
<relativePath>..</relativePath> | ||
</parent> | ||
|
||
<artifactId>sshd-benchmarks</artifactId> | ||
<name>Apache Mina SSHD :: Benchmarks</name> | ||
<packaging>jar</packaging> | ||
<inceptionYear>2024</inceptionYear> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<jmh.version>1.37</jmh.version> | ||
<uberjar.name>benchmarks</uberjar.name> | ||
<sshd-version>${project.version}</sshd-version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.openjdk.jmh</groupId> | ||
<artifactId>jmh-core</artifactId> | ||
<version>${jmh.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.openjdk.jmh</groupId> | ||
<artifactId>jmh-generator-annprocess</artifactId> | ||
<version>${jmh.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>args4j</groupId> | ||
<artifactId>args4j</artifactId> | ||
<version>2.33</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.sshd</groupId> | ||
<artifactId>sshd-common</artifactId> | ||
<version>${sshd-version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.sshd</groupId> | ||
<artifactId>sshd-core</artifactId> | ||
<version>${sshd-version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.sshd</groupId> | ||
<artifactId>sshd-sftp</artifactId> | ||
<version>${sshd-version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>net.i2p.crypto</groupId> | ||
<artifactId>eddsa</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.bouncycastle</groupId> | ||
<artifactId>bcpg-jdk18on</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.bouncycastle</groupId> | ||
<artifactId>bcpkix-jdk18on</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.bouncycastle</groupId> | ||
<artifactId>bcprov-jdk18on</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>jcl-over-slf4j</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>jul-to-slf4j</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>ch.qos.logback</groupId> | ||
<artifactId>logback-core</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>ch.qos.logback</groupId> | ||
<artifactId>logback-classic</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.testcontainers</groupId> | ||
<artifactId>testcontainers</artifactId> | ||
<version>${testcontainers.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.github.mwiede</groupId> | ||
<artifactId>jsch</artifactId> | ||
</dependency> | ||
<!-- | ||
We inherit JUnit with test scope from the parent POM. This causes trouble with testcontainers, | ||
and we get compilation errors. Overriding the dependency with provided scope resolves that. | ||
--> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
<configuration> | ||
<finalName>${uberjar.name}</finalName> | ||
<createDependencyReducedPom>false</createDependencyReducedPom> | ||
<transformers> | ||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> | ||
<mainClass>org.openjdk.jmh.Main</mainClass> | ||
</transformer> | ||
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> | ||
</transformers> | ||
<filters> | ||
<filter> | ||
<!-- | ||
Shading signed JARs will fail without this. | ||
http://stackoverflow.com/questions/999489/invalid-signature-file-when-attempting-to-run-a-jar | ||
--> | ||
<artifact>*:*</artifact> | ||
<excludes> | ||
<exclude>META-INF/*.SF</exclude> | ||
<exclude>META-INF/*.DSA</exclude> | ||
<exclude>META-INF/*.RSA</exclude> | ||
</excludes> | ||
</filter> | ||
</filters> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<!-- Don't install or deploy this. --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-install-plugin</artifactId> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
10 changes: 10 additions & 0 deletions
10
sshd-benchmarks/src/main/java/org/apache/sshd/benchmarks/README.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Benchmarks | ||
|
||
This is a generalized benchmark runner for Apache MINA sshd JMH benchmarks. It takes a number of command line options to control which benchmarks are run and how. | ||
|
||
Without arguments, it runs the full "SFTP upload" benchmark suite against an OpenSSH instance running in a local docker container. The docker engine must be running for this to work. There are command-line arguments to run the benchmarks against any external server; the benchmarks all assume that there is an `upload` directory into which they can write. Command-line argument `--help` lists the available options. | ||
|
||
Via the `--run` option, one can control which benchmarks are run. | ||
|
||
Benchmarks are run with a warm-up of 4 iterations, and then 10 timed iterations. | ||
|
Oops, something went wrong.