Skip to content

Antivirus slowing SQL Server ERP: error 833 and exclusions

  • Home
  • Blog
  • Antivirus slowing SQL Server ERP: error 833 and exclusions
Antivirus slowing SQL Server ERP: error 833 and exclusions
Short answer

The antivirus file system filter driver sits in the path of every SQL Server read and write; while .mdf, .ldf, .ndf, backup and FILESTREAM files are scanned, I/O latency grows, ERP screens freeze and error 833 appears in the error log. The fix is to exclude the processes, folders and extensions listed in Microsoft’s “Configure antivirus software to work with SQL Server” article, then measure the result with wait statistics and Perfmon.

Symptoms: “I/O requests taking longer than 15 seconds” (error 833)

  • In the ERP, operations such as saving an invoice, posting a stock movement or running a report time out; complaints usually increase at peak hours or during a scheduled antivirus scan.
  • The SQL Server error log shows a message following this pattern: “SQL Server has encountered n occurrence(s) of I/O requests taking longer than 15 seconds to complete on file [...] in database [...]” (error 833).
  • PAGEIOLATCH_SH, PAGEIOLATCH_EX and WRITELOG waits stay consistently above 10–15 milliseconds per request.
  • Backup and restore are slower than expected. Microsoft notes that if Defender is not set up to exclude FILESTREAM files, backup and restore performance can degrade.
  • Less often: a database is marked “suspect” at startup, or full-text catalogs report errors. Microsoft states that if scanning software holds a database file open when SQL Server tries to open it, the database may be marked as suspect.

Root cause: a filter driver in the middle of the I/O path

On Windows, antivirus programs attach to the I/O path through file system filter drivers and scan passing I/O packets for known malicious patterns. SQL Server constantly sends large numbers of read and write requests to its data and log files; as each request passes through the filter driver, latency accumulates. The decisive test in Microsoft’s I/O troubleshooting method is this: if SQL Server reports latency but the Avg. Disk sec/Transfer counter in Perfmon does not, the problem lies in the layer between SQL Server and the Partition Manager, that is, in filter drivers. In short, the disk is not slow; the layer between the disk and SQL Server is.

Some security products also load modules into the sqlservr.exe process or divert SQL Server or Windows code with “detour” techniques. Microsoft states that if such applications or drivers are not designed correctly, they can cause a wide range of issues for SQL Server.

Step-by-step fix

  1. See which filter drivers are attached to the volumes that hold SQL files. Run this in an elevated command prompt; altitudes in the 320000–329998 range belong to the “FSFilter Anti-Virus” group, for example WdFilter at altitude 328010 is Microsoft Defender.
  2. Measure whether SQL Server reports latency at file level. Files whose average latency stays above 10–15 milliseconds are suspect (command below).
  3. Measure the Windows side in the same time window. If this counter stays low while SQL reports high latency, look for the problem in a filter driver (command below).
  4. Collect the real paths to exclude. Data, log, FILESTREAM and full-text files may not be in the default folders; build the list from a query, not from guesswork (command below).
  5. Define the exclusions according to Microsoft’s list. Processes: sqlservr.exe, sqlagent.exe, sqlbrowser.exe and SQLDumper.exe. File types: data files (.mdf, .ldf, .ndf), backups (.bak, .trn), trace files (.trc), Extended Events targets (.xel, .xem), audit files (.sqlaudit), query files (.sql) and dump files (.mdmp). Folders: DATA, Backup (or the backup folder if backups are on another disk), FTDATA, FILESTREAM containers, the instance LOG folder and, for In-Memory OLTP, the xtp folder under DATA.
  6. If you run a failover cluster instance (FCI), also exclude the quorum drive (Q:\), C:\Windows\Cluster and the MSDTC directory on the MSDTC drive. Microsoft states that antivirus software on a cluster must be a cluster-aware version.
  7. If you use Microsoft Defender, add the exclusions with PowerShell, Group Policy (Computer configuration > Administrative templates > Windows components > Microsoft Defender Antivirus > Exclusions) or Intune. In the example below the paths assume a SQL Server 2022 default instance and sample data disks; change them to match your own query results.
  8. Confirm that the exclusion is really in effect. MpCmdRun tells you whether a given path is excluded (Defender platform version 4.18.2111 or later; command below).
  9. If you use a third-party endpoint product, enter the same list in the server policy of the product’s central management console; an exclusion entered only in the local client on the server may be overridden when the central policy is applied.
  10. Check whether third-party modules are loaded into sqlservr.exe; entries not from Microsoft show which product has entered the process (command below).
  11. Measure before and after. Microsoft recommends testing the full system under a representative load before and after an antivirus change. Repeat steps 2 and 3 in the same time window; PAGEIOLATCH and WRITELOG averages should drop and error 833 should disappear.
# Step 1
fltmc instances

# Step 3
Get-Counter "\LogicalDisk(_total)\Avg. Disk sec/Transfer" -SampleInterval 2 -MaxSamples 30

# Step 7
Add-MpPreference -ExclusionProcess "C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Binn\sqlservr.exe"
Add-MpPreference -ExclusionPath "D:\SQLData", "E:\SQLLog", "F:\SQLBackup"
$p = Get-MpPreference
$p.ExclusionPath; $p.ExclusionProcess; $p.ExclusionExtension

# Step 8
& "$env:ProgramFiles\Windows Defender\MpCmdRun.exe" -CheckExclusion -Path D:\SQLData
-- Step 2
SELECT DB_NAME(vfs.database_id) AS db, mf.physical_name,
  vfs.io_stall_read_ms / NULLIF(vfs.num_of_reads, 0) AS avg_read_ms,
  vfs.io_stall_write_ms / NULLIF(vfs.num_of_writes, 0) AS avg_write_ms
FROM sys.dm_io_virtual_file_stats(NULL, NULL) AS vfs
JOIN sys.master_files AS mf
  ON vfs.database_id = mf.database_id AND vfs.file_id = mf.file_id
ORDER BY avg_read_ms DESC;

-- Step 4
SELECT DB_NAME(database_id) AS db, type_desc, physical_name
FROM sys.master_files
ORDER BY type_desc, physical_name;

-- Step 10
SELECT name, company, description
FROM sys.dm_os_loaded_modules
WHERE company IS NULL OR company NOT LIKE 'Microsoft%';

Set-MpPreference overwrites the existing exclusion list; use Add-MpPreference to keep the current list. Every exclusion is a protection gap; add only the folders where SQL Server files actually live.

Long-term prevention and the security trade-off

  • Microsoft’s warning is clear: if an excluded file becomes infected, the antivirus cannot detect it. Tighten NTFS permissions so that only the SQL Server service account and authorised administrators can write to the excluded folders.
  • In Defender, a process exclusion skips scanning of files the process opens and also stops network protection and attack surface reduction (ASR) rules for that process. Do this deliberately and only for the processes Microsoft lists.
  • In Defender, an extension exclusion applies everywhere on the device. To limit an extension to a specific folder, use a path exclusion with a wildcard such as D:\SQLData\*.mdf.
  • Keep scanning excluded backup files at the backup target they are copied to; that way the latency on the SQL server disappears without leaving backups unchecked.
  • The folder name (for example MSSQL16) changes when you upgrade SQL Server; add the exclusion list to your upgrade checklist. Microsoft recommends reviewing exclusions periodically and keeping a record of why each one was needed.

When to call an expert

If Perfmon latency is also high after the exclusions, the problem is no longer the filter driver but a different layer, such as storage, SAN configuration, query design or insufficient memory, and SQL Server and Windows need to be analysed together. As part of our security solutions (antivirus and firewall) service, Workas investigates the ERP slowdowns we encounter in the field at businesses in Denizli and helps you regain performance with the exclusions Microsoft recommends, without switching protection off.

Frequently Asked Questions

Is excluding only the sqlservr.exe process enough?

No. A process exclusion only covers files that process opens; when other processes such as a backup agent or indexing access the same files, a scan can still be triggered. Microsoft lists file types and folders alongside the processes.

Could we simply remove antivirus from the SQL server?

Microsoft asks for the risk of each SQL Server to be assessed individually; servers exposed to the internet, hosting file shares or using Database Mail are high risk. The recommended path is not to remove protection but to define the right exclusions.

Is error 833 always caused by antivirus?

No. Hardware, SAN configuration or disk-heavy queries produce the same error. If Perfmon latency is also high, the problem is most likely in storage; if it is high only on the SQL side, a filter driver is a strong candidate.

How do I know the exclusion is working?

In Defender, the MpCmdRun -CheckExclusion command tells you whether a path is excluded. The real proof is that PAGEIOLATCH and WRITELOG averages drop under the same load and error 833 disappears.

Sources

  1. Microsoft Learn: Configure antivirus software to work with SQL Server
  2. Microsoft Learn: Troubleshoot slow SQL Server performance caused by I/O issues
  3. Microsoft Learn: Exclusions in Microsoft Defender Antivirus
  4. Microsoft Learn: Configure custom exclusions for Microsoft Defender Antivirus

Let's Get Started

Let's Work Together!

Let's plan your company's IT needs together — we'll quickly find the right solution for you.

x

Since 2002, Workas Software Technology has provided businesses in Denizli with ERP, cybersecurity, network, server and backup, custom software and AI solutions.

Address
Kınıklı, Hüseyin Yılmaz Cd. No:67,
B Blok Z06, 20160 Pamukkale/Denizli, Türkiye
Get in Touch
0549 669 99 06
0535 089 29 29
Working Hours
Mon - Sat: 8:00 - 18:00