Resolving 'Closing connection due to unexpected external event' errors

Overview

"Closing connection" errors can be found in the Alert Log or shown in the Health monitor alerts when adding database servers to your ScaleArc load balancer.

The alerts will typically occur when adding additional servers to a ScaleArc cluster already having a number of database servers:

Sample error messages:

YYYY-MM-DD HH:MM:SS CID: 1, Client IP: 10.xx.xx.xx, User: <username>, Debug_Code: 0, 
Message: Closing connection [ssid:48510;Cli:10.xx.xx.xx:36368/DB:10.yy.yy.yy]
due to unexpected external event, Reason:'Error reading query from client(auth on).
Probabaly client closed abruptly,Advice:Check if client restarted/Take tcpdump trace if
unexp'td,debuginfo# 7;0,-9/0,enum:0:Success#';  SSL: No , State: -1, SSID: 48510,
DB: <database_name>, DB IP: 10.xx.xx.xx, Type: 37
YYYY-MM-DD HH:MM:SS CID: 4, Client IP: 10.xx.xx.xx, User: <username>, Debug_Code: 0, 
Message: Closing connection [ssid:1103264;Cli:10.96.160.188:7070/DB:10.96.134.108;sfd(Rem:10.xx.xx.xx:1198;Lprt:13723)]
due to unexpected external event, Reason:'TCP RST recieved from client,Advice:Check if client restarted,
debuginfo# ev:25;21;st:state_less#'; SSL: No , State: -1, SSID: 1103264, DB: nol, DB IP: 10.xx.xx.xx, Type: 37

Solution

Since ScaleArc manages connections between the database clients (applications, connection pools, database management apps) and the database (MySQL, MSSQL, PostgreSQL), it manages idle timeouts for connections on both ends. The timeouts should be smaller than what is configured on the application on the other end of the connection. This KB article has more information on timeouts and other connection parameters.

The above error is noticed when the client application is a connection pool and has a higher timeout than what is configured as the client timeout on ScaleArc. If the client timeout value on ScaleArc is increased to be larger than what is configured on the connection pool, then ScaleArc would be able to keep the connection until the client closes it. However, this alert can be ignored and doesn't hamper normal operation.

Additional recommendations:

  • Enabling SSL authentication offload by navigating to CLUSTERS > Cluster Settings > SSL tab and changing the SSL Offload toggle to ON.
    SSL_Offload.png
  • Disable passthrough for TDS 7.1 by navigating to CLUSTERS > Cluster Settings > DEBUG tab and toggling the TDS 7.1 Connections Passthrough button to OFF:
    TDS_7.1_Conenctions_Passthrough.png

Information about the database idle timeout

For the connection to the database, the timeout configured on ScaleArc should be less than what is configured in the database for ScaleArc to be able to control the connection. The timeout value configured for ScaleArc on the server-side can be validated by checking the value of the idletimeout column in the lb_servers table of the configuration database as shown
servertimeout.png

Information about the client idle timeout

Similarly for the client, the value configured on ScaleArc is visible in the maxclienttimeout in the lb_advsettings table of the configuration database as shown here
clienttimeout.png

Comments

0 comments

Please sign in to leave a comment.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request