Skip to content

Conversation

@Sashan
Copy link
Contributor

@Sashan Sashan commented Sep 12, 2025

…tool

the idea is to have a script (set of scripts) which build and install environement such we can evaluate SSL performance of different SSL implementations.

The initial version supports httpd from apache. The idea is to build desired SSL library and install it to custom location (INSTALL ROOT). Then we build apache and siege client and install it to INSTALL ROOT.

The proposed approach uses shell script as it is very lightweight and portable between various *NIX flavours.

@nhorman
Copy link
Contributor

nhorman commented Sep 12, 2025

Is it worth codifying these scripts as a container, so we can just test the pre-built images, and updated them on a schedule rather than having to rebuild them every time?

@Sashan
Copy link
Contributor Author

Sashan commented Sep 12, 2025

Is it worth codifying these scripts as a container, so we can just test the pre-built images, and updated them on a schedule rather than having to rebuild them every time?

I've deliberately opted to write this in script form (ksh) to avoid containers so things can be tested on any *nix OS where ksh and tool chains are available. The build on ubuntu virtual machine in our data center (16vCPUs 8GB ram) takes ~20 minutes.

the container image is tempting, but it's too big hammer in my opinion. I prefer a lightweight script with better portability. the container is kind of platform on its own.

Copy link

@bob-beck bob-beck left a comment

Choose a reason for hiding this comment

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

Yes please, land ASAP and then please add a README.md to this directory, even if initially perfunctory, to say what and how they are and how you use them.

@vavroch2010 vavroch2010 linked an issue Sep 16, 2025 that may be closed by this pull request
@github-project-automation github-project-automation bot moved this from Waiting Review to Waiting Merge in Development Board Sep 16, 2025
@@ -0,0 +1,633 @@
#!/bin/ksh -x
Copy link
Contributor

Choose a reason for hiding this comment

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

TIL about ksh. Maybe #!/usr/bin/env ksh instead?

# 4.0M Sep 12 14:49 test_16.txt
#

INSTALL_ROOT=${BENCH_INSTALL_ROOT:-"$HOME/work.openssl/bench.binaries"}
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm always installing it here might be unexpected. Not saying we should change it, just thinking that maybe it can go to /tmp or current directory instead

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 makes sense to change default variant to /tmp/bench.binaries

# make sure master is up-to date just in
# case we build a master version
#
git checkout master || exit 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason for not just using set -e instead of adding || exit 1 everywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just personal preference as I prefer to be explicit. do you mind if I keep the script the way it is now?

Comment on lines 303 to 305
if [[ -n "${VERSION}" ]] ; then
git checkout -b stable-${VERSION} origin/stable-${VERSION} || exit 1
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

this can be removed as above

--enable-apachehttpd \
--enable-postauth || exit 1

make ${MAKE_OPTS} || exit 1
Copy link
Contributor

Choose a reason for hiding this comment

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

adding -j will have better speed on multicore envs. And all the other occurrences in the PR

Suggested change
make ${MAKE_OPTS} || exit 1
make ${MAKE_OPTS} -j || exit 1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no please, -j make option on bsd always requires number of jobs.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see; would $(nproc) work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

unfortunately not

Copy link
Contributor

Choose a reason for hiding this comment

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

That's unfortunate. The build takes too much time in the whole script. Do you see a way to optimize it somehow?

rm -f "${WORKSPACE_ROOT}/${TEST_FILE}"
}

function cleanup {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this ever called? Maybe you can set a bash exit trap to call this.

fi

typeset TEST_FILE=".test_file.$$"
mkdir -p "${WORKSPACE_ROOT}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we check that "${WORKSPACE_ROOT}" and "${INSTALL_ROOT}" don't exist/are empty before creating it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The script does not require install/workspace directories to be empty. The only requirement is that directories must exist (ensured by mkdir -p) and be writable (the write test happens few lines below).

Copy link
Contributor

@jogme jogme left a comment

Choose a reason for hiding this comment

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

LGTM; thank you!

@vavroch2010 vavroch2010 requested a review from t-j-h September 30, 2025 15:01
Copy link
Contributor

@jogme jogme left a comment

Choose a reason for hiding this comment

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

Looking good, thank you!

…tool

the idea is to have a script (set of scripts) which build and install
environement such we can evaluate SSL performance of different
SSL implementations.

The initial version supports httpd from apache. The idea is to build
desired SSL library and install it to custom location (INSTALL ROOT).
Then we build apache and siege client and install it to INSTALL ROOT.

The proposed approach uses shell script as it is very lightweight
and portable between various *NIX flavours.
Sashan added a commit that referenced this pull request Oct 11, 2025
…tool

the idea is to have a script (set of scripts) which build and install
environement such we can evaluate SSL performance of different
SSL implementations.

The initial version supports httpd from apache. The idea is to build
desired SSL library and install it to custom location (INSTALL ROOT).
Then we build apache and siege client and install it to INSTALL ROOT.

The proposed approach uses shell script as it is very lightweight
and portable between various *NIX flavours.

Reviewed-by: Neil Horman <[email protected]>
(Merged from #49)
@Sashan
Copy link
Contributor Author

Sashan commented Oct 13, 2025

it got merged in via #e3201

@Sashan Sashan closed this Oct 13, 2025
@github-project-automation github-project-automation bot moved this from Waiting Merge to Done in Development Board Oct 13, 2025
Sashan added a commit to esyr/openssl-perftools that referenced this pull request Oct 18, 2025
…tool

the idea is to have a script (set of scripts) which build and install
environement such we can evaluate SSL performance of different
SSL implementations.

The initial version supports httpd from apache. The idea is to build
desired SSL library and install it to custom location (INSTALL ROOT).
Then we build apache and siege client and install it to INSTALL ROOT.

The proposed approach uses shell script as it is very lightweight
and portable between various *NIX flavours.

Reviewed-by: Neil Horman <[email protected]>
(Merged from openssl#49)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

benchmark openssl with more heavy tools

5 participants