Asterisk PHP AGI Broken Pipe error

Good day. I have a following problem:
Asterisk version
We use phpAGI to make outgoing calls to subscribers of the city. Number of channels - 20. Start calling to 5000 subscribers. Near 600-700 I got this error:
PHP Notice: fwrite (): send of 163 bytes failed with errno = 32 Broken pipe in / ringer / phpagi / phpagi-asmanager.php on line 137
After error php script is still running, but there are no following outgoing calls.
Please help me solve the problem, or at least where to look. Thank you

php agi use popen in this allclass and it’s possible that a part of instruction do an error with pipe if you have no good right in your file. do you want to write the line 137 of agi-manager

based on my experience and Google search : This happens randomly when server load is high.

guys help you for response.
to bart1485 this file is an executable script, not a file to write. And 137th line contains following:

function send_request($action, $parameters=array()) { $req = "Action: $action\r\n"; foreach($parameters as $var=>$val) $req .= "$var: $val\r\n"; $req .= "\r\n"; fwrite($this->socket, $req); // this is #137 return $this->wait_response(); }

to ambiorixg12 That’s strange because server execute only this program and nothing else…
for now we use temporary solution: after every 700 calls script reloads Asterisk server, but I know this is not very good decision… so i think there are some kind of buffer, that with time become overflowed.