Skip to content

Instantly share code, notes, and snippets.

@derekchiang
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derekchiang/4d13e345441c3873140e to your computer and use it in GitHub Desktop.
Save derekchiang/4d13e345441c3873140e to your computer and use it in GitHub Desktop.
Mesos Simulator Usage

Usage

  1. Compile this Mesos fork like you normally would.

Notice that we are currently on the custom-exec branch.

  1. Set the environment variable MESOS_DEFAULT_EXECUTOR_PATH to $BUILD_DIR/src/mesos-simexecutor

BUILD_DIR is your build directory.

  1. Set the environment variable MESOS_SIMULATOR_CONFIG_PATH to point to a config file. The config file must conform to the format described below.

  2. Before you launch mesos-local, it's helpful to run the following commands, especially if you want to run a lot of local slaves:

export MESOS_REGISTRY=in_memory
export MESOS_MAX_SLAVE_PING_TIMEOUTS=30000
export MESOS_SLAVE_PING_TIMEOUT=15mins

# Only if you are running mesos-local on a Mac
sudo launchctl limit maxfiles 1000000 1000000
sudo launchctl limit maxproc 2500
ulimit -n 40960
  1. Start the newly built mesos-local (under $BUILD_DIR/bin). Use the --num_slaves flag if you want to spawn multiple slaves. Then just start your framework and launch tasks as usual.

Config Format

The config needs to be a valid JSON file. Here is an example:

{
    "task_specs": [
        {
            "pattern": "SOME_PREFIX.*",
            "failure_rate": 0.3,
            "length_mean": 2.9827,
            "length_std": 1.231
        },
        {
            "pattern": ".*",
            "failure_rate": 0.1,
            "length_mean": 10.23052,
            "length_std": 5.25329
        }
    ]
}

pattern is a regex pattern used to match task IDs.

length_mean and length_std are in seconds.

To explain, the first spec says that: all tasks whose IDs start with SOME_PREFIX have a 30% chance of failing. On average, they should run 2.9827 seconds. The standard deviation for their run time is 1.231 seconds. Note that the task lengths follow a normal distribution.

Use .* to match all tasks, as in the second spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment