pingora icon indicating copy to clipboard operation
pingora copied to clipboard

Does pingora support dynamically adding services after startup?

Open machine3 opened this issue 1 year ago • 1 comments

For example, dynamically add listener, router, upstream, etc.

machine3 avatar May 27 '24 12:05 machine3

After modifying the configuration, stop the old process and start a new one.

https://github.com/cloudflare/pingora/blob/main/docs/quick_start.md#gracefully-upgrade-the-service

vicanso avatar May 27 '24 12:05 vicanso

Right now it does not support adding new listeners or service without a (graceful) restart as mentioned above. But you can have dynamic routing and upstream without restarting.

eaufavor avatar May 29 '24 16:05 eaufavor

@eaufavor a followup question on this - what is the mental model of a large scale deployment. for e.g. 1000 users have deployed 2000 services and i want pingora to be the front for these services. Users will be constantly changing their configuration.

does this mean - each user has a pingora instance for them ? so whenever they update the config, it gets updated and redeployed ? or is there a smaller pool of pingora instances shared between all users ? in which case, a config update would mean all instances would get redeployed.

pingora pulling config from a database on each request would add too much latency i suppose.

sandys avatar Jun 03 '24 15:06 sandys

pingora pulling config from a database on each request would add too much latency i suppose.

Not necessarily if done with a caching layer. There are two ways to make this fast

  1. With https://docs.rs/pingora-memory-cache/latest/pingora_memory_cache/ you can pull and cache the user conf (either the entire conf or per user conf if your database supports it) out of the database and cache it. You only pay the latency every TTL seconds.
  2. Put the user conf in a ArcSwap and refresh it in the background. In this case no request would pay for the latency. The background refresh logic can be either active (refresh every TTL seconds) or reactive (the external system will signal it to refresh when the conf is changed).

eaufavor avatar Jun 03 '24 17:06 eaufavor

@eaufavor a followup question on this - what is the mental model of a large scale deployment. for e.g. 1000 users have deployed 2000 services and i want pingora to be the front for these services. Users will be constantly changing their configuration.

does this mean - each user has a pingora instance for them ? so whenever they update the config, it gets updated and redeployed ? or is there a smaller pool of pingora instances shared between all users ? in which case, a config update would mean all instances would get redeployed.

pingora pulling config from a database on each request would add too much latency i suppose.

You can add L4 nat proxy before the pingora and read both proxy info and service config at the begining of the pingora lifecycle.

hikaricai avatar Jun 04 '24 02:06 hikaricai

This question has been stale for a week. It will be closed in an additional day if not updated.

github-actions[bot] avatar Jun 12 '24 01:06 github-actions[bot]

Right now it does not support adding new listeners or service without a (graceful) restart as mentioned above. But you can have dynamic routing and upstream without restarting.

Is there a plan to support this in the future? @eaufavor

machine3 avatar Jun 13 '24 00:06 machine3

This question has been stale for a week. It will be closed in an additional day if not updated.

github-actions[bot] avatar Jun 21 '24 01:06 github-actions[bot]

This issue has been closed because it has been stalled with no activity.

github-actions[bot] avatar Jun 23 '24 01:06 github-actions[bot]