Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Speed up v2/pods/::status (#6786) #6791

Merged
merged 1 commit into from
Feb 14, 2019

Conversation

jeschkies
Copy link
Contributor

Summary:
This replace the Akka stream with a simple Future.sequence and uses
the same AppInfoBaseData instance for each pod. This we utilize the
cached instances and not limit ourselves to eight parallel threads. To
not overload Marathon we use the fixed size thread pool from #5973.

However, even with #5973 we might allocate a lot of futures and
runnables.

For 100 pods with 1 instance each I got the following:

› wrk -c 10 -t 10 -d 2m http://localhost:8080/v2/pods/::status
Running 2m test @ http://localhost:8080/v2/pods/::status
  10 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   136.52ms   44.93ms 859.05ms   93.64%
    Req/Sec     7.71      2.49    20.00     69.81%
  8918 requests in 2.00m, 1.34GB read
Requests/sec:     74.26
Transfer/sec:     11.45MB
Running 2m test @ http://localhost:8080/v2/pods/::status
  10 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    62.27ms   23.24ms 220.39ms   70.17%
    Req/Sec    15.94      6.09    50.00     69.12%
  19345 requests in 2.00m, 2.91GB read
Requests/sec:    161.10
Transfer/sec:     24.85MB

JIRA issues: MARATHON-8563

Summary:
This replace the Akka stream with a simple `Future.sequence` and uses
the same `AppInfoBaseData` instance for each pod. This we utilize the
cached instances and not limit ourselves to eight parallel threads. To
not overload Marathon we use the fixed size thread pool from #5973.

However, even with #5973 we might allocate a lot of futures and
runnables.

For 100 pods with 1 instance each I got the following:

```
› wrk -c 10 -t 10 -d 2m http://localhost:8080/v2/pods/::status
Running 2m test @ http://localhost:8080/v2/pods/::status
  10 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   136.52ms   44.93ms 859.05ms   93.64%
    Req/Sec     7.71      2.49    20.00     69.81%
  8918 requests in 2.00m, 1.34GB read
Requests/sec:     74.26
Transfer/sec:     11.45MB
```

```
Running 2m test @ http://localhost:8080/v2/pods/::status
  10 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    62.27ms   23.24ms 220.39ms   70.17%
    Req/Sec    15.94      6.09    50.00     69.12%
  19345 requests in 2.00m, 2.91GB read
Requests/sec:    161.10
Transfer/sec:     24.85MB
```

JIRA issues: MARATHON-8563
Copy link

@mesosphere-ci mesosphere-ci left a comment

Choose a reason for hiding this comment

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

I'm building your change at jenkins-marathon-pipelines-PR-6791-1.

Copy link

@mesosphere-ci mesosphere-ci left a comment

Choose a reason for hiding this comment

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

✔ Build of #6791 completed successfully.

See details at jenkins-marathon-pipelines-PR-6791-1.

You can create a DC/OS with your patched Marathon by creating a new pull
request with the following changes in buildinfo.json:

"url": "https://s3.amazonaws.com/downloads.mesosphere.io/marathon/builds/1.6.571-b5c64627b/marathon-1.6.571-b5c64627b.tgz",
"sha1": "c7352acef051bcf4b7fe5e56ff90bdc420c8a604"

You can run system integration test changes of this PR against Marathon
master by triggering this Jenkins job with the Pull_Request_id 6791.
The job then reports back to this PR.

\\ ٩( ᐛ )و //

@@ -31,6 +31,13 @@ private[appinfo] class DefaultInfoService(
}
}

override def selectPodStatuses(ids: Set[PathId], selector: PodSelector): Future[Seq[PodStatus]] = {
Copy link
Contributor

Choose a reason for hiding this comment

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

I missed the opportunity to review initially, but I'd wondered why this needs to a Set, and then down below, I'd do ids.iterator followed by a to[Seq] to reduce the number of copies etc. Probably trivial optimization stuff :)

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 ids come as a set. I stumbled upon this as well.

@jeschkies jeschkies merged commit aa841bd into releases/1.6 Feb 14, 2019
@jeschkies jeschkies deleted the karsten/backports/1.6/MARATHON-8563 branch February 14, 2019 13:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants