Forums / Cotonti / Support / Could not connect to the database

Ross
#1 2013-11-29 12:34

My site often gets this fatal error:

 

Could not connect to database !
Please check your settings in the file datas/config.php
MySQL error : SQLSTATE[42000] [1226] User 'XY' has exceeded the 'max_questions' resource (current value: 8000)

 

I upgraded to a huge, unlimited server - next option is a virtual server they said. The fatal error still shows up now and then,

Now, is it the server's fault or Siena's fault?

Trustmaster
#2 2013-11-29 18:23

max_questions - is max number of SQL queries allowed per hour. This is not necessary a physical server limit but rather a quota sever admins have set up. It's not very fair of them saying that you need to buy bigger server to handle more requests. No matter how fast the server is, the limit won't let it make more queires for your site.

Of course a good job of SQL queries optimization and cache can be performed if you find someone who can do it for you. But I would recommend changing a hosting company anyways.

May the Source be with you!
Ross
#3 2013-11-30 10:33

Thank you so much Trustmaster. That's what I suspected, They already got me an upgrade for more than 65 euros. I am going to change them anyway now.

Just let me understand - could they increase the SQL query quota for me so that my website isn't down every other day?

 

 

Trustmaster
#4 2013-11-30 15:44

Surely they could. They either ignore this fact for purpose, or they don't even know what that config option means.

May the Source be with you!
Ross
#5 2013-12-01 11:07

As for me, I want to be sure I am not doing a wrong use of Siena.

I am inserting the most of my pages as includes. I make an html page and then I add it as an include. Is that wrong for the database?

I chose to do that just because I was afraid to lose all the contents in case there was a database crash. Now I fear that is what causes too many queries to my database.

(Or is the number of visitors that increase the queries?)

Trustmaster
#6 2013-12-01 12:24

Storing data as HTML pages doesn't affect SQL queries count. The amount of visitors does. You can actually see how many queries your site makes per request if you enable SQL statistics and put appropriate tags in footer: {FOOTER_SQLSTATISTICS}.

May the Source be with you!
Ross
#7 2013-12-01 21:40

I did and the result is a low number of queries:

 

SQL total time: 0.013 secondi - SQL queries: 23 - Average SQL time: 0.00057 seconds