# How to set the filfactor in foundationdb.conf

**URL:** <https://forums.foundationdb.org/t/how-to-set-the-filfactor-in-foundationdb-conf/2126>\
**Category:** Using FoundationDB\
**Created:** [May 19, 2020, 10:38am UTC](https://forums.foundationdb.org/t/how-to-set-the-filfactor-in-foundationdb-conf/2126 "2020-05-19T10:38:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cliicy](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@Cliicy](https://forums.foundationdb.org/u/Cliicy)\
**Post date:** [May 19, 2020, 10:38am UTC](https://forums.foundationdb.org/t/how-to-set-the-filfactor-in-foundationdb-conf/2126/1 "2020-05-19T10:38:45Z")

</div>

Hi,  
I manually complied the master code branch which seems to include the fill-factor features since there are already have some REDWOOD\_PAGE\_REBUILD\_FILL\_FACTOR in the master source code like below shown:

fdbserver/VersionedBTree.actor.cpp: state int pageFillTarget = pageSize \* SERVER\_KNOBS-\>REDWOOD\_PAGE\_REBUILD\_FILL\_FACTOR;  
fdbserver/VersionedBTree.actor.cpp: pageFillTarget = pageSize \* SERVER\_KNOBS-\>REDWOOD\_PAGE\_REBUILD\_FILL\_FACTOR;  
fdbserver/Knobs.h: double REDWOOD\_PAGE\_REBUILD\_FILL\_FACTOR; // When rebuilding pages, start a new page after this capacity  
fdbserver/Knobs.cpp: init( REDWOOD\_PAGE\_REBUILD\_FILL\_FACTOR, 0.66 )

so, is it possible to change REDWOOD\_PAGE\_REBUILD\_FILL\_FACTOR from foundationdb.conf? and how we can set the customized fill-factor?

thanks,

---

<div class="post-metadata">

**Author:** ![SteavedHams](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/steavedhams/32/18_2.png) [@SteavedHams](https://forums.foundationdb.org/u/SteavedHams)\
**Post date:** [May 19, 2020, 11:09am UTC](https://forums.foundationdb.org/t/how-to-set-the-filfactor-in-foundationdb-conf/2126/2 "2020-05-19T11:09:17Z")

</div>

Knobs on FDB binaries are set via a command line argument

`--knob_<knob_name_in_lowercase>=<value>`

and the syntax to cause `fdbmonitor` to add a knob from `foundationdb.conf` is

`knob_<knob_name_in_lowercase> = <value>`  
(note the missing `--`)

So for example, in your `[fdbserver]` section in `foundationdb.conf` add

`knob_redwood_page_rebuild_fill_factor = 0.75`

Also, Redwood in master is a bit out of date right now because `release-6.3` is being finalized.

You can get all of the latest changes for FDB 6.3 as well as the latest Redwood (as of a half hour ago) at [https://github.com/satherton/foundationdb](https://github.com/satherton/foundationdb)

I generally only push changes to my branch that pass correctness testing and what is there now is likely to be what goes into 6.3.0.

The most interesting very recent addition is the `RedwoodMetrics` trace event. It gives a great deal of insight into what Redwood is doing. If you have any questions about the performance you are seeing then those events will be the first thing I ask for.

---

<div class="post-metadata">

**Author:** ![Cliicy](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@Cliicy](https://forums.foundationdb.org/u/Cliicy)\
**Post date:** [May 19, 2020, 2:11pm UTC](https://forums.foundationdb.org/t/how-to-set-the-filfactor-in-foundationdb-conf/2126/3 "2020-05-19T14:11:25Z")

</div>

> [@SteavedHams](#):
>
> knob\_redwood\_page\_rebuild\_fill\_factor = 0.75

many thanks for your so much detail explanation, that’s very valuable.  
I used master code branch because it passed the compilation but release-6.3 didn’t basing the latest docker image.  
I am testing basing on my built out rpm package on master code branch, and later I will use your latest Redwood source code to try.

---

<div class="post-metadata">

**Author:** ![Cliicy](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@Cliicy](https://forums.foundationdb.org/u/Cliicy)\
**Post date:** [May 20, 2020, 9:27am UTC](https://forums.foundationdb.org/t/how-to-set-the-filfactor-in-foundationdb-conf/2126/4 "2020-05-20T09:27:53Z")

</div>

Hi,  
could you please help the questions below:

1. for those released FDB versions that don’t have knob\_redwood\_page\_rebuild\_fill\_factor, every page will be filled fully or some other size?
2. when using redwood engine, FDB use direct-io or buffer-io by default? can we choose direct-io or buffer-io from certain parameters?
3. using latest master branch code which including the feature of setting knob\_redwood\_page\_rebuild\_fill\_factor, is the storage engine still named ssd-redwood-experimental or some else?
4. let’s say: reducing knob\_redwood\_page\_rebuild\_fill\_factor from default 0.66 to 0.50, in my test result, the ops/sec performance of 100-update-workloads will drop a lot (0.66: **9321** vs 0.50: **5009** ), do you think it is reasonable?

thanks!

---

<div class="post-metadata">

**Author:** ![SteavedHams](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/steavedhams/32/18_2.png) [@SteavedHams](https://forums.foundationdb.org/u/SteavedHams)\
**Post date:** [May 20, 2020, 11:19pm UTC](https://forums.foundationdb.org/t/how-to-set-the-filfactor-in-foundationdb-conf/2126/5 "2020-05-20T23:19:21Z")

</div>

> [@Cliicy](#):
>
> for those released FDB versions that don’t have knob\_redwood\_page\_rebuild\_fill\_factor, every page will be filled fully or some other size?

The hard-coded value has been 0.66 for a while, but going back far enough it used to be 1.0.

> [@Cliicy](#):
>
> when using redwood engine, FDB use direct-io or buffer-io by default? can we choose direct-io or buffer-io from certain parameters?

It should be using non-buffered IO. Since there used to be a bug here with the file open flags, I just checked again and it should be using non-buffered, using our linux KAIO file class. To verify that this is what it is doing, please look for `AsyncFileKAIOOpen` events in your log files, you should see one for each `.redwood` file opened.

> [@Cliicy](#):
>
> using latest master branch code which including the feature of setting knob\_redwood\_page\_rebuild\_fill\_factor, is the storage engine still named ssd-redwood-experimental or some else?

Yes, it will still be called `ssd-redwood-experimental` until FDB 7.0

> [@Cliicy](#):
>
> let’s say: reducing knob\_redwood\_page\_rebuild\_fill\_factor from default 0.66 to 0.50, in my test result, the ops/sec performance of 100-update-workloads will drop a lot (0.66: **9321** vs 0.50: **5009** ), do you think it is reasonable?

Remember that filling pages less full means writing more pages which means touching more unique pages during commits, as each page covers a smaller range of keys than if the pages were more full.

I can tell you more about what your workload is doing if you can post some `RedwoodMetrics` trace events from your logs from somewhere in the middle of your test. Builds from master would not yet have these events, but as of a few minutes ago `release-6.3` branch in the main repo does and my personal repo on GitHub has had them for a few days, so if you don’t have them in your logs you will need to update to one of those.

---

<div class="post-metadata">

**Author:** ![Cliicy](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@Cliicy](https://forums.foundationdb.org/u/Cliicy)\
**Post date:** [May 21, 2020, 1:58am UTC](https://forums.foundationdb.org/t/how-to-set-the-filfactor-in-foundationdb-conf/2126/6 "2020-05-21T01:58:26Z")

</div>

@SteavedHams  
Your explanation are so helpful! Thanks very much!  
yes,my test build is basing on the master code branch (I complied it and make the rpm), so there could have no any RedwoodMetrics trace.  
I will try to make the compilation pass successfully with release-6.3 or your personal repo on github.

Regards,
