2

I'm currently designing with my team a system, that orchestrates a large number of containers in Marathon. We need to get current status of apps in Marathon and have here two options:

  1. Poll the list of tasks through the API. Probably GET /v2/apps/ and GET /v2/apps/{app_id} API resources are going to be used.
  2. Receive realtime events from the Event Bus.

Well, the second option seems to be more optimal, but anyway, I would like to know, how performant is Marathon's API.

How much load can Marathon take? Can it process, let's say, 1K requests per second?

PS: We want to deliver status updates into UI. Since we can start and stop the apps this status is of dynamic in nature. Most of the apps run only for 1-2 minutes, however, some can run for as long as it is required unless stopped.

Pavel
  • 548
  • 5
  • 23
  • What type of requests? If you are interested in getting (not changing) state and you can assume this state does not change in some interval (or this changes could be ignored) you can set marathon behind a proxy. If you have many of apps `GET /v2/apps` can up to 1 second. – janisz Aug 25 '16 at 11:10
  • I'm currently talking about just getting state. Actually, we want to deliver the state updates to UI. But we have two types of Marathon tasks: long running and the ones, which might be running for e.g. a minute. So the state could be updated quite often. – Pavel Aug 25 '16 at 11:18
  • As usual it depends. If you didn't use Auth plugin and has small amount of apps/groups/tasks then marathon could handle that. Remember, marathon keeps it's state in zookeeper where every app/task/group is stored, so as long as ZK can handle it Marathon will work (+ leader has internal cache so reads should be fast). – janisz Aug 25 '16 at 12:11
  • I believe the apps will get restarted by Marathon if they finish after 1min... – Tobi Aug 25 '16 at 13:45
  • They don't finish, we kill them `DELETE /v2/apps/{app_id}` when they have their job done. – Pavel Aug 25 '16 at 14:07
  • 1
    And how do you determine that? Sounds a litte strange/complicated. Also, there are existing tools for such workloads, as Chronos or its successor Metronome – Tobi Aug 25 '16 at 14:46

1 Answers1

0

If you want state information, the Event Bus via the /events endpoint is probably not the right way to takle this, because if delivers a stream of events. Actual this would mean that you have to track the overall state yourself...

I'd recommend to use GET /v2/apps with an additional embed parameter, see the docs.

For example

GET /v2/apps?embed=apps.tasks

To me it not really clear why you'd have to call this 1k times/sec. Your frontend UI will probably not be capable of doing that I guess...

Tobi
  • 31,405
  • 8
  • 58
  • 90