Changing default API rate limits

Akamas services are configured out-of-the-box to use API rate limiting on number of calls (per second and per minute) and on maximum size of payload. Most services use the following values:

max API calls per second: 100
max API calls per minute: 200
max payload size: 2Mb

For actual values for all services, see dedicated page Default API rate limits

In order to change default configuration for API rate limits, you should use the same environment file that you configured in section Online installation modeor Offline installation mode() . Under normal circumstances this will be .env file located in the same folder as docker-compose.yaml file. Also, changes must be performed before launching Akamas server. Otherwise, the server will have to be restarted to apply new changes.

In order to disable (by default they are enabled) API rate limits for all services, you just need to add the following line:

SERVICE_RATE_LIMIT_ENABLED=false

Instead, in order to set different API rate limits you should add the desired lines for any service you may want to change. Below is a complete list, assuming you want to change all of them. Warning: it's not recommended to lower the limits. Anyway, the numbers below are pure examples and have already been increased from standard values

# values for analyzer service
ANALYZER_SERVICE_RATE_LIMIT_PER_SECOND=200 # increase max calls per sec from 100 to 200
ANALYZER_SERVICE_RATE_LIMIT_PER_MINUTE=1000 # increase max calls per min from 200 to 1000
ANALYZER_SERVICE_MAX_PAYLOAD_SIZE_MB=3 # increase max payload size from 2Mb to 3Mb
# values for campaign service
CAMPAIGN_SERVICE_RATE_LIMIT_PER_SECOND=300
CAMPAIGN_SERVICE_RATE_LIMIT_PER_MINUTE=2000
CAMPAIGN_SERVICE_MAX_PAYLOAD_SIZE_MB=3
# values for keycloak service
KEYCLOAK_SERVICE_RATE_LIMIT_PER_SECOND=200
KEYCLOAK_SERVICE_RATE_LIMIT_PER_MINUTE=1000
KEYCLOAK_SERVICE_MAX_PAYLOAD_SIZE_MB=3
# values for license service
LICENSE_SERVICE_RATE_LIMIT_PER_SECOND=200
LICENSE_SERVICE_RATE_LIMIT_PER_MINUTE=1000
LICENSE_SERVICE_MAX_PAYLOAD_SIZE_MB=5
# values for log service
LOG_SERVICE_RATE_LIMIT_PER_SECOND=200
LOG_SERVICE_RATE_LIMIT_PER_MINUTE=1000
LOG_SERVICE_MAX_PAYLOAD_SIZE_MB=5
# values for metrics service
METRICS_SERVICE_RATE_LIMIT_PER_SECOND=300
METRICS_SERVICE_RATE_LIMIT_PER_MINUTE=2000
METRICS_SERVICE_MAX_PAYLOAD_SIZE_MB=6
# values for optimizer service
OPTIMIZER_SERVICE_RATE_LIMIT_PER_SECOND=300
OPTIMIZER_SERVICE_RATE_LIMIT_PER_MINUTE=1200
OPTIMIZER_SERVICE_MAX_PAYLOAD_SIZE_MB=3
# values for orchestrator service
ORCHESTRATOR_SERVICE_RATE_LIMIT_PER_SECOND=200
ORCHESTRATOR_SERVICE_RATE_LIMIT_PER_MINUTE=1000
ORCHESTRATOR_SERVICE_MAX_PAYLOAD_SIZE_MB=5
# values for store service
STORE_SERVICE_RATE_LIMIT_PER_SECOND=200
STORE_SERVICE_RATE_LIMIT_PER_MINUTE=1000
STORE_SERVICE_MAX_PAYLOAD_SIZE_MB=5
# values for system service
SYSTEM_SERVICE_RATE_LIMIT_PER_SECOND=200
SYSTEM_SERVICE_RATE_LIMIT_PER_MINUTE=1000
SYSTEM_SERVICE_MAX_PAYLOAD_SIZE_MB=3
# values for telemetry service
TELEMETRY_SERVICE_RATE_LIMIT_PER_SECOND=300
TELEMETRY_SERVICE_RATE_LIMIT_PER_MINUTE=2000
SERVICE_MAX_PAYLOAD_SIZE_MB=6
# values for user service
USER_SERVICE_RATE_LIMIT_PER_SECOND=200
USER_SERVICE_RATE_LIMIT_PER_MINUTE=1000
USER_SERVICE_MAX_PAYLOAD_SIZE_MB=3

Last updated

Was this helpful?