# An existing connection was forcibly closed by the remote host

**URL:** <https://forums.percona.com/t/an-existing-connection-was-forcibly-closed-by-the-remote-host/6687>\
**Category:** Percona XtraDB Cluster 5.x\
**Created:** [November 16, 2018, 8:35am UTC](https://forums.percona.com/t/an-existing-connection-was-forcibly-closed-by-the-remote-host/6687 "2018-11-16T08:35:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![seri52](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@seri52](https://forums.percona.com/u/seri52)\
**Post date:** [November 16, 2018, 8:35am UTC](https://forums.percona.com/t/an-existing-connection-was-forcibly-closed-by-the-remote-host/6687/1 "2018-11-16T08:35:15Z")

</div>

Hello. I have 3-nodes multi-master cluster in different datacenters: Frankfurt, Amsterdam, New York. Also there are 3 photon server instances in each location. They connect to the database through Entity Framework v 6.2. Every server instance send queries to the nearest node (NY to NY; FR to FR; AMS to AMS). So there are no issues with Frankfurt and Amsterdam photon instances but sometimes(every second/third day) on New York instance I have an exception:  
System.Data.Entity.Infrastructure.CommitFailedException:  
An error was reported while committing a database transaction but it could not be determined whether the transaction succeeded or failed on the database server.  
See the inner exception and [url][Bing](http://go.microsoft.com/fwlink/?LinkId=313468%5B/url%5D) for more information.  
—\> MySql.Data.MySqlClient.MySqlException: Fatal error encountered during command execution.  
—\> MySql.Data.MySqlClient.MySqlException: Fatal error encountered attempting to read the resultset.  
—\> MySql.Data.MySqlClient.MySqlException: Reading from the stream has failed.  
—\> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.  
—\> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host.  
There are no differences in those photon server instances. Most of the users are connecting to New York photon server so the NY node in cluster so it is the most loaded node. Maybe there are wrong settings for my node? The average online of users is ±1000. My NY node general insides are:

CPU(s): 2  
Model name: Intel(R) Xeon(R) CPU E5-2630L 0 @ 2.00GHz  
RAM: 4GB

Percona cluster settings:

wait\_timeout=60  
interactive\_timeout=60  
max\_connections=2048  
wsrep\_sst\_method=xtrabackup-v2  
pxc\_strict\_mode=ENFORCING  
binlog\_format=ROW  
default\_storage\_engine=InnoDB  
innodb\_autoinc\_lock\_mode=2  
wsrep\_slave\_threads=8  
wsrep\_retry\_autocommit=1  
wsrep\_provider\_options=base\_dir = /var/lib/mysql/; base\_host = \<HOST\_IP\>; base\_port =\<BASE\_PORT\>; cert.log\_conflicts = no; debug = no; evs.auto\_evict = 0; evs.causal\_keepalive\_period = PT1S; evs.debug\_log\_mask = 0x1; evs.delay\_margin = PT1S; evs.delayed\_keep\_period = PT30S; evs.inactive\_check\_period = PT0.5S; evs.inactive\_timeout = PT15S; evs.info\_log\_mask = 0; evs.install\_timeout = PT7.5S; evs.join\_retrans\_period = PT1S; evs.keepalive\_period = PT1S; evs.max\_install\_timeouts = 3; evs.send\_window = 10; evs.stats\_report\_period = PT1M; evs.suspect\_timeout = PT5S; evs.use\_aggregate = true; evs.user\_send\_window = 4; evs.version = 0; evs.view\_forget\_timeout = P1D; gcache.dir = /var/lib/mysql/; gcache.freeze\_purge\_at\_seqno = -1; gcache.keep\_pages\_count = 0; gcache.keep\_pages\_size = 0; gcache.mem\_size = 0; gcache.name = /var/lib/mysql//galera.cache; gcache.page\_size = 128M; gcache.recover = no; gcache.size = 128M; gcomm.thread\_prio = ; gcs.fc\_debug = 0; gcs.fc\_factor = 1; gcs.fc\_limit = 100; gcs.fc\_master\_slave = no; gcs.max\_packet\_size = 6  
thread\_pool\_size=2  
query\_cache\_size=1048576  
query\_cache\_limit=query\_cache\_limit  
open\_files\_limit=open\_files\_limit

So the question is: could it be some bugs in Entity Framework / network issues or my settings are wrong for the use case? Thanks.

---

<div class="post-metadata">

**Author:** ![lorraine.pocklington](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/lorraine.pocklington/32/37_2.png) [@lorraine.pocklington](https://forums.percona.com/u/lorraine.pocklington)\
**Post date:** [November 19, 2018, 7:04am UTC](https://forums.percona.com/t/an-existing-connection-was-forcibly-closed-by-the-remote-host/6687/2 "2018-11-19T07:04:08Z")

</div>

Hi, [seri52](https://www.percona.com/forums/member/42472-seri52), thanks for your question.

Could you post a few more details:  
[LIST]  
[_]versions of Percona XtraDB Cluster  
[_]version of OS  
[_]if there are any error logs, could you post those, please  
[_]the my.conf for each node of the cluster  
[\*]any other information that you think might be relevant  
[/LIST] Thanks!

---

<div class="post-metadata">

**Author:** ![seri52](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@seri52](https://forums.percona.com/u/seri52)\
**Post date:** [April 4, 2019, 7:07am UTC](https://forums.percona.com/t/an-existing-connection-was-forcibly-closed-by-the-remote-host/6687/3 "2019-04-04T07:07:30Z")

</div>

> [@lorraine.pocklington;52897](#):
>
> Hi, [seri52](https://www.percona.com/forums/member/42472-seri52), thanks for your question.
> 
> Could you post a few more details:  
> [LIST]  
> [_]versions of Percona XtraDB Cluster  
> [_]version of OS  
> [_]if there are any error logs, could you post those, please  
> [_]the my.conf for each node of the cluster  
> [\*]any other information that you think might be relevant  
> [/LIST] Thanks!

Hello!  
Thanks for reply! I’ve solved this problem long time ago 😃  
Just forgot about my question on forum, sorry!
