Pending Replication Transactions in the Transaction Log

The below query gets the count of pending replication transactions from the transaction log. The log reader agent sends these txns to the distribution database and high no.of pending txns in the log is not a good sign of replication performance as well as affects database performance due to log growth. The log reader agent is not present in snapshot replication.

The VLFs in the log are marked as active and cannot be reused until these txns are sent to the distribution database. This can make the log file to grow and since log file is not instant file initialized, it affects the performance.

Select instance_name as DBName,cntr_Value as [PendingTransInTransactionLog]
from sys.dm_os_performance_counters A inner join Sys.databases B on and B.is_published=1 where LTRIM(counter_name) like '%Repl. Pending Xacts%'