High Server CPU after sending GCM

我的梦境 提交于 2019-12-12 03:35:54

问题


I have a little problem with my server and Google Cloud Messaging.

I've recently launched an application that sends push notifications each time we publish new posts (1 each 30 minutes). It use /topics/global, so I don't keep in the client registration in memory.

The problem is that when server sends notifications (trough CURL, PHP or Shell) the server CPU goes high and other operations slow down.

This has happened for some days, maybe because we have more than 4,000 smart phones with the application installed.

I've tried to simulate requests from ssh with curl. The response returns in 1 second, however CPU load is still high.

Sorry for my english. Thanks in advance for your support!


回答1:


If you're sending a message to all users (more than 1000 users), you should be placing these users into groups and just sending a message to the group.

First, create a group, and whenever a new user registers then, add them to the group. You can easily just send a group message.



来源:https://stackoverflow.com/questions/35094547/high-server-cpu-after-sending-gcm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!