Hi guys,
The beginning was at this node http://groups.drupal.org/node/3504#comment-10382, however, I think that the results should be on a seperate node.
I've decided today to make some performance test for this topic, so what I've done is I installed new installation of drupal 5.1 and activated all the modules. I've installed the DEVEL module and created 10000 users, 500 taxonomy terms over 30 vocabularies. After that, I created 1 node with 10000 comments, and only then I've added 1000 nodes and more 10,000 comments. The testing environment was my laptop, IBM Thinkpad T23 - P III 800MHZ 384MB RAM. The poor laptop died exactly after the lab finished, I hope to fix it later.
Here are the results:
So, what do you think about the results?
P.S. I think it would be fair to say, that when the DEVEL module generates comments it puts only one line at the body, while it puts a lot of lines in the node's body.
UPDATE: 08-Apr-07 22:00 GMT +2
Hi again,
I've just finished another experiment, and it took me the whole day to make it.
At this time I took my sister's machine (AMD Athlon 64bit 2800+, 1.8 GHZ, 512 MB DDR). I've installed there AMP, and copied the Drupal of the previous experiment, including the data. The last thing that I've done before I started, was to generate a body like all the nodes, so the bodies of the comments and the nodes were equal. I ran the tests in the same way (from another computer on the NAT), and here are the results:

As you can see I've added more information and calculations.
So, let's make some more calculations.
I have in my forum about 2000 daily unique visitors, each visitor enters about 16 pages. Let's suppose that 8 pages are index pages (Only nodes, let's say term pages), and 8 pages are forum threads. Each thread have about 25 replies, and the default value of the amount of the replies displayed under each thread is 30. So let's suppose that on each thread page we display one node (the thread) and 25 comments. Last thing, on index pages I display 30 nodes (threads).
Simple comments execution time calculation
Now let's make some calculations. 8 (index visits per user) * 30 (num of nodes) * 36.35 (node execution time [ms]) = 8724, that's our exectution time per visit in index pages per user.
[8 (thread page per user) * 1 (only one node on each page) * 36.35 (node exec time)] + [8 (thread pages per user) * 25 (num of replies on each page) * 20.44] = 4378.8, this is the execution time for the thread pages.
Total execution time per user for each day: 4378.8 + 8724 = 13102.8 ms = 13.1 Seconds.
For 2000 visitors it would be 26205.6 Seconds, which means 436 Minutes and 45 seconds.
Comments as nodes execution time calculation
Index pages execution = the same = 8724ms
Thread pages = 8 (thread pages) * 26 (the thread + 25 replies) * 36.35 = 7560.8 ms
Total per user = 8724 + 7560.8 = 16284.8ms = 16.3 Seconds
Daily total = 16.3 * 2000 = 32569.6 Seconds = 542 minutes and 50 seconds.
Conclusion
Well, after all this I think it won't be much bad idea on implementing comments as nodes for midlevel forums, however, from the other hand, if you'll think about it, what is bad with the comments module as it is (from the perspective of content type)? What do you need more? Please write your opinions here about the results.
| Attachment | Size |
|---|---|
| commentsasnodes.JPG | 35.67 KB |
| commentsasnodes2.jpg | 77.26 KB |

Comments
Comments as Nodes lab results - pretty good...
Well done tounano! At last we've cleared up just how much the Node/Comment "performance hit" actually is. It was going to be my next question.
To be honest, if Nodes as Comments provide far more flexibility than current Forum Comments, then having a page execute wait of 2 to 3 times is really acceptable to me. And as you say these results are slanted towards Comments - so, if all things were equal, then the results should be even better in favour of Nodes.
I'm sure that we'd see some optimisation once there was widespread usage of Nodes as Comments in Forums...
Cheers Daniel
10x
10x
I would like to make another lab on other computer, and I would like that the bodies of the comments will be the same as the nodes. Plus I would like to run a test of 10,000 comments as nodes.
I hope to update soon..
Try 100 000
You can try 100 000 nodes at the same time. Then we are talking about a bulletin board with hair on it's chest :P
Please express your opinion
Please express your opinion on the new results.
2-3 times the number of DB
2-3 times the number of DB queries is a lot !
What more flexibility does it provide against the use of flatcomment for example ?
How does it behave performing a search ?
Well, I didn't have time to
Well, I didn't have time to test it, but it would be cool if someone else test it.
And I think that by using flat comments it won't harm the performance, the same about search.
Have a nice day.
Doubling the number of
Doubling the number of queries per post seems kind of extreme seeing as there wouldn't seem to be too many fundamental problems with the comments based design. I think that most of the problems with the comments module could be fixed given time and a receptive maintainer.
Surely using nodes means
Surely using nodes means that there will be many more function available to users. Plus why reduce the need to maintain and comment module?
With respect to your question
Why would we want to have comments as nodes? For me, there are two main applications:
1. Our site uses several types of comments, which receive different themes. With CCK, there are ways to achieve that - with comments, it requires hacking.
2. We want to have a versatile rating system. So far, we have been using a Scoop-like Karma system, but it is not available for Drupal 5, and it has a number of flaws anyway. Setting up a solution with node rating and views seems more versatile and promising.
Our threads regularly exceed 300 comments, though. Thus, the performace hit really is an issue. We are willing to bite the bullet, nonetheless.
Excellent!
"We are willing to bite the bullet, nonetheless."
Excellent!
Very nice...
We also have a "node forum" module, which re-implements Core's forum module with nodecomment. We'll try and get that checked in ASAP (as a sub-module of nodecomment).
Paraphrased from Eaton:
FWIW, we built node comment because our client wanted a system so that comments and nodes could be treated interchangably for just about everything: adminstration, moderation, voting, "recent posts", featured content in various areas, etc. We approached the performance issue as something to optimize on a per-site basis as we found hot-spots, and so far it's been working well on high-traffic sites like goodcharlotte.com and daughtryofficial.com.
However, the use case for most of the forums on that site are a large number of posts with a small number of replies per post. It's chatty, not filled with deep, long, philosophical discussions. ;) And in that use case, it's worked pretty well and we really haven't seen any negative effects, outside of the ordinary tweaking that Drupal needs on a high-load, high-traffic site. And actually, the photo galleries on those sites are a lot more of a performance hit than the forums.
Well, that's nice. However,
Well, that's nice.
However, I think that the best way to go for DruBB will be to use comments as nodes only as option and not core. But, as I already wrote on other post, that I think that the drupal_render function need to be recoded, just for the forums, and not for the rest of nodes.
BTW, does anybody know if it's possible to override a function, or change it's name?
Another BTW :), webchick, what is the type of hosting that you use the above sites? Is it shared, VPS or Dedicated server? The sites works fast.
Have a nice day.