[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: LMDB: file size increase (due to new free pages) even though write transaction does not add/update items
- To: Howard Chu <hyc@symas.com>
- Subject: Re: LMDB: file size increase (due to new free pages) even though write transaction does not add/update items
- From: Argyrios Kyrtzidis <akyrtzi@gmail.com>
- Date: Mon, 4 Apr 2016 23:03:39 -0700
- Cc: openldap-technical@openldap.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=+tbeu6G37Qa7TwZSg+NlRxifuVBgs6BrIqASvCp83wQ=; b=hKU4p4ptOCrTisYtholfsPb/FPmilcnVpxZRyqTYIWp7E1O0UZqsGS9aBB/roCtGFF SoqpmwRJ0m4UmR2aynRkKh7xYc3n0S/IG3gc4eXa+rMHvVkERI8DHV0gjXWvnCXTIUEt 3QjkhncPYSS+kWU2IYZLfzVEjFtTK12Lv5+lFUNoZ2JcbYBArx1nhaSRTpRlSQDkER5n pJTnD9fBUzhSdEQtCsWTOpSFOvytz+wAybsRsFh1WnyYoPjqlcFHBAvereXOqlbXEzxs 0EsJG+f3Rv2++8jyjPckWivirUhk6eGlHLGHhZLxzAyCsAWW7dZdKW4CX4DcjeZNkgj4 mTzg==
- In-reply-to: <5701E105.5030902@symas.com>
- References: <77C4334E-A6FE-4802-B7AD-C69D0BAEFD5D@gmail.com> <5701E105.5030902@symas.com>
> On Apr 3, 2016, at 8:35 PM, Howard Chu <hyc@symas.com> wrote:
>
> Argyrios Kyrtzidis wrote:
>> Hi,
>>
>> Thank you for making LMDB available.
>>
>> I’m using LMDB on OSX (without MDB_WRITEMAP, so the database file size is relative to the stored data, not the max mapsize).
>> I’ve noticed that write transactions that have a large number of ‘attempted’ updates, but that do not actually make any updates due to MDB_NOOVERWRITE / MDB_NODUPDATA, cause an increase in the database file size, which mdb_stat attributes to an increased number of free pages.
>> This is with latest master of the github mirror.
>>
>> I’m wondering if you have any hints on what I may be doing wrong ? I’d like if possible to avoid the database size increasing if the write pass did not make any updates.
>
> Call mdb_txn_abort() instead of mdb_txn_commit() when you encounter KEYEXIST errors.
Thanks for the tip! I’d need to keep track of more information across the various database updates but it is doable.
Do you think there is a missed opportunity for reusing existing free pages ? I’d expect that it would not consistently increase the number of free pages, if there are free pages available.
>
> --
> -- Howard Chu
> CTO, Symas Corp. http://www.symas.com
> Director, Highland Sun http://highlandsun.com/hyc/
> Chief Architect, OpenLDAP http://www.openldap.org/project/