Closed (works as designed)
Project:
Statistics Pro
Version:
6.x-1.0-beta2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
29 May 2010 at 02:45 UTC
Updated:
11 Aug 2010 at 11:21 UTC
I know that core Stats module hurts performance a lot. Does this module help with that problem at all?
Comments
Comment #1
igorik commentedI doubt about it (I am not author of this module)
but on the project page is written that this is not replace for statistics module.
However, I agree for 100% that statistics module is killer of performance and there is some way how this module could help with it, it would be great.
Comment #2
Flying Drupalist commentedOh, actually I know that the Boost module has a javascript replacement for stats, perhaps that sort of thing could be implemented here.
Comment #3
rsevero commentedNo, the Statistics Pro module doesn't even try to deal with performance issues of the core Statistics module.
AFAIK the Statistics module includes an UPDATE and a INSERT per page hit. Is there more?
I understand that only this can have a performance hit but I would like to know what SQL server do you two use. In case you use MySQL, what is your DB engine?
By my really fast superficial research I can see that the Boost module tries to improve general performance issues in Drupal. I'm not sure it improves any Statistics related performance issues.
I see that it has a Javascript statistics module. I bet this is required because of Boost caching but does it reduces the Statistics related DB load on the server?
Comment #4
rsevero commentedI've scanned the Boost module code quickly. As far as I understand, there is no boost in the Statistics related performance with the Boost module. It's boosting merits stay on the caching side.
I'm interested in ideas on how to reduce the performance hit of the Statistics module as I don't see much room for improvement.
There was some talk about improving D7 performance with caching and statistics on at #692044: A site with statistics module enabled is much slower in serving cached pages in D7 than in D6. Couldn't find any talks about performance issues on D6. Do you have pointers?
Comment #5
Flying Drupalist commentedMy understanding is that the js portion moves the update/insert until after page load, thus making the page view not wait on the write operation.
This is the reason why the stats module is harmful to performance and client side analytics like google analytics are not.
Comment #6
rsevero commentedI think the reason a properly configured google analytics installation isn't harmful to performance is twofold:
And it's important to notice that usually Google Analytics is much slower than something like the Statistics module. It feels faster because it happens after the user already has the page presented to himself.
A solution like the one implemented by the Boost module only deals with the first modification so I can't see why there would be any difference on the server load on this aspect.
I doubt a user could feel the difference of an UPDATE and an INSERT by themselves before page being presented.
I think there can only be a noticeably (by the users) difference because of several users hitting the server close together and several UPDATEs and INSERTs eventually increasing significantly the server load. If this is really the case, it doesn't matter if the SQL server is hit before or after each page load.
About the Boost module let me just clarify that I think the Boost module probably has many merits. I only think it doesn't provide any boosting on the statistics gathering load. I believe it's js client side analytics implementation is a necessity of the real boosting done with caching, it is not a boosting technic itself.
Comment #7
rsevero commentedComment #8
Flying Drupalist commentedYes, you're right of course. Perhaps the stats could be stored not in the db but in some sort of nonmysql cache and inserted into the db on cron?
Comment #9
rsevero commentedYes, I bet this could work but you would have to use some sort of nonmysql cache that is faster than MySQL itself.
And to really reduce load you would also need to implement the cron job in a lighter DB-wise way. Otherwise you would end only moving load from one moment to another.
I bet the first part could be done just appending to a local file (you would have to deal with concurrency but it's doable).
The second part could be done disabling the indexes during the file to DB transfer. I know this can have a huge impact during INSERTs and UPDATEs in MySQL. I don't know about other DB solutions.
What I'm not sure it the real impact all these changes would have in the end. I bet the only way to know it is implementing and benchmarking.
Patchs?
Comment #10
Flying Drupalist commentedMaybe this?
http://drupal.org/project/mongodb
I think most of the speed gain will be from being able to increment +100, 1000, etc, every hour rather than +1 every view. However, if you dump mysql entirely and just read from, say mongodb then you can skipt that part too.
Comment #11
rsevero commentedMaybe MongoDB could represent an improvement in this area.
Someone would have to implement mongodb_statistics to see.
To increment +100, +1000 etc every hour, you would have to count first. Again, you would have to count first and then UPDATE. All this would have to be faster than just updating.
And be aware that with this method you would be improving the UPDATE part only but the Statistics module uses an UPDATE and an INSERT per page hit most of the times. There are times that it uses an UPDATE that fails and then it uses two INSERTs.
Comment #12
rsevero commentedPlease reopen if a patch is available.