Has anyone successfully changed the polling rate o...
# flyte-connectors
c
Has anyone successfully changed the polling rate of a custom agent? I tried different configurations as specified here but I haven't been able to. The agent
get
method still runs every 10sec. Any advice would be appreciated
g
Hi @colossal-nightfall-74781 I have a PR to change the qps type to float64. If you want to send the request once per minute, you can set the
qps
to 1/60 and
bust
to 0.
c
Thanks @glamorous-carpet-83516.Do you suggest having a config like this
Copy code
flyteagent:
 enabled: true
 plugin_config:
   plugins:
     agent-service:
       defaultAgent:
         endpoint: "dns:///flyteagent.flyte-core.svc.cluster.local:8000"
         insecure: true
       agents:
         my-custom-agent:
           endpoint: "dns:///my-custom-agent.my-namespace.svc.cluster.local:8000"
           insecure: true
           timeouts:
             CreateTask: 5s
             GetTask: 30s
             DeleteTask: 30s
           defaultTimeout: 30s
           # Only run the agent get method once a minute
           webApi:
             readRateLimiter:
               burst: 0
               qps: 0.01666666666
What is
pollInterval
used for, what is
caching.resyncInterval
used for?
g
pollInterval
is the interval at which the plugin should poll the agent for metadata updates. propeller get the metadata from the agent every
pollInterval
second
c
so
pollInterval
has nothing to do with my agent logic, right?
I am running into rate limiting of an upstream service and cannot run the agent
get
method that often. I have to make sure, i can throttle it
g
propeller has a ratelimit queue and will push the a batch of tasks to this queue every
resyncInterval
seconds.
readRateLimiter
controls how often to read the items from the queue. propeller sends the request to your agent when processing the item in the queue.
has nothing to do with my agent logic, right?
right
c
So can you give me a working example of how to configure my agent to not run that often?
g
your example is right
Copy code
# Only run the agent get method once a minute
           webApi:
             readRateLimiter:
               burst: 0
               qps: 0.01666666666
but need to merge my PR first to change the type
c
Before that, what would be a way to throttle the agent. I am fine with less precise scheduling (5min, 15min is fine)
or i this currently not possible?
g
are you able to send the request once per seconds? or it has to be once per minute?
if you want to throttle the agent to send the one request per minute, I think it’s not possible for now
without this change
c
Once per min or even less. Once every 5min or 15min