1

I have a backup query like this:

BACKUP DATABASE @temp_baza TO DISK = @temp_bak
BACKUP LOG @temp_baza TO DISK = @temp_log

It is run by sqlcmd like this:

sqlcmd -l 120 -S %SQL_SERVER% -i %KOPIA_KATALOG%backupPELNY.sql 
       -o %KOPIA_KATALOG%output_PELNY.txt -v NAZWA_BAZY="%NAZWA_BAZY%" 
       -v KOPIA="%PELNY_KOPIA%\"
       

In output_PELNY.txt I have this kind of results:

BACKUP DATABASE successfully processed 645127 pages in 2819.651 seconds (**1.787 MB/sec**).

or

BACKUP DATABASE successfully processed 26338 pages in 227.348 seconds (**0.905 MB/sec**).

Main DB is on one Disc, backup is on second disk.

When I use Explorer to copy files between these two disks, I get a transfer speed of approximately 100 MB/s.

QUESTION:

Why is the backup speed so slow - I mean less than 3MB/s?

REMARKS:

  • Windows 2012 Essential + SQL Server 2008 R2 EXPRESS
  • Intel XEON E3-1270 v3 + 16GB RAM
5
  • If you run a backup using SSMS (the gui) does it have the same speed issues? Is there a setting for backup compression or encryption turned on by default? Since you have 100 MB/s disk is it CPU bound during backup? How much RAM is actually available during backup, i.e. bounce the service and try backing up. These are just some ideas.
    – sniperd
    Jun 16, 2018 at 2:42
  • ... I was trying to check if it is releated to CPU so I just used 7za v18.5.0.0 to check how this will zipping 1GB file. So to testing I use Open Hardware Monitor And here is what I can say: this CPU is never use more than 50% of single CORE and never goes up above 1.8GHz where maximus is 3,7GHz CPU Temp is about 49 Celcius FAN SPEED is about 6000 RPM is it overheated ? Jun 22, 2018 at 21:10
  • There is no compression or encryption . On this system there is 16GB RAM at all, and about 50% is free. Jun 24, 2018 at 16:13
  • Currently I have upgraded system with SQL 2017 Express If I use SSMS (GUI) then in Windows Performance Monitor I get 7MB/s Read + 7MB/s Write speed per this backuped file.... At the same time processor utilization was about 1% and the processor clock was only 0,7 Ghz. So I test if there is something wrong with my CPU. How I do the test ? In time when the backup is doing their job wiht SSMS , and the processor was used only 1% I run 7Zip with LZM2 and 8 Threads, The CPU was automaticaly rise to 90% and 3,3GHz. Jun 24, 2018 at 17:45
  • I'd take a quick look at your CPU setting in SQL: social.technet.microsoft.com/wiki/contents/articles/… and make sure something hasn't been limited.
    – sniperd
    Jun 25, 2018 at 12:30

2 Answers 2

2

To solve your problem, please refer to the following links:

  1. Options to Improve SQL Server Backup Performance
  2. Is your SQL Server backup running slow? Here’s how you can speed it up
  3. Super-Fast Backup and Restore Throughput for SQL Server
  4. MS SQL Server backup optimization
  5. How to Make SQL Server Backups Go Faster

Below are some sample queries for download

To solve the problem, I suggest that the following part of the query:

backup database DBNAME to disk='C:\1\DBNAME.bak' with buffercount=16 ,maxtransfersize=4194304
0
2

SQL Server 2008 R2 Express has the following limitations:

  • Constrained to a single CPU (this limitation was raised in 2012 to "The lesser of one socket or four cores", so multi-threading is possible)
  • 1GB RAM
  • 10GB database size (per database)

So your backup is likely to be CPU bound and/or memory bound.

(Of course, it raises the obvious question: Why are you using an express version on your server? and why not a later SQL Server version?)

Ref.: SQL Server 2008 R2 Express Database Size Limit Increased to 10GB:

What about CPU and memory limits? Are any other limits changed in SQL Server 2008 R2 Express?

  • No, the database size limit is the only limit we updated in SQL Server 2008 R2 Express. SQL Server 2008 R2 Express is still limited to 1 CPU and 1 GB of RAM.
3
  • After upgrade to SQL 2017 Express there is no change in the backup speed. Jun 24, 2018 at 16:14
  • 1
    I had an other case when after trying MS SQL EVALUTATION problem is gone. Jul 25, 2020 at 13:03
  • I still have a few cases of this type. Interestingly, that in one case we added new disks, for a new RAID1 matrix. This was 2x500 GB SSD disc. The interesting thing was that the RAID INITIALIZATION PROCESS was really very slow ...... I mean 1% per 10 minutes. And I think it is somehow related. Oct 8, 2021 at 19:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.