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

feat: Task execution pipelining #484

Merged
merged 24 commits into from
Sep 13, 2023
Merged

feat: Task execution pipelining #484

merged 24 commits into from
Sep 13, 2023

Conversation

Comment on lines 68 to 77
public bool RemoveException([MaybeNullWhen(false)] out Exception e)
{
var r = exceptions_.Count > 0;

e = r
? exceptions_.Dequeue()
: null;

return r;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

You could instead return an aggregate exception and use .Handle to filter out some exceptions out of 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.

Not as clear and easy to use.

@aneojgurhem
Copy link
Contributor Author

aneojgurhem commented Sep 11, 2023

I did some tests on AWS with a c5.12xlarge instance.
Comparison vs main (e4ca29a)

Install dependencies

sudo yum install -y git docker yum-utils

# just
mkdir -p ~/bin
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ~/bin

# terraform
sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo
sudo yum -y install terraform

# docker
sudo systemctl enable docker.service
sudo systemctl start docker.service
sudo usermod -a -G docker ec2-user

Relog

Build clients

docker build -t dockerhubaneo/armonik_core_htcmock_test_client:0.0.0.0-test -f Tests/HtcMock/Client/src/Dockerfile .
docker build -t dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test -f Tests/Bench/Client/src/Dockerfile .

or use (prefered way)

just tag=0.0.0.0-test buildBenchClient
just tag=0.0.0.0-test buildHtcmockClient

How to read results ?

I measured throughput (tasks/seconds). Every table shows that. Higher results are better

Test with htcmock

just worker=mock replicas=30 partitions=1 build-deploy

Some warmup

docker run --net armonik_network --rm \
	-e HtcMock__TotalCalculationTime=00:00:10 \
	-e HtcMock__NTasks=300 \
	-e HtcMock__SubTasksLevels=4 \
	-e HtcMock__EnableFastCompute=true \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080\
	dockerhubaneo/armonik_core_htcmock_test_client:0.0.0.0-test

Test with complex dependencies

docker run --net armonik_network --rm \
	-e HtcMock__TotalCalculationTime=00:00:10 \
	-e HtcMock__NTasks=10000 \
	-e HtcMock__SubTasksLevels=100 \
	-e HtcMock__EnableFastCompute=true \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_htcmock_test_client:0.0.0.0-test

Result 480 tasks/s vs 365 on main

Tests with Bench Client/Worker

just destroy
just worker=bench replicas=30 partitions=1 build-deploy

Some warmup

docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=10 \
	-e BenchOptions__PayloadSize=1 \
	-e BenchOptions__ResultSize=1 \
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test

Tests with 10 seconds tasks and input/output size increase. We should observe constant throughput until prefetching is longer than task execution.

docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=10000 \
	-e BenchOptions__PayloadSize=1 \
	-e BenchOptions__ResultSize=1 \
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test
docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=10000 \
	-e BenchOptions__PayloadSize=10 \
	-e BenchOptions__ResultSize=10 \
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test
docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=10000 \
	-e BenchOptions__PayloadSize=100 \
	-e BenchOptions__ResultSize=100 \
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test
docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=10000 \
	-e BenchOptions__PayloadSize=1000 \
	-e BenchOptions__ResultSize=1000 \
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test
docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=10000 \
	-e BenchOptions__PayloadSize=10000 \
	-e BenchOptions__ResultSize=10000 \
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test
docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=10000 \
	-e BenchOptions__PayloadSize=20000 \
	-e BenchOptions__ResultSize=20000 \
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test
docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=10000 \
	-e BenchOptions__PayloadSize=30000 \
	-e BenchOptions__ResultSize=30000 \
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test
Size pipelining main
1 2.971 2.971
10 2.976 2.971
100 2.975 2.97
1000 2.973 2.967
10000 2.873 2.800
20000 2.834 2.711

Well, it does not change much. Tasks may be too long. Let's use 1 second tasks.

docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=1000 \
	-e BenchOptions__PayloadSize=1 \
	-e BenchOptions__ResultSize=1 \
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test
docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=1000 \
	-e BenchOptions__PayloadSize=10 \
	-e BenchOptions__ResultSize=10 \
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test
docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=1000 \
	-e BenchOptions__PayloadSize=100 \
	-e BenchOptions__ResultSize=100 \
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test
docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=1000 \
	-e BenchOptions__PayloadSize=1000 \
	-e BenchOptions__ResultSize=1000 \
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test
docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=1000 \
	-e BenchOptions__PayloadSize=10000 \
	-e BenchOptions__ResultSize=10000 \
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test
docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=1000 \
	-e BenchOptions__PayloadSize=20000 \
	-e BenchOptions__ResultSize=20000 \
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test
Size pipelining main
1 27.9 27.8
10 27.5 27.3
100 27.7 27.5
1000 27.2 26.9
10000 22.0 18.0
20000 17.7 12.5

Without results

docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=1000 \
	-e BenchOptions__PayloadSize=1 \
	-e BenchOptions__ResultSize=1 \
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test
docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=1000 \
	-e BenchOptions__PayloadSize=10 \
	-e BenchOptions__ResultSize=1 \
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test
docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=1000 \
	-e BenchOptions__PayloadSize=100 \
	-e BenchOptions__ResultSize=1\
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test
docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=1000 \
	-e BenchOptions__PayloadSize=1000 \
	-e BenchOptions__ResultSize=1\
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test
docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=1000 \
	-e BenchOptions__PayloadSize=10000 \
	-e BenchOptions__ResultSize=1\
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test
docker run --net armonik_network --rm \
	-e BenchOptions__NTasks=300 \
	-e BenchOptions__TaskDurationMs=1000 \
	-e BenchOptions__PayloadSize=20000 \
	-e BenchOptions__ResultSize=1\
	-e BenchOptions__DegreeOfParallelism=100 \
	-e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
	dockerhubaneo/armonik_core_bench_test_client:0.0.0.0-test
Size pipelining main
1 27.6 27.6
10 28.2 27.2
100 28.1 27.1
1000 26.3 26.7
10000 24.0 20.8
20000 21.8 16.3

Flush redis

docker exec -it object redis-cli flushall sync

lemaitre-aneo
lemaitre-aneo previously approved these changes Sep 13, 2023
@aneojgurhem aneojgurhem marked this pull request as ready for review September 13, 2023 09:17
@aneojgurhem aneojgurhem merged commit 8b5ea41 into main Sep 13, 2023
@aneojgurhem aneojgurhem deleted the jg/pipelining branch September 13, 2023 09:45
@aneojgurhem aneojgurhem mentioned this pull request Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants