Kapil Sharma (kapsharm)
2017-05-24 15:29:25 UTC
On plateauing - not necessarily; we do see the memory consumption increasing continuously in our deployments as well. It depends on the pattern of segment sizes over time.
ATS uses power of 2 allocators for memory pool - there are 15 of those, ranging from 128bytes to 2M if my memory serves me right - and these are per thread! ATS will choose an optimal allocator for the segments.
As Alan mentioned, once chunk are allocated, they are never freed.
Here is a totally artificial example just to make the point (please correct if my understanding is flawed):
* the traffic pattern was such that initially only 2M allocators were used then ATS will keep allocating 2M chunks until RAM cache limit (lets say it is 64GB) is reached.
* Now traffic pattern changed (smaller fragment requests), and only 1M allocators are used, ATS will now keep allocating 1M chunks, again capping at 64GB. But in the end ATS would have allocated 128GB well over RAM cache size limitâŠ.
In the past a there was some prototype of reclaimable buffer support added in ATS, but I believe it was removed in 7.0? Also there is recent discussion of adding jmalloc?
On May 24, 2017, at 11:01 AM, Alan Carroll <***@yahoo-inc.com<mailto:***@yahoo-inc.com>> wrote:
One issue is that memory never moves between the iobuf sizes. Once a chunk of memory is used for a specific iobuf slot, it's there forever. But unless something is leaking, the total size should eventually plateau, certainly within less than a day if you have a basically constant load. There will be some growth due to blocks being kept in thread local allocation pools, but again that should level in less time than you've run.
On Wednesday, May 24, 2017, 9:50:39 AM CDT, Dunkin, Nick <***@ccur.com<mailto:***@ccur.com>> wrote:
Hi Alan,
This is 7.0.0
I only see this behavior on ioBufAllocator[0], [4] and [5]. The other ioBufAllocatorsâ usage looks as I would expect (i.e. allocated goes up then flat), so I was thinking it was more likely something to do with my configuration or use-case.
Iâd also just like to understand, at a high level, how the ioBufAllocators are used.
Thanks,
Nick
From: Alan Carroll <***@yahoo-inc.com<mailto:***@yahoo-inc.com>>
Reply-To: "***@trafficserver.apache.org<mailto:***@trafficserver.apache.org>" <***@trafficserver.apache.org<mailto:***@trafficserver.apache.org>>
Date: Wednesday, May 24, 2017 at 10:33 AM
To: "***@trafficserver.apache.org<mailto:***@trafficserver.apache.org>" <***@trafficserver.apache.org<mailto:***@trafficserver.apache.org>>
Subject: Re: Understanding ioBufAllocator behvaiour
Honestly it sounds like a leak. Can you specify which version of Traffic Server this is?
On Wednesday, May 24, 2017, 8:22:46 AM CDT, Dunkin, Nick <***@ccur.com<mailto:***@ccur.com>> wrote:
Hi
I have a load test that Iâve been running for a number of days now. Iâm using the memory dump logging in traffic.out and Iâm trying to understand how Traffic Server allocates and reuses memory. Iâm still quite new to Traffic Server.
Nearly all of the memory traces look as I would expect, i.e. memory is allocated and reused over the lifetime of the test. However my readings from ioBufAllocator[0] show a continual increase in allocated AND used. I am attaching a graph. (FYI â This graph covers approximately 3 days of continual load test.)
I would have expected to start seeing reuse in ioBufAllocator by now, like I do in the other ioBufAllocators. Can someone help me understand what Iâm seeing?
Many thanks,
Nick Dunkin
Nick Dunkin
Principal Engineer
o: 678.258.4071
e: ***@curr.com<mailto:***@ccur.com>
4375 River Green Pkwy # 100, Duluth, GA 30096, USA
<image001.png>
<image001.png>
ATS uses power of 2 allocators for memory pool - there are 15 of those, ranging from 128bytes to 2M if my memory serves me right - and these are per thread! ATS will choose an optimal allocator for the segments.
As Alan mentioned, once chunk are allocated, they are never freed.
Here is a totally artificial example just to make the point (please correct if my understanding is flawed):
* the traffic pattern was such that initially only 2M allocators were used then ATS will keep allocating 2M chunks until RAM cache limit (lets say it is 64GB) is reached.
* Now traffic pattern changed (smaller fragment requests), and only 1M allocators are used, ATS will now keep allocating 1M chunks, again capping at 64GB. But in the end ATS would have allocated 128GB well over RAM cache size limitâŠ.
In the past a there was some prototype of reclaimable buffer support added in ATS, but I believe it was removed in 7.0? Also there is recent discussion of adding jmalloc?
On May 24, 2017, at 11:01 AM, Alan Carroll <***@yahoo-inc.com<mailto:***@yahoo-inc.com>> wrote:
One issue is that memory never moves between the iobuf sizes. Once a chunk of memory is used for a specific iobuf slot, it's there forever. But unless something is leaking, the total size should eventually plateau, certainly within less than a day if you have a basically constant load. There will be some growth due to blocks being kept in thread local allocation pools, but again that should level in less time than you've run.
On Wednesday, May 24, 2017, 9:50:39 AM CDT, Dunkin, Nick <***@ccur.com<mailto:***@ccur.com>> wrote:
Hi Alan,
This is 7.0.0
I only see this behavior on ioBufAllocator[0], [4] and [5]. The other ioBufAllocatorsâ usage looks as I would expect (i.e. allocated goes up then flat), so I was thinking it was more likely something to do with my configuration or use-case.
Iâd also just like to understand, at a high level, how the ioBufAllocators are used.
Thanks,
Nick
From: Alan Carroll <***@yahoo-inc.com<mailto:***@yahoo-inc.com>>
Reply-To: "***@trafficserver.apache.org<mailto:***@trafficserver.apache.org>" <***@trafficserver.apache.org<mailto:***@trafficserver.apache.org>>
Date: Wednesday, May 24, 2017 at 10:33 AM
To: "***@trafficserver.apache.org<mailto:***@trafficserver.apache.org>" <***@trafficserver.apache.org<mailto:***@trafficserver.apache.org>>
Subject: Re: Understanding ioBufAllocator behvaiour
Honestly it sounds like a leak. Can you specify which version of Traffic Server this is?
On Wednesday, May 24, 2017, 8:22:46 AM CDT, Dunkin, Nick <***@ccur.com<mailto:***@ccur.com>> wrote:
Hi
I have a load test that Iâve been running for a number of days now. Iâm using the memory dump logging in traffic.out and Iâm trying to understand how Traffic Server allocates and reuses memory. Iâm still quite new to Traffic Server.
Nearly all of the memory traces look as I would expect, i.e. memory is allocated and reused over the lifetime of the test. However my readings from ioBufAllocator[0] show a continual increase in allocated AND used. I am attaching a graph. (FYI â This graph covers approximately 3 days of continual load test.)
I would have expected to start seeing reuse in ioBufAllocator by now, like I do in the other ioBufAllocators. Can someone help me understand what Iâm seeing?
Many thanks,
Nick Dunkin
Nick Dunkin
Principal Engineer
o: 678.258.4071
e: ***@curr.com<mailto:***@ccur.com>
4375 River Green Pkwy # 100, Duluth, GA 30096, USA
<image001.png>
<image001.png>