Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Database: MySql
 Want a faster forum?
 New Topic  Topic Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

NiteOwl
Junior Member

Canada
403 Posts

Posted - 11 February 2008 :  14:24:56  Show Profile  Visit NiteOwl's Homepage
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=-
Go to Top of Page

texanman
Junior Member

United States
410 Posts

Posted - 11 February 2008 :  15:53:05  Show Profile
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.
Go to Top of Page

NiteOwl
Junior Member

Canada
403 Posts

Posted - 12 February 2008 :  02:15:56  Show Profile  Visit NiteOwl's Homepage
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
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 14 February 2008 :  13:17:10  Show Profile  Send pdrg a Yahoo! Message
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
Go to Top of Page

NiteOwl
Junior Member

Canada
403 Posts

Posted - 15 February 2008 :  13:20:43  Show Profile  Visit NiteOwl's Homepage
I don't have a real record of the increase in speed, but it is noticeable. My pages do refresh faster.

-=NiteOwl=-
Go to Top of Page

SiSL
Average Member

Turkey
671 Posts

Posted - 15 February 2008 :  21:10:43  Show Profile  Visit SiSL's Homepage
I applied that too, and really noticable, even on MS SQL 2005

CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 17 February 2008 :  05:05:19  Show Profile  Visit Webbo's Homepage
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
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20593 Posts

Posted - 17 February 2008 :  15:58:35  Show Profile  Visit HuwR's Homepage
I wouldn't call 0.12 seconds that significant an improvement either, considering you are now not getting the same result set either.
Go to Top of Page

Ocean
Starting Member

5 Posts

Posted - 22 February 2008 :  02:30:19  Show Profile
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!
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20593 Posts

Posted - 22 February 2008 :  03:14:18  Show Profile  Visit HuwR's Homepage
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.
Go to Top of Page

Ocean
Starting Member

5 Posts

Posted - 24 February 2008 :  19:09:33  Show Profile
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.
Go to Top of Page

NiteOwl
Junior Member

Canada
403 Posts

Posted - 06 April 2008 :  10:50:15  Show Profile  Visit NiteOwl's Homepage
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=-
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.1 seconds. Powered By: Snitz Forums 2000 Version 3.4.07