Is there a way to get the max memory used by a task in mesos?

本小妞迷上赌 提交于 2019-12-11 04:06:41

问题


Context:

I implemented a Scheduler in Scala based on the Mesos Scheduler Interface.

All tasks are perfectly orchestrated.

Expectations:

Now, I would like to be able to monitor the max memory consumed by completed tasks.

I expect to perform this monitoring task inside my implementation of Scheduler.statusUpdate() method, for every task with TASK_FINISHED state.

Question:

In this method, a SchedulerDriver and a Protos.TaskStatus are provided.

So, is there a way to retrieve the max memory used by the corresponding task from a SchedulerDriver and a Protos.TaskStatus?


回答1:


Mesos exposes information about task statistics in slave(1)/monitor/statistics. You need to scrape this endpoint on each agent and aggregate the response to get the maximum value for a given task.




回答2:


Depending on the type of isolation your Mesos agent is configured with, e.g. cgroups/* or if you are using the Docker containerizer, you might consider running an external service on your agent hosts that collect and aggregate memory and other runtime statistics for you. For instance, you could use a collector daemon such as cadvisor to monitor your tasks and then ship those metrics on to a persistent datastore where they can be queried in a flexible way.



来源:https://stackoverflow.com/questions/46094057/is-there-a-way-to-get-the-max-memory-used-by-a-task-in-mesos

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!