[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: LMDB: "non-cached" reads
- To: Dmitri Shubin <dmitri.shubin@itiviti.com>, openldap-technical@openldap.org
- Subject: Re: LMDB: "non-cached" reads
- From: Howard Chu <hyc@symas.com>
- Date: Tue, 21 Jan 2020 20:25:40 +0000
- Dkim-filter: OpenDKIM Filter v2.10.3 zmcc-2-mta-1.zmailcloud.com F1192CF6DB
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=symas.com; s=37C7994C-28CA-11EA-A30F-68F90BB9D764; t=1579638343; bh=5f3bGCRGc69FNN8gQGz5hW4Nhbzn25uurQkmchCA1nk=; h=To:From:Message-ID:Date:MIME-Version; b=LYx+Dlaq+QUtWoYLNcED+UNRXpZxcFJxjEsdSPjUTGxwZyGuTK2NYWw0do9zOtOD7 rHfmLz4dUADwz7yWIcNX/hmMb79i10LOxBDM3ab+xXHJUM/adz1G/yuxw3XzML2PpO GIsxkcn2e38GuqMmXR+9/w0T3tvIJusu/XMgfgWJS/8quM2BG/y43n+pyN1OOKwl/P aVNMWXgju+byVSzPX8tOegpzGOCbO+sg139Y02BITLcMlCY9O0v5i+D/vFRNWL4nm2 G+f1uQmzlXq0IDSMq4N4w+xz57Z3FvlHX8XBS+c0MM950kuUSoGBa+j7+clJjl5qOo dzyp/pVQXj4Tw==
- In-reply-to: <CAGpA2rqVaRJZKYqVS3wxLkpB6hWHh=0Vvh6S+WwnvgzyfdcfJA@mail.gmail.com>
- References: <CAGpA2rqVaRJZKYqVS3wxLkpB6hWHh=0Vvh6S+WwnvgzyfdcfJA@mail.gmail.com>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53
Dmitri Shubin wrote:
> Hi,
>
> Our application uses LMDB and sometimes we need to perform scan of old ("cold") data.
> The problem here is that this data can/will remove "hot" data from page-cache.
>
> Ideally to prevent this from happening we'd like to somehow mark cursor as "streaming"/"non-temporal".
> But AFAICS there is no such feature currently.
>
> We're experimenting with marking pages returned by cursor with madvise(MADV_DONTNEED) and this at least prevents RSS from growing.
> But maybe there are some downsides of this approach?
You obviously can only mark the pages after you've used the result. If you mark it
before returning the data to the caller, some other thread may cause those pages
to be reused before you get a chance to see the data, causing a wasted re-fetch.
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/