Kong: Inefficient dynamic configuration

Created on 11 Jun 2020  路  2Comments  路  Source: Kong/kong

Modifying the configuration(create services, routes, upstream etc) can result in a significant increase in the cpu.Is there a way to solve this problem?

pending author feedback question

Most helpful comment

One thing would be to use:
KONG_WORKER_CONSISTENCY=eventual

This used to be named differently:
KONG_ROUTER_CONSISTENCY=eventual

(the default is strict). In general I would always run with eventual on production.

Then also raise:
KONG_WORKER_STATE_UPDATE_FREQUENCY=10

(or KONG_ROUTER_UPDATE_FREQUENCY=10)

See:
https://github.com/Kong/kong/blob/next/kong.conf.default#L1127-L1166

Or:
https://github.com/Kong/kong/blob/master/kong.conf.default#L990-L1025

On next branch even the upstreams and targets can now be built eventually.

All 2 comments

One thing would be to use:
KONG_WORKER_CONSISTENCY=eventual

This used to be named differently:
KONG_ROUTER_CONSISTENCY=eventual

(the default is strict). In general I would always run with eventual on production.

Then also raise:
KONG_WORKER_STATE_UPDATE_FREQUENCY=10

(or KONG_ROUTER_UPDATE_FREQUENCY=10)

See:
https://github.com/Kong/kong/blob/next/kong.conf.default#L1127-L1166

Or:
https://github.com/Kong/kong/blob/master/kong.conf.default#L990-L1025

On next branch even the upstreams and targets can now be built eventually.

thank you very much! I tested again today. cpu usage reduced by half ( 26% -> 13% ).

Was this page helpful?
0 / 5 - 0 ratings