Worker Idempotency

:man_cook:
I am implementing an idempotency approach, that only works within each worker.
From my logs users with the same IP go to the same worker, especially in regular visits.
In some rare exceptions, they touch different workers.

:thought_balloon: Please give me your feedback on this approach and other suggestions.

Requests received on the same client connection will tend to go to the same worker. If the client is using HTTP/2, then they’ll tend to send all their requests on the same connection, until the connection times out. But, the next connection will commonly go to a different worker, and clients using HTTP/1 will often open several connections that will all go to different workers. Also, there are situations where even requests on the same connection may be distributed to multiple workers (especially for high-traffic workers), and we might change our strategy in the future. So, in general, you can’t count on this, but it can be used as an optimization.

1 Like