You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/02/07 01:37:54 UTC

[GitHub] [apisix] ShaoZeMing opened a new issue #3541: Add global plugins, such as cors, zipkin, and find that the response header appears twice. I want to know if the global plugin is called repeatedly internally, will this affect performance? ?

ShaoZeMing opened a new issue #3541:
URL: https://github.com/apache/apisix/issues/3541


   ### Issue description
   Add global plugins, such as cors, zipkin, and find that the response header appears twice. I want to know if the global plugin is called repeatedly internally, will this affect performance? ?
   
   I added cors and zipkin plugins globally, but I found that the response header appeared twice, so I want to ask.
   
   Thank you
   
   #### Example
   
   ![image](https://user-images.githubusercontent.com/19376576/107133878-b79b9580-6927-11eb-8b5f-7063df2a9821.png)
   
   
   ### Environment
   
   * apisix version : 2.2-master
   * OS (cmd: `uname -a`): linux  centos
   * OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`): 1.19
   * etcd version, if have (cmd: run `curl http://127.0.0.1:9090/v1/server_info` to get the info from server-info API): 3.4
   * apisix-dashboard version, if have: 2.3-docker
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] ShaoZeMing commented on issue #3541: Add global plugins, such as cors, zipkin, and find that the response header appears twice. I want to know if the global plugin is called repeatedly internally, will this affect performance? ?

Posted by GitBox <gi...@apache.org>.
ShaoZeMing commented on issue #3541:
URL: https://github.com/apache/apisix/issues/3541#issuecomment-774579746


   > It is fine to call global plugin multiple times, as there is a phase filter:
   > https://github.com/apache/apisix/blob/e5cd46e38e09d1025817381a3bf0b85a4f02a528/apisix/init.lua#L573-L574
   > 
   > If the global plugin doesn't define a method for a specific phase, it won't be run.
   > 
   > cors / zipkin are needed to be run in multiple phases with different code. The same code won't be run twice.
   
   Thank you


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander closed issue #3541: Add global plugins, such as cors, zipkin, and find that the response header appears twice. I want to know if the global plugin is called repeatedly internally, will this affect performance? ?

Posted by GitBox <gi...@apache.org>.
spacewander closed issue #3541:
URL: https://github.com/apache/apisix/issues/3541


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #3541: Add global plugins, such as cors, zipkin, and find that the response header appears twice. I want to know if the global plugin is called repeatedly internally, will this affect performance? ?

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #3541:
URL: https://github.com/apache/apisix/issues/3541#issuecomment-774576491


   It is fine to call global plugin multiple times, as there is a phase filter:
   https://github.com/apache/apisix/blob/e5cd46e38e09d1025817381a3bf0b85a4f02a528/apisix/init.lua#L573-L574
   
   If the global plugin doesn't define a method for a specific phase, it won't be run.
   
   cors / zipkin are needed to be run in multiple phases with different code. The same code won't be run twice.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org