Statistics module becoming a bottleneck

Created on 10 September 2019, almost 5 years ago
Updated 30 March 2024, 5 months ago

Hello guys

Whenever my clients news site starts getting too much traffic, (400-500 visitors simultanously), it gives the following error:

MESSAGE PDOException: SQLSTATE[08004] [1040] Too many connections in drupal_is_denied() (line 2206 of /var/www/htdocs/includes/bootstrap.inc).
SEVERITY error

I have googled this a lot and havent been able to find a proper solution - besides turning off statistics and the site's performance is back to normal, only to start getting the problems back when i enable it.

Any help would be deeply appriciated.

🐛 Bug report
Status

Active

Version

7.0 ⚰️

Component
Statistics 

Last updated 21 days ago

No maintainer
Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇫🇷France vanessakovalsky

    Hello,

    after checking it's link to way statistics module work, for each view a new process with a new connection is created (not linked to index.php) so it's something you should know when use statistics module and only solution is to increase your max connection in your database configuration.

  • Status changed to Active 5 months ago
  • 🇫🇷France vanessakovalsky

    If you want to make something, you can create a patch to modify file statistics.js and add a delay from some seconds to make ajax call. This can be a solution to delay your query, but there still be more queries on your database, so still need to configure your database.

Production build 0.71.5 2024