Nobilta opened a new issue, #7867:
URL: https://github.com/apache/apisix/issues/7867

   ### Description
   
   my apisix's etcd cluster have to many watch request(6000 connections per 
second),so i want to reduce the pressure of etcd cluster.if i can modify the 
**config_etcd.lua**'s timer of new function timer from 0 to 0.5 or 1 like 
this?(i have a test,and it can reduce the number of watch useful ,but i don't 
know if this can due to a unexpected error)or if have better method to reduce 
watch?
   ```
   function _M.new(key, opts)
   
      ...
   
       if automatic then
           if not key then
               return nil, "missing `key` argument"
           end
   
           if loaded_configuration[key] then
               local res = loaded_configuration[key]
               loaded_configuration[key] = nil -- tried to load
   
               log.notice("use loaded configuration ", key)
   
               local dir_res, headers = res.body, res.headers
               load_full_data(obj, dir_res, headers)
           end
   
           ngx_timer_at(1, _automatic_fetch, obj)
   
       else
           local etcd_cli, err = get_etcd()
           if not etcd_cli then
               return nil, "failed to start a etcd instance: " .. err
           end
           obj.etcd_cli = etcd_cli
       end
   
       if key then
           created_obj[key] = obj
       end
   
       return obj
   end
   ```
   
   ### Environment
   
   - APISIX version (run `apisix version`):2.15
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`):3.5
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org.apache.org

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

Reply via email to