Thousand dynamic frontend (iot)


I put in place an architecture for IOT where IOT connect to http2 backend (in direct no traefik on this) for tunnel it's own http server (base on After connection backend set in redis database client url and it's own url. Traefik (2.2) read it and redirect client url on backend where iot is connected. All system is on K8S cluster.

A little schema :

For now I have about 50% of final IOT number, is arround 5000 (target is 10000 maybe more).

Another think I hope maybe one day I can have another traefik in front (ideally same number of traefik than tunnel).

On paper it's work but in real life not, tunnel (backend) it's ok and it can management lot of client without issue. But for traefik it's not ok, for now it's consumme all CPU I give it, it failed some time (about 5 or 6 days no more refresh with redis database), it make about 30s/60s to refresh when I add information to redis.

I wonder if my solution is the best ? Maybe redis (or KV) it's not good choice ? I just have one constraint is that during a restart of Traefik (pod) it must find the same frontend as before.

Thank in advance for your time and reponse.

I find a solution with openresty (nginx), redis and lua. No more overload on cpu, no more delay on new connected client, unlimited number of frontend. For me it's ok.