When running below query on the primary/secondary replica of a SQL Server Always On Availability Group™
SELECT DISTINCT local_tcp_port,protocol_type,num_reads,num_writes FROM sys.dm_exec_connections WHERE local_net_address is not null;
Two local tcp ports show up for the Database mirroring protocol,
Server Name local_tcp_port protocol_type num_reads num_writes ServerName 5022 Database Mirroring 102942598 5 ServerName 63420 Database Mirroring 5 89655349
5022 port is expected, as this is the one configured as the mirroring endpoint.
The other one seems to be a dynamic port, why and for what is this one used?
Could it have to do with the fact that one is showing a high number of reads (
5022) and the other one showing a high number of writes (
Build version: 13.0.5264.1