Caution is strongly recommended if using the "dont-use-fsync" option
  • 03 Oct 2018
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Caution is strongly recommended if using the "dont-use-fsync" option

  • Dark
    Light
  • PDF

Article Summary

Beginning with DHCP 4.3, ISC DHCP now supports an option to disable the use of fsync().

fsync() is a file-control primitive that instructs the operating system to synchronize pending writes to permanent storage (generally causing modified memory buffers that have not yet been written to be written to disk or similar storage).

Because synchronous filesystem writes are one of the major performance constraints on dhcpd on most systems, eliminating fsync can have the effect of increasing the number of lease operations per second that can be handled by the server. However, as documented in the dhcpd.conf man page and the README file for ISC DHCP, Internet Systems Consortium does not recommend the use of "dont-use-fsync yes; " in a server configuration because the relaxation of the requirement for synchronous write substantially increases the chance that the leases database will not be properly updated after lease operations are performed by the server. If the server is interrupted when pending lease information has not yet been written to storage, the leases file may be left in an inconsistent or erroneous state, which may cause significant problems on restart.

The use of synchronous write operations remains the default behavior in DHCP 4.3 (equivalent to "don't use-fsync no; ") and is the safest practice for server operation.

Even with fsync(), writes are not guaranteed
Please note that even when using synchronous writes, data may still not be successfully written to permanent storage. fsync() causes the filesystem to send modified buffers to storage but storage systems may also perform caching and buffering -- the point at which a write operation is fully committed depends on the particulars of the storage system used and may be beyond the direct control of dhcpd.

DHCP server operators looking for options to increase performance are advised to first try other mechanisms -- failover load balancing, delayed ack, etc -- supported by ISC DHCP.