To resolve timeout issues while taking SQL Server backups, you can increase the SqlCommand.Timeout property value to a higher limit. However, this problem may still arise when the database size is large. Setting SqlCommand.Timeout to -1 (infinite) can solve the problem, but it is not recommended as it can lead to adverse consequences on the system. Instead, it is recommended to troubleshoot and improve the performance of the queries. By far, the most common reason for query timeouts is underperforming queries. Making the query run faster is the recommended first target of your troubleshooting. You can use Extended Events or SQL Trace to identify the queries that cause the timeout errors and execute and test the queries in SQLCMD or in SQL Server Management Studio (SSMS). If the queries are fast in SQLCMD and SSMS but slow on the application side, change the queries to use the same SET options used in SQLCMD and SSMS. If you expect the processing queries to take more than one hour, raise the ExternalCommandTimeout setting higher than one hour.
References: