dongsaolian8786 2019-08-09 06:27
浏览 93

使用laravel管理面板批量发送通知时,Codeigniter API不响应

I have two services on my cpanel, godaddy. One is API which has been developed in Codeigniter another is Admin Panel which is developed in Laravel. Both share same mysql database.
API is used to provide information for android and iOS devices.

Whenever I send notification from laravel, API doesn't respond.

When I send notifications to user, the number is around 10k+, ntofication is also saved for every user in notification table.
I thought maybe that's why it doesn't respond and unable to handle both requests: from api to return query responses and saving notification in database.

It's not the case because I commented out the code that saves the notifications in database yet api calls are not being responded.
I also tried queuing the notifications saving in the database using laravel queues and redis too, but It didn't help.

Now I am confused and I can't figure out where the actual problem is.

Is there problem with the server; processing so many requests at the same time?

Can using queuing for sending notifications will help the issue? (Not the queuing saving in database process.)
Below is the server configuration :

4 CPU Cores
8GB Ram
200GB Disk Space
CetOS
Apache v2.4.39
PHP v7.0.33
MySQL v5.6.44

Please someone help, I will highly appreciate any help or suggestion.

  • 写回答

1条回答 默认 最新

  • dsdioa9545 2019-08-09 06:45
    关注

    Why don't use a beanstalk application that receives the 10k tasks and send the notification 1 by 1 with a worker to the api ?

    Either the api is not able to handle all those requests at the same time, or you are not handling good the request to receive them and process it.

    Can you give us an example of the request? Does the try/catch give you any reference?

    If you give more information I will be pleased to help.

    评论

报告相同问题?

悬赏问题

  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题