缩放GCM推送。你多久可以执行GCM推送? [英] Scaling GCM Push. How often can you perform GCM Push?

查看:239
本文介绍了缩放GCM推送。你多久可以执行GCM推送?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每个人都告诉我,如果服务器是你的,你应该GCM落实推动,而不是新的数据轮询服务器是愚蠢的。好吧,我同意并已经这样做了,但是,我想知道,多久可以或应该执行推?

Everybody tells me that polling server for new data is stupid if the server is yours and you should implement push with GCM instead. Well, I agree and have done so but, I was wondering, how often can or should you perform push?

我有一个简单的应用程序,人们上传的东西到服务器,并有其他人的帖子的饲料。这确实保存到数据库服务器上的方法,也触发末尾的GCM推送,因此谷歌发出的推送通知大家,然后大家再次查询新职位的服务器,包括我们促成刚刚发的帖子。

I have a simple app where people post stuff to the server and have a feed of everyone else's posts. The method on the server that does the saving to the database also triggers the GCM Push at the end, so Google sends out the push notifications to everybody and everybody then requeries the server for new posts, containing the post weve just made.

但是,如果我有什么,可以说畅想用户,并创建一个新的职位可以说每一分钟。的这将意味着应用程序会连接到服务器每分钟将杀死电池。所以我的问题是,你如何频繁地执行推送?难道不在这种情况下投票,每10分钟为电池其实更好,对吧?

But, what if I have, lets say milion users and a new post is created lets say every minute. This will mean that app will connect to server every minutes and will kill the battery. So my question is, how often you perform Push? Wouldnt in this case polling every 10 minutes be actually better for battery, right?

我知道这个例子是那种疯狂,让你的饲料长枪的人,但它只是提出一个观点,因为我无法想象这将如何扩展。我估计谷歌会处理一次没问题发送亿GCM消息。

I know this example is kind of crazy, having milion people in your feed, but its just to make a point, because I cant imagine how this would scale. I figure Google will handle sending million gcm messages at once no problem.

所以现在的问题是,是否有一个极限后推是contraproductive 我想它的种类第一世界的问题:?ð但无法想象的Facebook处理这样的东西。

So the question is, is there a limit after which Push is contraproductive? I guess its kind of a first world problem :D but cant imagine Facebook handles stuff like this.

谢谢!

推荐答案

推送通知的欢迎,当服务器具有重要的新的数据展现给用户(以及重要的我的意思是用户很重要)。

Push notifications are welcome when the server has important new data to show to the user (and by important I mean important to the user).

我相信,如果任何应用程序给我发了一个通知每一分钟我就从该应用程序或者禁用通知或卸载该应用程序。决定哪些更新发送给用户的推送通知,为了不对抗他们的时候,你应该非常小心。如果您的服务器可以发送推送通知经常到同一个设备,你必须设置在您的应用程序选择,可以减少这些通知的频率。

I believe that if any app sent me a notification every minute I would either disable notifications from that app or uninstall that app. You should be very carefull when deciding what updates to send to your users as push notifications, in order not to antagonize them. If your server can send push notifications very often to the same device, you must have settings options in your app that can reduce the frequency of those notifications.

推送通知通常是有关当应用程序没有运行(或在后台运行)。当它在前台运行,轮询服务器可能是一个更好的解决方案(因为交付每一次,你不能依靠推送通知的免责条款)。

Push notifications are usually relevant when the app is not running (or is running in the background). When it is running in the foreground, polling the server is probably a better solution (given the disclaimer that you can't rely on the push notifications being delivered every time).

在你的榜样,我不知道我要来约在DB的每个新的职位自动通知。即使在我使用的应用程序(即,它是在前台)我不希望它有新帖的自动更新。即使Facebook的不会自动更新视图(他们告诉你的,你有新帖屏幕的上方,你要拉列表视图下,以加载它们。当应用程序没有运行,我会想大概只有重要职位(例如,来自特定用户的帖子)。得到通知当一个应用程序给我发了太多的推送通知,我去它的设置,以减少它们。

In your example, I'm not sure I'd want to be notified automatically about each new post in the DB. Even while I'm using the app (i.e. it's in the foreground) I wouldn't want it to update with new posts automatically. Even facebook don't update the view automatically (they show you on top of the screen that you have new posts, and you have to pull the list view down in order to load them. And when the app is not running, I'd want to be alerted only about important posts (for example, posts from specific users). When an app sends me too many push notifications, I go to its settings to reduce them.

我不能给你推送通知的合理频率的数字数字,但我希望我的回答可以帮助。总之,你不必担心GCM的技术限制。你应该担心用户体验。

I can't give you a numeric figure of a reasonable frequency of push notifications, but I hope my answer helps. In short, you don't have to worry about GCM's technical limits. You should worry about the user experience.

这篇关于缩放GCM推送。你多久可以执行GCM推送?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆