Actually the Perpetual Wiggle is called this because it is perpetual while enabled. It’s actually useful to rebuild BTrees every once in a while as it is a very efficient way to remove slack space, but unfortunately in FDB 7.1 the process goes too fast. It constantly removes / re-adds storages processes one at a time which is too fast for most clusters.
In FDB 7.1 you can fix this by setting a delay between processes using the PERPETUAL_WIGGLE_DELAY
knob. I suggest 2000000 which is in seconds or about 23 days.
In FDB 7.2 and later, the Perpetual Wiggle has a new concept of “minimum storage server age” which defaults to 3 weeks and is controlled by a knob DD_STORAGE_WIGGLE_MIN_SS_AGE_SEC
, also in seconds. The logic here is that if a Storage Server is using the desired configured Storage Engine type, then it will not be “wiggled” out/in until it is at least this old.
While the default ssd
/ SQLite based engine does not need the PW, many workloads will see an increase of CPU and IO overhead per operation over time as the BTree becomes more fragmented, which is mitigated by the PW periodically draining, recreating, and refilling it.
Strictly speaking, Redwood does need the PW at least for some workloads, though most probably could run without it. Redwood makes some design tradeoffs to reduce the IO and CPU cost of writes, specifically not merging under-filled sibling pages and not maintaining internal metadata necessary to shrink data files to give internal free space back to the filesystem. These decisions make sense in the context of a production FDB cluster with dedicated data volumes, as giving space back to the filesystem is unnecessary (it will be reused within Redwood) and FDB Data Distribution will move/balance key ranges around between Storage Servers which will effectively remove BTree slack and keep logical space usage roughly balanced.
If, however, your workload were to have an update pattern that produces an unusual amount of slack space constantly, or if you were to delete a large amount of data from your cluster and not replace it and you wanted all of your data files to shrink instead of holding free space internally, then the Perpetual Wiggle is a backstop to control slack and shrink data files.