Hi, community,

Now each worker keeps a copy of the external plugin configuration and each
worker sends a conf request to the plugin runner.

This is fine, but it could be optimized so that the configuration of the
external plugin is shared between different workers.

This change does not modify ext-plugin.fbs and does not require the plugin
runner to make the corresponding changes.

For APISIX, this change would require doing the following:

1. get conf_token from shared DICT.(key: plugin_ctx_id, value: conf_token)

2. get it, then skip 3

3. if not, generate conf_token and set it to shared DICT, (key:
plugin_ctx_id, value: conf_token)

4. add conf_token to PrepareConf.Req

5. Carry conf_token in HTTPReqCall.Req

(or we can just use the plugin_ctx_id as conf_token)


For Plugin Runner, this change would require doing the following:

1. parsed the conf_token from PrepareConf.Req, and stored in the cache(key:
conf_token, value: conf)

2. Parse conf_token in HTTPReqCall.Req and fetch conf in the cache by
conf_token

Welcome to discuss this.

*ZhengSong Tu*
My GitHub: https://github.com/tzssangglass
Apache APISIX: https://github.com/apache/apisix

Reply via email to