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 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?