---
title: "Nopeusrajoitinten ohjauksen asetukset"
description: "Nopeusrajoittimia voidaan m\u00E4\u00E4ritt\u00E4\u00E4 niin, ett\u00E4 osa tai kaikki pyynn\u00F6n l\u00E4hett\u00E4j\u00E4t eiv\u00E4t voi ylikuormittaa palvelinta l\u00E4hett\u00E4m\u00E4ll\u00E4 pyynt\u00F6j\u00E4 liian tihe\u00E4sti."
language: fi
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/fi/docs/application-setting-components/rate-limit-control-configuration
original: https://documentation.invantive.eu/en/docs/application-setting-components/rate-limit-control-configuration
updated: 2026-12-03T18:14:22Z
license: https://documentation.invantive.eu/fi/
---

Nopeusrajoittimia voidaan määrittää niin, että osa tai kaikki pyynnön lähettäjät eivät voi ylikuormittaa palvelinta lähettämällä pyyntöjä liian tiheästi.

## Esimerkit
Seuraava JSON on esimerkki tälle standardoidulle konfiguraationosalle:
```json
```

## Määritelmä
Nopeusrajoitinten ohjaus koostuu kahdesta ohjausjoukosta:
- slots: määrittävät numeeriset rajat.
- elements: määrittävät kriteerit, joihin nopeusrajoitinta sovelletaan.
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://invantive.com/schemas/defs/RateLimitControl.schema.json",
  "title": "RateLimitControl",
  "description": "Specification of rate limit control.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "RateLimitControlList": {
      "type": ["array", "null"],
      "items": {
        "$ref": "./RateLimitControlElement.schema.json"
      },
      "description": "Ordered list of Rate Limit Controls. First one to apply is used."
    },
    "RateLimitControlSlotList": {
      "type": ["array", "null"],
      "items": {
        "$ref": "./RateLimitControlSlot.schema.json"
      },
      "description": "Set of Rate Limit Control Slots."
    }
  }
}
```

## `RateLimitControlElement`
Elementti määrittää sovellettavat nopeusrajoittimet. Jokainen nopeusrajoitin voi viitata olemassa olevaan slotiin, joka keskittää varsinaiset rajat.
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://invantive.com/schemas/defs/RateLimitControlElement.schema.json",
  "title": "RateLimitControlElement",
  "type": "object",
  "description": "Specification of a rate limit control element.",
  "additionalProperties": false,
  "properties": {
    "Description": {
      "type": ["string", "null"],
      "description": "Optional description identifying the rate limit control element."
    },
    "Context": {
      "type": ["string", "null"],
      "description": "Optional context limiting the applicability of the rate limit control element. * at the end is a wildcard."
    },
    "Url": {
      "type": ["string", "null"],
      "description": "Optional URL. * at the end is a wildcard.",
      "format": "uri"
    },
    "SlotName": {
      "type": ["string", "null"],
      "description": "Name of slot."
    },
    "ValidFromUtc": {
      "type": ["string", "null"],
      "format": "date-time",
      "description": "Start of validity (UTC). Outside of this period the rate limit control element is not enforced."
    },
    "ValidToUtc": {
      "type": ["string", "null"],
      "format": "date-time",
      "description": "End of validity (UTC). Outside of this period the rate limit control element is not enforced."
    },
    "LogOnCode": {
      "type": ["string", "null"],
      "description": "Log on code."
    },
    "DataContainerId": {
      "type": ["string", "null"],
      "description": "Data container ID."
    },
    "IpAddressClientCidr": {
      "type": ["string", "null"],
      "description": "IP address of the client device in CIDR notation (1.2.3.4/5)."
    }
  }
}
```

## `RateLimitControlSlot`
Slotit määritetään sekunnin, minuutin ja tunnin aikaikkunoille. Jokainen aikaikkuna määrittää:
- Toimintojen enimmäismäärän.
- Viiveen millisekunteina pyyntöä kohden, kun raja ylittyy.
- Keskeytetäänkö suoritus, kun raja ylittyy.
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://invantive.com/schemas/defs/RateLimitControlSlot.schema.json",
  "title": "RateLimitControlSlot",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "Description": {
      "type": ["string", "null"],
      "description": "Optional description identifying the rate limit slot."
    },
    "Name": {
      "type": ["string", "null"],
      "description": "Name."
    },
    "ActionsPerSecond": {
      "type": ["integer", "null"],
      "description": "Maximum number of actions per second; reset on every second switch."
    },
    "ActionsPerMinute": {
      "type": ["integer", "null"],
      "description": "Maximum number of actions per minute; reset on every minute switch."
    },
    "ActionsPerHour": {
      "type": ["integer", "null"],
      "description": "Maximum number of actions per hour; reset on every hour switch."
    },
    "DelayMsOnOverflowSecond": {
      "type": ["integer", "null"],
      "description": "Number of milliseconds to delay an answer when the second level rate limited is exceeded."
    },
    "DelayMsOnOverflowMinute": {
      "type": ["integer", "null"],
      "description": "Number of milliseconds to delay an answer when the minute level rate limited is exceeded."
    },
    "DelayMsOnOverflowHour": {
      "type": ["integer", "null"],
      "description": "Number of milliseconds to delay an answer when the hour level rate limited is exceeded."
    },
    "FailOnOverflowSecond": {
      "type": "boolean",
      "description": "Whether to fail on an overflow on the second level rate limit.",
      "default": true
    },
    "FailOnOverflowMinute": {
      "type": "boolean",
      "description": "Whether to fail on an overflow on the minute level rate limit.",
      "default": true
    },
    "FailOnOverflowHour": {
      "type": "boolean",
      "description": "Whether to fail on an overflow on the hour level rate limit.",
      "default": true
    }
  }
}
```
