curl / curl/perf

Suggestion: Invoke curl with systemd-run using resource control

Open
#11 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Perl
Stars
13
Forks
0
PR merge metrics
No merged PRs in 30d

Description

I think the script might produce more reliable numbers if it was only allowed to use a certain amount of resources (CPU and possible Memory). That way it wouldn't be that influenced by other operations on the system, like it was pointed out in the blog post.

I'd suggest using systemd-run like this:

systemd-run --user \
    --property=CPUQuota=50% \
    --property=AllowedCPUs=0 \
    /bin/sh -c "curl"

To restrict curl to one CPU and only allow it to use a specific amount of time on it.

The documentation for resource control can be found here.

I've tested it locally with while true; do echo hello; done and for me it seems like the AllowedCPUs only works for system services, not --user, so maybe it has to altered to run as one.

I don't know if the system the script runs on has systemd, but if it is not available, it should be possible to replicate the behavior.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the benchmark script's curl invocation and compare its current behavior with the proposed systemd-run command on systems with and without systemd. Define done as reproducible resource limits that do not break environments lacking systemd, then verify that the benchmark still produces usable numbers.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl, shell
Domain
performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.