具有高流量站点的 Facebook 身份验证:空访问令牌、空/me [英] Facebook Auth with high traffic sites: empty access tokens, empty /me

查看:20
本文介绍了具有高流量站点的 Facebook 身份验证:空访问令牌、空/me的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前有一个在 Facebook 标签页上运行的应用,该应用获得了大量流量.人们每隔几秒钟就注册一次,而且大多数都成功了.但是我遇到了以下问题:

- 根本没有收到访问令牌(空响应,没有错误)
- 或者如果收到,则对/me 的 API 调用失败(空响应,无错误)

显然限制 API 调用不是问题,因为 600/600 次调用/秒是每个用户的,这更有意义:).

有没有其他人遇到过这样的问题?我每分钟大约有 20-30 个成功的应用程序注册和大约 2-3 个失败的应用程序注册.注意:这些不是拒绝访问应用程序的用户 - 那些在其他地方处理......

我收到无法打开流:HTTP 请求失败!HTTP/1.0 400 错误请求"

We have an app running on a Facebook tab at the moment which is receiving a good deal of traffic. People are signing up every few seconds, and most are successful. However I am running into the following problems:

- access token not received at all (empty response, no error)
- or if it is received, then API call to /me fails (empty response, no error)

Apparently limiting of API calls is not the issue, since the 600/600 calls/sec is per user which makes a lot more sense :).

Is anyone else experiencing such issues? I am getting about 20-30 successful app signups a minute and about 2-3 failing ones. Note: these are not users who deny access to the app - those are handled elsewhere...

I am getting "failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request"

$token_url = "https://graph.facebook.com/oauth/access_token?client_id=".$oauth_clientid."&redirect_uri=".urlencode($redirect_url)."&client_secret=".$oauth_secret."&code=".$code;
$access_token = file_get_contents($token_url);

推荐答案

更新:修改我的代码使用 curl 后,有一些改进,但没有解决问题.有问题的应用程序现在已经超过了其使用高峰期,因此很明显错误数量已经大幅下降.它有时仍然会发生.错误是(最常见的):

Update: After modifying my code to use curl, there was some improvement, but it did not resolve the issue. The application in question is now past its peak usage, so obviously the number of errors have gone down drastically. It still happens sometimes. The errors are (most often):

  • 卷曲错误 (6):无法解析主机graph.facebook.com"
  • 卷曲错误 (28):SSL 连接超时

...以及其他类似错误.

...and other similar errors.

根据我对一两周数据的经验,它似乎在高流量时影响了大约 1% 的请求,在低流量时影响了更少 - 但这非常不科学.:)

From my experience with a week or two of data, it seems to effect about a percent of requests when there is high traffic, less when there is low - but this is quite unscientific. :)

--

那么解决方案呢?嗯,真的没有.似乎有一部分请求会失败,我(您的)应用程序需要尽可能优雅地处理这些错误.

So the solution? Well there is none really. It seems that some percent of requests will fail and my (your) application needs to handle these errors as elegantly as possible.

我唯一的问题是,有没有其他人对高流量应用程序有过这样的经验?(在这种情况下,意味着每天 100 000-500 000 次综合浏览量和 50 000-100 000 名活跃用户)

My only question is, has anyone else had such experience with high traffic apps? (meaning in this case 100 000-500 000 daily pageviews and 50 000-100 000 active users)

这篇关于具有高流量站点的 Facebook 身份验证:空访问令牌、空/me的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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