Instant File Initialization: What It Actually Does and How to Enable It

Instant File Initialization is one of the few SQL Server settings that’s genuinely free performance: no license cost and no downside for the overwhelming majority of installs. It’s still routinely left unconfigured on real production servers, because it’s a Windows privilege grant rather than a SQL Server setting, and it happens outside SSMS entirely. This post covers what it actually does, how to check it directly rather than assume, and how to enable it.


What It Actually Does

Without IFI, SQL Server zero-fills every new byte of disk space before it can use it whenever it creates a database, adds a file, grows a file (autogrowth or a manual ALTER DATABASE ... MODIFY FILE) or restores a database. That’s a full write pass across the entire new region, purely for security, so a new file can never expose leftover data from whatever previously occupied that disk space. With IFI enabled, SQL Server skips the zero-fill for data files and the space becomes usable immediately. Log files follow their own rules, covered further down.

The practical impact scales with how much you’re growing and how often: a large data file growth event or a big database restore without IFI can take dramatically longer than the same operation with it enabled, entirely because of the zero-fill pass.


How to Actually Check It

Don’t assume, check directly. The real signal is on sys.dm_server_services:

SELECT servicename, instant_file_initialization_enabled, service_account
FROM sys.dm_server_services
WHERE servicename LIKE 'SQL Server (%';

Real output from the lab instance:

SSMS results of sys.dm_server_services: SQL Server (MSSQLSERVER), instant_file_initialization_enabled Y, service account NT Service\MSSQLSERVER

Enabled here. This instance runs under a virtual service account (NT Service\MSSQLSERVER), and since SQL Server 2016 setup has a checkbox, Grant Perform Volume Maintenance Task privilege to SQL Server Database Engine Service, that grants the privilege to the service SID at install. It’s an install option, not a guarantee: an unticked box, an older install, or a grant made by hand to a named account that later changed can all leave it off, which is exactly why checking directly beats assuming.

The error log records the same thing at every startup, as Database Instant File Initialization: enabled (or disabled), which is a handy second check when you’re already reading the log. This searches the current log for it:

EXEC sys.xp_readerrorlog 0, 1, N'Instant File Initialization';
SSMS running xp_readerrorlog for Instant File Initialization in Results to Text: Database Instant File Initialization: enabled, logged at the 20 Nov startup

What Actually Grants It

IFI depends on the SQL Server service account holding the Windows Perform Volume Maintenance Tasks privilege (SeManageVolumePrivilege). To grant it manually:

  1. Open Local Security Policy (secpol.msc) on the server, or Group Policy if it’s domain-managed.
  2. Navigate to Local Policies → User Rights Assignment → Perform volume maintenance tasks.
  3. Add the SQL Server service SID (NT SERVICE\MSSQLSERVER on a default instance, NT SERVICE\MSSQL$InstanceName on a named one) or the service account.
  4. Restart the SQL Server service for the privilege to take effect, it isn’t picked up live.

Setup does this for you if you tick the checkbox above, or pass /SQLSVCINSTANTFILEINIT on a command-line install. Grant it to the service SID rather than the account where you can, because the grant then survives a service account change. A grant made to a named account is lost when the service moves to a different account, and nothing breaks immediately, files just grow slower than they need to.


Log Files and TDE

Before SQL Server 2022, log files were never instantly initialized. Every log growth was zero-filled whatever the privilege, since SQL Server relies on being able to find the end of the written log reliably, and stale bytes from a previous use of that disk space would break that.

From SQL Server 2022, log growth events up to 64 MB can skip the zero-fill, on all editions, and 64 MB is the default log autogrowth for new databases. Growths larger than 64 MB are still zero-filled in full. This part doesn’t need the Perform Volume Maintenance Tasks privilege at all, and it still applies to databases with TDE enabled. Microsoft Learn covers the conditions in Database Instant File Initialization.

Trace flags 3004 and 3605 write each zeroing operation to the error log, which makes this easy to see on a test instance. A 64 MB log growth followed by a 128 MB one on SQL Server 2025:

What the error log showsexample output, not something to run
Skip zeroing C:\Temp\IFILogTest_log.ldf from page 1024 to 9215 (Offset 0x800000 to 0x47fe000) 63 mb Zeroing C:\Temp\IFILogTest_log.ldf from page 9215 to 9216 (Offset 0x47fe000 to 0x4800000) 0 mb Zeroing C:\Temp\IFILogTest_log.ldf from page 9216 to 25600 (Offset 0x4800000 to 0xc800000) 128 mb Zeroing completed on C:\Temp\IFILogTest_log.ldf (elapsed = 854 ms) 128 mb

The 64 MB growth skips everything except its final page. The 128 MB growth is written in full.

TDE databases lose the benefit on data files. Data file growth on a TDE-enabled database is zero-filled even with the privilege granted. Only the small log growths above still skip it.


Best Practices

  • Check sys.dm_server_services directly on every server you inherit, don’t assume it’s on just because it’s a widely-known recommendation.
  • Pre-size data files to their expected working size rather than relying on many small autogrowth events, even with IFI enabled, fewer growth events mean fewer chances to hit a bottleneck elsewhere (file-system fragmentation, VLF creation on the log side).
  • Size and grow the log file deliberately. Before SQL Server 2022 no log growth benefits from IFI, and from 2022 only growths of 64 MB or less do, so a larger log growth increment is zero-filled in full every time it fires.
  • Re-verify IFI after any service account change, it’s a common way for a previously-working setup to silently lose the privilege when it was granted to the account rather than the service SID.

Related

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *