Closed danmia closed 6 years ago
addendum.. go version go1.10.3 linux/amd64 4.14.51-66.38.amzn2.x86_64
I ran the script and everything seemed normal to me. I have also been using this in production for several years in a high performance web service and the max response time for the service is quite low. Does the same thing happen if you load the database into memory rather than memory mapping it? Perhaps you are hitting a page that is not in cache.
That very well could be it ... That never even crossed my mind, but constantly paging in as it needs different data from different workers could be it. Is there preload ability in the api?
Good catch by the way and thanks for the quick response... I starred at this for way too long. I also haven't really dealt with mmap much. It never occurred to me that pages read in would add to process RES memory.
You can preload by reading the file into memory and then using FromBytes to create the reader.
On Tue, Aug 7, 2018, 8:34 PM Dan Murphy notifications@github.com wrote:
That very well could be it ... That never even crossed my mind, but constantly paging in as it needs different data from different workers could be it. Is there preload ability in the api?
Good catch by the way and thanks for the quick response... I starred at this for way too long. I also haven't really dealt with mmap much. It never occurred to me that pages read in would add to process RES memory.
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/oschwald/geoip2-golang/issues/38#issuecomment-411273664, or mute the thread https://github.com/notifications/unsubscribe-auth/AARBM6Yv_gjFD7RnvJC0H1t8KKxiE76Jks5uOlxggaJpZM4VzLk3 .
Nice. Thanks again for the help.
I'm seeing resident memory grow continuously with a high rate (~12k/sec) of sequential lookups to the same reader(multiple workers.. each have their own reader). It looks like certain IP blocks for one reason or another seem to exacerbate it more than others .. I can't put my finger on the why yet but here is as trivial as an example as I could do. Worth noting that closing the reader does in fact clean everything up but it's a serious performance hit. Perhaps it's my use?