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 musl release builds and basic load testing scripts #940

Merged
merged 7 commits into from
Sep 20, 2023

Conversation

LukasKalbertodt
Copy link
Member

@LukasKalbertodt LukasKalbertodt commented Sep 19, 2023

Closes #116
Closes #548 (this PR just adds basics, but there is always more to do, so no point in keeping the issue open)
CC #934
CC #59

This PR adds some basic load testing scripts and also adds -musl builds as officially supported release binary. To do the latter, scripts are adjusted and test deployments on Tue, Thurs and Saturday use musl. This might seem very weird (and it kind of is), but this means that we will constantly testing both builds to avoid some hard to spot bugs sneaking in. Additionally, Tobira now uses jemalloc as allocator due to musl performance reasons, see below.

See commit messages for more information.


Musl performance considerations

Our main blocker for just offering musl builds were performance considerations. One often reads on the interwebz that musl is slow. This is only partially true and many comments are outdated (see #116 (comment)). However, we wanted to test for ourselves. That's why this PR adds basic load tests. They are not amazing, but they helped already.

Results of running locally (the ms are average response times):

GET index.html Homepage GraphQL query Video page GraphQL query
musl 110k req/s 430 req/s (35ms) 1250 req/s (11.6ms)
gnu 276k req/s 2760 req/s (5.0ms) 4120 req/s (3.1ms)
musl with jemalloc 272k req/s 2830 req/s (4.8ms) 4100 req/s (3.1ms)
gnu with jemalloc 271k req/s 2860 req/s (4.8ms) 4090 req/s (3.2ms)

The gist: musl with built-in allocator is still significantly slower than all other options. And all other options don't differ significantly (the differences are most certainly below noise threshold).

So yeah, that lead to the decision to use jemalloc for both kinds of builds.

CC @mtneug

The simple load tests from the previous commit showed that performance
for musl builds increased substantially with jemalloc. For -gnu builds,
there was essentially no difference.
@github-actions github-actions bot temporarily deployed to test-deployment-pr940 September 19, 2023 16:50 Destroyed
The idea is that that way, we will always test both builds and none will
ever get a bug that remains unnoticed for a long time. Also, annoying
bugs that only appear very rarely or after a long time of running can
be noticed like that as well. Otherwise we wouldn't.
@github-actions github-actions bot temporarily deployed to test-deployment-pr940 September 19, 2023 17:04 Destroyed
@LukasKalbertodt LukasKalbertodt marked this pull request as ready for review September 19, 2023 17:09
@owi92 owi92 merged commit 7fbc13d into elan-ev:master Sep 20, 2023
4 checks passed
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.

Setup some backend benchmarks Think about using a statically linked musl libc for release build
2 participants