Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Update default discovery and refresh config values #191

Merged
merged 1 commit into from
Nov 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const logger = require('./logger/Logger').get();
const defaultMiraApiPort = 9100;
const defaultEngineAPIPort = 9076;
const defaultEngineMetricsPort = 9090;
const defaultEngineDiscoveryRefreshRate = 1000;
const defaultEngineHealthRefreshRate = 5000;
const defaultEngineDiscoveryRefreshRate = 10000;
const defaultEngineHealthRefreshRate = 30000;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this not a bit too infrequent? I cannot tell what is right but every 30 s introduces quite some delay until an unhealthy engine is detected.

Copy link
Member Author

Choose a reason for hiding this comment

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

Docker default healthcheck interval for Mira is 30 seconds so that is why I chose that value.

This value in Config.js is also used as the interval for Mira to fetch metrics from each engine. Atleast in my opinion 5 seconds is a bit greedy for both health and metrics, and if a shorter interval is needed it is still configurable using env variables.

const defaultKubernetesProxyPort = 8001;
const defaultDiscoveryLabel = 'qix-engine';
const defaultEngineAPIPortLabel = 'qix-engine-api-port';
Expand Down
3 changes: 3 additions & 0 deletions test/component/kubernetes/component-kubernetes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ const specData = require('../../test-data/KubernetesClient.spec.data.json');
const sleep = require('../../test-utils/sleep');
const request = require('supertest');

process.env.MIRA_ENGINE_DISCOVERY_REFRESH_RATE = 1000;
process.env.MIRA_ENGINE_HEALTH_REFRESH_RATE = 1000;

describe('Mira in kubernetes mode', () => {
let app;

Expand Down
2 changes: 2 additions & 0 deletions test/component/local/component-local-two-engines.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const request = require('supertest');
const sleep = require('../../test-utils/sleep');

process.env.DOCKER_HOST = 'http://localhost:8001';
process.env.MIRA_ENGINE_DISCOVERY_REFRESH_RATE = 1000;
process.env.MIRA_ENGINE_HEALTH_REFRESH_RATE = 1000;

describe('Mira in local docker mode with two engines', () => {
let app;
Expand Down
2 changes: 2 additions & 0 deletions test/component/swarm/component-swarm.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const specData = require('../../test-data/SwarmDockerClient.spec.data.json');
const sleep = require('../../test-utils/sleep');

process.env.DOCKER_HOST = 'http://localhost:8001';
process.env.MIRA_ENGINE_DISCOVERY_REFRESH_RATE = 1000;
process.env.MIRA_ENGINE_HEALTH_REFRESH_RATE = 1000;

describe('Mira in docker swarm mode', () => {
let app;
Expand Down