Effectively troubleshoot latency in SQL Server Transactional replication: Part 2


Let us continue our troubleshooting by checking threads in this part.

Step 4.1. Troubleshoot latency in Log Reader agent’s reader thread Firstly, define the level of reader thread latency by running below query in Publisher server.
sp_replcounters GO​

The above shows reader thread replicating on average 115 transactions per second and more than 7.5mln transactions are waiting to be replicated to the distribution database. On average, transactions are waiting 134880secs to be replicated, which is high latency.

Run below in publisher server and find session id of Log Reader’ reader thread:SELECT SessionId = s.session_id, App = ISNULL(s.program_name, N ») FROM