L
L
lukoie2020-04-06 23:50:08
Drupal
lukoie, 2020-04-06 23:50:08

Article counter on the Drupal site is crashing the site?

Of course, do not be offended, but I have a question about Drupal
on the eighth.
Customers are "a little offended" at TTFB
, there is such a nodeviewcount module, and so, it heavily loads the server on the digital ocean. Well, it’s kind of strong in general, so with 250 people on the site, it just lays down, and each page opens for two minutes. Well, even without that, now when there are two and a half people - 5s TTFB; (
With caching and all that - everything is in order there. Experienced found out that the problem is in nodeviewcount.
I just unchecked "Blogs" in the settings, and it simply reset the counter for blog articles.

spoiler
5e8b954960fe3843400966.png

BUT at the same time, the pages began to open noticeably faster.
Having looked at the structure in the database, I got a little crazy, of course, for each view it creates a record in the database, and not just increases the number in the counter, such as "ideamaterial-> n + 1"
Total, 1.5 million records.
I made a copy of the table, deleted everything in the copy, and temporarily swapped the working and empty tables - the site began to fly like crazy.

Hence the question: is it possible to somehow get rid of this module, while is there a ready-made simple alternative so that the number of views still shows?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
andead, 2020-04-07
@andead

Without a separate entry, you will not be able to count the number of views for a certain slice of time. If this function is not needed, then use the built-in statistics module, which works as you wrote. Or change the module to something like https://www.drupal.org/project/google_analytics_counter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question