redynasc commented on issue #7042:
URL: https://github.com/apache/apisix/issues/7042#issuecomment-1125702570
## my analysis
+ in apisix 2.13.1
1. the weight sum of all nodes in the upstream is 10000
2. rest.chash creates a chash table that contains 1600000(10000*CONSISTENT
POINTS) point structures, each of which is 8 bytes in size. The total size of
the chash table is at least 12.20MB
3. the chash table is cached in the lrucache queue, the cache key is **the
address **of the upstream object
4. When the upstream is modified through the admin interface, a new
upstream will be created, and a new chash table will be created and put into
the lrucache queue (which is a new key), but the old chash table is still in
the lrucache queue, not is released immediately until the lrucache queue is full
5. caused a memory leak
+ in apisix 1.15
1. In version 1.15 there is no such problem
2. This is because the key of the chash table in the lrucache queue is the
upstream id. When the upstream is modified, the upstream id will not change.
The new chash table will overwrite the old one in the lrucache queue, and the
old one will GC dropped
+ Why in version 2.X, the lrucache key uses the upstream address?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]