Author |
Topic  |
NiteOwl
Junior Member
 
Canada
403 Posts |
Posted - 11 February 2008 : 14:24:56
|
I am interested in experimenting with this; I did notice that my forum.asp has this line:
defDate = DateToStr(dateadd("d",-(nDays),strForumTimeAdjust))
as opposed to the original line outlined above, was there a typo? |
-=NiteOwl=-
|
 |
|
texanman
Junior Member
 
United States
410 Posts |
Posted - 11 February 2008 : 15:53:05
|
NiteOwl, You are right! Mine also has what you have above. I think it was just a mistyping and it also has one extra closed bracket. |
 |
|
NiteOwl
Junior Member
 
Canada
403 Posts |
Posted - 12 February 2008 : 02:15:56
|
thanks! And btw I do believe more steam is puring from the boilers. . . excellent.
|
-=NiteOwl=-
|
Edited by - NiteOwl on 12 February 2008 02:16:29 |
 |
|
pdrg
Support Moderator
    
United Kingdom
2897 Posts |
Posted - 14 February 2008 : 13:17:10
|
Hi Ocean,
Looks like it's worked out well for you, and that's very cool - thanks again for the info. Do you have any stats for the performance gain you're reporting? It would be interesting if you (or anyone who tries this and is happy with the patch) have some, and help others consider it before applying it!
pdrg |
 |
|
NiteOwl
Junior Member
 
Canada
403 Posts |
Posted - 15 February 2008 : 13:20:43
|
I don't have a real record of the increase in speed, but it is noticeable. My pages do refresh faster.
|
-=NiteOwl=-
|
 |
|
SiSL
Average Member
  
Turkey
671 Posts |
|
Webbo
Average Member
  
United Kingdom
982 Posts |
Posted - 17 February 2008 : 05:05:19
|
I've had a little play with it as well and do notice a slight difference in speed using a MySql db
I've listed three defDate lines that I tried, the first being the original one in my forum.asp, and between the three on average the page is now loading in 0.12 seconds less time using this change with no noticeable differences
' defDate = DateToStr(dateadd("d",-(nDays),strForumTimeAdjust))
' defDate = DateToStr(dateadd("d",-(nDays),strForumTimeAdjust)),8)
defDate = Left(DateToStr(dateadd("d",-(nDays),strForumTimeAdjust)),8) & "0000"
We have over 10million hits a month and at the time of making the above change there were 111 active users on the forums
|
Edited by - Webbo on 17 February 2008 05:05:45 |
 |
|
HuwR
Forum Admin
    
United Kingdom
20593 Posts |
Posted - 17 February 2008 : 15:58:35
|
I wouldn't call 0.12 seconds that significant an improvement either, considering you are now not getting the same result set either. |
 |
|
Ocean
Starting Member
5 Posts |
Posted - 22 February 2008 : 02:30:19
|
We run a dedicated server, and the results of the change were this:
- Between 10am & 12am our server response time was blowing out from 200ms to 400ms because of disk thrashing. Now it doesn't.  - Our Index cache was 5mb, now it's 10mb - Our Index cache hits was around 50%, now its 90% 
For those who are fretting that their visitors might miss a few posts when setting the date selector to "yesterday", use this:
if nDays <= 3 then defDate = DateToStr(dateadd("d",-(nDays),strForumTimeAdjust)) else defDate = Left(DateToStr(dateadd("d",-(nDays),strForumTimeAdjust)),8) & "0000" end if
Any history length over 3 days will go to the "Day", anything less than 3 days will got to "the minute".
Want more speed? 
If you want even more improvement, then adjusting the underlying database design might also speed things up.
To explain: The TOPICS table contains has dynamically changing data (e.g T_VIEW_COUNT) mixed in with static data. What this means is that every time a user views a topic, the forums executes an UPDATE TOPICS SET T_VIEW_COUNT=T_VIEW_COUNT+1. It would be good if the DB were smart enough to drop individual records from it's cache, but it's not, so it drops the whole table from memory .. thus, next time TOPICS is required, it reads the whole table from the physical disk drive.
Each topic view = topics table dropped from cache.
Moving the dynamic fields to another table would mean that the TOPICS table could remain in memory until a new post was added. So much more efficient.
...at least this is my understanding from reading the MySQL/MSSQL design docs!  |
 |
|
HuwR
Forum Admin
    
United Kingdom
20593 Posts |
Posted - 22 February 2008 : 03:14:18
|
quote: If you want even more improvement, then adjusting the underlying database design might also speed things up.
well, yes of course it will, but the whole point of the Snitz database is that it is generic rather than specific to a platform, that is possibly one of it's strongest points. Of course it could be improved now, but there are 100's of thousands of legacy forums out there that such a change would be impracticle.
If you are really concerned about performance, then perhaps you should look at MSSQL rather than MySQL.
and to get things in perspective, while 200ms to 400ms is a 50% drop, 200ms is so small you wouldn't even notice it. |
 |
|
Ocean
Starting Member
5 Posts |
Posted - 24 February 2008 : 19:09:33
|
quote: Originally posted by HuwR and to get things in perspective, while 200ms to 400ms is a 50% drop, 200ms is so small you wouldn't even notice it.
Maybe you meant to say "I (HuwR) wouldn't even notice it" - and that's ok.
To me, an additional 200ms is totally unacceptable, and was noticeable. Our speed expectations are different to yours, and that's ok too.
quote: Originally posted by HuwR If you are really concerned about performance, then perhaps you should look at MSSQL rather than MySQL.
If I was really concerned about performance, I wouldn't be using Snitz Forums for .asp!!
Snitz & MySQL sit in the same boat - open source, free products. If I posted speed tips in the MySQL forum, I'm guessing there would be guys in there that would suggest "if I wanted real performance" I would move from Windows to Linux, or from .asp to .php - perfectly understandable. Not practicle for us, but understandable. |
 |
|
NiteOwl
Junior Member
 
Canada
403 Posts |
Posted - 06 April 2008 : 10:50:15
|
quote: Originally posted by Ocean
if nDays <= 3 then defDate = DateToStr(dateadd("d",-(nDays),strForumTimeAdjust)) else defDate = Left(DateToStr(dateadd("d",-(nDays),strForumTimeAdjust)),8) & "0000" end if
Thanks Ocean, I am using that revised code, seem to work well! SNiTZ is a lot of fun to work with!
|
-=NiteOwl=-
|
 |
|
Topic  |
|