Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

DB function failed with error number 1226

Featured Replies

Hi all,

 

on one of my sites i'm getting this error quite frequently. The error it self means that the site sends more than 100000 requests to the database per hour (that's the limit on the hosting plan), which is quite a lot for a joomla site without SEF or statistic component.

 

Anyway, solution for this is to assign more users to the database with all privileges and to configure the joomla to use multiple users for it, but the problem is that the host allows only one user per database. So that's not an option for me..

 

One thing i've noticed is that when i get the error (even if it's after 20 minutes), all i have to do is to login to the back-end on the host, JUST change the password for the database to anything, then return it to the one configured in the joomla config file, and the site is up and running normally in seconds. The problem with this is that i can't stay 24/7 online and change the password of the database.. :S

 

Any idea how can i sort this out?

Does 28 database queries per second sound right to you given the number of requests you have to the site? If so, you have no choice but to contact your hosting company and ask them to change the max_questions limit, or look at hosting elsewhere. If not, it's a bug in Joomla and you might be able to get something done about it (a quick Google shows me it's a common problem), or think about tinkering with Joomla yourself to optimise it. Most sites I program have < 4 database queries per request; those queries are optimised to return as many joined results as possible to avoid querying overheads. There may be a similar way to merge Joomla queries (e.g. from different modules) together.

What kinda hit rate is your site recieving?

 

I've never used joomla, but i know from some cms that the inbuilt statistics can consume alot of database queries, can you disable that feature for a while and see if that reduces the db queries?

  • Author
What kinda hit rate is your site recieving?

 

I've never used joomla, but i know from some cms that the inbuilt statistics can consume alot of database queries, can you disable that feature for a while and see if that reduces the db queries?

 

Arround 5-600 uniques a day, and both the statistics and the sef urls are disabled so that's not the issue. I got the limit increased to 120000 but the site went off couple of minutes ago :S

 

is there any way i can find out which component is generating the queries using phpmyadmin?

 

btw i've enabled the debugging on the site and it showed 1142 queries executed on the main page :S, which i've managed to lower to 720 but again, it's too much :S

btw i've enabled the debugging on the site and it showed 1142 queries executed on the main page :S, which i've managed to lower to 720 but again, it's too much :S

Is that 1142 queries per request to the main page? If so, that's a HUGE number!! :huh: My own personal guideline is that a typical Web page should be designed to use no more than 6 well structured database queries, typically far fewer. You need to track down in the Joomla code exactly where all these queries are taking place before having any hope of reducing them. You might ultimately find it'll be better not to use that CMS for this website? Just a couple of thoughts; please correct me if I'm wrong :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.