在收到FCM和GCM SNS推送通知后,该网站将退出州

We are running a Drupal website in EC2(4 instances) under load balancer.

We have a separate PHP file where we have a cron job to send push notification.

Initially we were using GCM SNS Push notification using its relevant credentials, we didn't face any problem.

Now we have included FCM SNS API along with this GCM SNS API. Now once we receive the push notification for both GCM and FCM Subscribed devices, the instances under load balancer goes to out of service, and the website URL is not working.

Also we tried by removing the FCM SNS API,and sent push notification with only GCM API, now only with GCM API, after receiving the push notification for GCM Subscribed Devices, I face the same issue.

Questions:

  1. Is the error occurs because the application and topic ARN has got many users?

  2. Do I need to do anything on the apache config side?

This is my Push notification Code:


$query = mysql_query("SELECT * FROM article where status=1 ORDER BY Id ASC");
$NumberOf = mysql_num_rows($query);
if($NumberOf > 0)
{
while($row = mysql_fetch_array($query)) 
{
    $Id=$row['Id'];
    $Newsid=$row['newsid'];
    $alertitle=$row['title'];
    $NImage=$row['image'];
    $NLink=$row['link'];
    $NewsType=$row['newstype'];

    $data = new stdClass();
    $data->newsid = $Newsid;
    $data->title = $alertitle;
    $data->description = $alertitle;
    $data->image = $NImage;
    $data->link = $NLink;
    $data->newstype = $NewsType;
    // Create a new Amazon SNS client

        /*********** Live GCM API Credentials *********/        

        $sns = SnsClient::factory(array(
        'version' => '2010-03-31',
         'key'    => 'xxxxxxxxxxxxxxxx',
        'secret' => 'XXXXXXXXXXXXXXXXXXXXXXXX',
        'region' => 'ap-xxxxxxx-1'
        )); 
       /*********** Live GCM API Credentials *********/ 

        /*********** Live FCM API Credentials *********/        

        $snsfcm3 = SnsClient::factory(array(
        'version' => '2010-03-31',
        'key'    => 'xxxxxxxxxxxxxxxx',
        'secret' => 'XXXXXXXXXXXXXXXXXXXXXXXX',
        'region' => 'ap-xxxxxxx-1'
        ));
        /***********Live FCM API Credentials *********/

    /***************** Android live TOPIC ARN  FCM Starts ****************/
    $android_TopicArn3 = "arn:aws:sns:ap-XXXXXX-1:XXXXXXXXXX:XXXXXXXX-FCM-Live";
    $snsfcm3->publish(array('Message' => json_encode($data),
            'TopicArn' => $android_TopicArn3));
    /***************** Android live TOPIC ARN  FCM Ends****************/






    /***************** Android Live TOPIC ARN GCM Starts ****************/
   $android_TopicArn = "arn:aws:sns:ap-XXXXXX-1:XXXXXXXXXXXX:GCM";
   $sns->publish(array('Message' => json_encode($data),
                    'TopicArn' => $android_TopicArn));

    /***************** Android Live GCM Ends ***************/



    $mdate = date("Y-m-d H:i:s");
    $update = mysql_query("UPDATE article set message='Success',mdate='".$mdate."',status=0 WHERE newsid=".$Newsid." AND Id=".$Id);
}

}

Kindly let me know what might be the root cause to fix this issue.

Thanks Immaculate.X