SSL AMI connection break

I am using SSL AMI connection with asterisk. AMI Connection is breaking if number of calls is more than 30/second. There is no impact if we use non-secure AMI connection.
The frequency of AMI disconnection increase if call volume increase per second. For example if number of call 30/second, disconnection frequency is 2 minute. If number calls 100/second then disconnection happen in every 30seconds.
The error I am getting following:
ERROR[14131]: utils.c:1234 ast_careful_fwrite: fwrite() returned error: Broken pipe

I have tested this using asterisk-1.6.2 and also in asterisk-13.9.
I am using CentOS-6.7

How to reproduce:

  1. Make AMI secure connection from java client.
  2. From java-client send Action: Originate for sip channels around 50 per second and redirect these call to another asterisk where it wait for few seconds and hangup.

Please help me to solve this problem.

Your application is not consuming data fast enough and the TCP stream is backing up within the Linux server as far as the Asterisk application.

@david551, It does not matter in whatever speed application consume data. Socket always break. Also socket does not break in case of non-secure AMI connection for any number of channels per second (checked up to 100 calls per second). If you want I can share my java application for testing.

The only meaning, in practice, for that error is a data overrun, as the result of TCP frames not being acknowledged fast enough by the remote end. Whilst I don’t understand why SSL should make a difference, it doesn’t change the fact that there was a low lever write failure, and that failure is almost always a WOULD BLOCK exception. The error has happening below the level at which Asterisk cares whether or not it is dealing with encrypted data.