【问题标题】:Understanding Heroku and ClearDB max_questions resource error了解 Heroku 和 ClearDB max_questions 资源错误
【发布时间】:2018-05-12 01:33:07
【问题描述】:

我在使用 ClearDB mySQL 的 Heroku 上的 Rails 站点中始终遇到此错误。

Mysql2::Error: User '123123' has exceeded the 'max_questions' resource 
(current value: 18000)

查看日志,对于正常的 ActiveRecord 查找返回异常。其中一个例外是抱怨模型关注点中的范围。

ActiveRecord::StatementInvalid: Mysql2::Error: User '123123' 
has exceeded the 'max_questions' resource (current value: 36000): SET  
@@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), 
',NO_AUTO_VALUE_ON_ZERO'),  @@SESSION.sql_auto_is_null = 0, 
@@SESSION.wait_timeout = 2147483

我在Punch plan 上。该网站根本没有获得太多流量。每天约100次访问。为了避免这个错误,我在 Rails 或 Heroku 中是否有一些配置不正确?

更新:移至更高的下一个计划,但仍然出现这些异常。

【问题讨论】:

  • 更新 2:我最终将 ClearDB 迁移到 Heroku 的 Postgres,从而解决了问题。该站点不再收到 max_questions 资源错误异常。当我弄清楚为什么我会分享。我使用gist.github.com/tristanm/a2afa29ac6f37bf92b46 作为参考。

标签: mysql ruby-on-rails heroku cleardb


【解决方案1】:

正确答案来自上面的@Azhar-zafar。

根据ClearDb的FAQ:

https://w2.cleardb.net/faqs/

我收到一条错误消息,提示我已超出数据库的“max_user_connections”资源。为什么?

Each multi-tenant plan supports a maximum number of database connections that are allowed. This is to ensure the highest quality of service for all of the customers and databases that are on each multi-tenant cluster. If you receive this message, it means that you have reached your connection limit for the plan for which you are currently subscribed. We recommend that you upgrade your database to a larger plan to lift this restriction off of your database.

【讨论】:

    【解决方案2】:

    实际上,这似乎是每小时查询次数的问题。您每小时最多有 36000 个问题(查询)并且您的应用程序超出了限制。有可能,您的查询中有未处理的循环或逻辑错误。

    【讨论】:

      猜你喜欢
      • 2016-07-05
      • 1970-01-01
      • 2021-12-25
      • 1970-01-01
      • 2018-10-19
      • 2015-10-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多