Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding Heroku and ClearDB max_questions resource error

I'm getting this error consistently with my Rails site on Heroku using ClearDB mySQL.

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

Looking at the logs, the exceptions are returning for normal ActiveRecord finds. One of the exceptions is complaining about a scope in a model concern.

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

I'm on the Punch plan. The site isn't getting much traffic at all. Around 100 visits a day. Is there something I'm not configuring correctly within Rails or Heroku to avoid this error?

Update: Moved to next plan higher and still getting these exceptions.

like image 389
Saluto Avatar asked Nov 28 '17 14:11

Saluto


People also ask

Has exceeded the Max_questions resource ClearDB?

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.

What is ClearDB in heroku?

ClearDB is a powerful, high-speed database-as-a-service in the cloud for your MySQL powered applications.

How do I connect to heroku ClearDB?

In heroku website, go to My Apps and select the app on which you have installed ClearDB. On the top corner click on Addons and then select ClearDB MySQL Database. Once there, click on your database and choose the 'Endpoint Information' tab. There you see your username/password.

Can I use MySQL on heroku?

Heroku does not offer a native MySQL add-on but instead supplies it through a third party, ClearDB. If it has not been added to your application already, you can install it from the Heroku Add-Ons Page. Once installed, it will appear in your Add-Ons list in your Resources tab as ClearDB MySQL .


1 Answers

Actually, this seems to be a problem with number of queries per hour. You have max 36000 questions (queries) each hour and your application exceeded the limit. There is possibility, you have an unhandled loop or logic error in your query.

like image 89
Azhar Zafar Avatar answered Oct 13 '22 22:10

Azhar Zafar