envoyproxy/envoy

How envoy instantiates HTTP filter? especially for lua filter.

Open

#27,117 建立於 2023年5月2日

在 GitHub 查看
 (16 留言) (0 反應) (0 負責人)C++ (5,373 fork)batch import
area/luaenhancementhelp wanted

倉庫指標

Star
 (27,997 star)
PR 合併指標
 (平均合併 8天) (30 天內合併 378 個 PR)

描述

  1. Does each request create an instance per HTTP filter configured in the http_filters? That is, for each request, the connection manager will create a C++ object of Envoy::Extensions::HttpFilters::Lua::Filter class (if it's configured in http_filters).
  2. Is the same HTTP filter class allowed to be configured multiple times in http_filters? For example, this yaml specifies two configuration blocks for the same lua filter class. https://github.com/envoyproxy/envoy/blob/6e706d90b3c5a2947017c77d5bd209f16115dc8a/examples/lua/envoy.yaml#L38-L51
  3. Does each source code of lua filter have its own lua vm instance? Each code block has its own thread-local lua state, i.e. each worker thread has one lua state. https://github.com/envoyproxy/envoy/blob/6e706d90b3c5a2947017c77d5bd209f16115dc8a/source/extensions/filters/http/lua/lua_filter.h#L49 One config instance of lua filter has one default code block or code black map. https://github.com/envoyproxy/envoy/blob/6e706d90b3c5a2947017c77d5bd209f16115dc8a/source/extensions/filters/http/lua/lua_filter.cc#L812-L826 So, for each worker thread, it has <N> lua VM states, where <N> is the number of source code blocks configured?

貢獻者指南