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

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Database calls in Active.asp
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 6

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 24 March 2002 :  20:54:55  Show Profile  Visit Gremlin's Homepage
Thanks, yes I've seen the list of features, and think I even mentioned on that thread how great it really looks.

I was coming more from the angle of not feaures included, but offering suggestions on how more of the internal coding and structures could be improved. Now don't take that as me saying that you guys probably arent right on track, its just we seem to have so many good people around here right now that bouncing ideas off them now and then might just realise some interesting and beneficial results.

www.daoc-halo.com
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 25 March 2002 :  04:16:23  Show Profile  Visit HuwR's Homepage
I am currently doing this, I was just trying to save you some work, as the code you are looking add is very different to the 3.4 code, so many of the suggetions made here are simply not possible now as the code has changed.

I am however using the idea of just pulling a list of froums into arrays for the moderation and subscription info, I should have some comparrison results to put up later so we can see what sort of improvemnet we can get on active.asp.

I have not concentrated on particular files until now, but have been removing a lot of reduntant stuff and combining others.


Somebody mentioned earlier about adding an index, In my investigation into the problems we were having with the help current/version here was fixed by adding a CLUSTERED INDEX to the FORUM_TOPICS.T_LAST_POST field, this has also improved the response of active.asp as it is also ordered by this field.

Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 25 March 2002 :  04:56:05  Show Profile  Visit Gremlin's Homepage
quote:
I am currently doing this, I was just trying to save you some work, as the code you are looking add is very different to the 3.4 code, so many of the suggetions made here are simply not possible now as the code has changed.
No problem I realised you intentions were good The mucking around I did yesterday on this was only a couple of hours of time I was killing anyway (got me out of washing the dog anyway !)

I'll have a look around I had a huge trace file from my foums that I'd put into sql's optimiser and it came up with a few new indexes which improved my forums considerably a while back also, If I can't find the trace and recreate the reccomendations then I can probably script out the current indexes I have and take a look at the differences.

www.daoc-halo.com
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 25 March 2002 :  05:37:11  Show Profile  Visit HuwR's Homepage
The only index I have had to add was the clustered index, but that was to fix a specific problem, I have run countless profilers and never had to add any indexes, it may be that you had one or two missing.


Test on Active.ASP
Ok, I hardcoded a date for the active since, so that it would give me a nice hefty result.

With the new standard active.asp, the page took 52secs to load
Changing to use GetRows (no other changes) took 37secs to load

am now changing the way it checks subs etc.

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 25 March 2002 :  05:47:04  Show Profile  Visit HuwR's Homepage
changing the check forum access to use an array, has very little if any impact on the performance of Snitz's active.asp, this may be different if you have a high percentage of private forums.

I tested this by a) leaving the currentcheck for every pass of the loop, then b) removed the check completely thus assuming I had access to everything (ie no call to chkfoumaccess) it only made 0.2secs difference in the 37 second query, so not worth tinkerring with.

Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 25 March 2002 :  05:54:43  Show Profile  Visit Gremlin's Homepage
No they were additional indexes reccomended rather than ones missing. I'm referring to a moded forum here rather than an out of the box too which may be the difference.

www.daoc-halo.com
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 25 March 2002 :  06:39:37  Show Profile  Visit HuwR's Homepage
Ok, sounds reasonable.

Now, please be seated, this may be a shock.
The times I posted above were tested against a copy of this database with me logged in as an admin.

logged in as a normal user, the same active.asp takes 11.3 secs to load, the woes of being an admin

Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 25 March 2002 :  06:44:56  Show Profile  Visit Gremlin's Homepage
Either that or you Devs are posting far too many topics in your hidden forums !!

I found focusing on the number of calls to the database was the easiest way to just keep tracking back each query and looking at ways to remove it or reduce it to a single call. I was totally blown away by the number of calls the DB was getting just to show a handfull of topics in active.asp, I absolutely DREAD to think what thats looking like on this forum were you've got what looks to be around another 10,000 or so posts than my forum not archived.


www.daoc-halo.com
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 25 March 2002 :  07:22:45  Show Profile  Visit HuwR's Homepage
Yes, that's what I am doing to, I now have it down to 1.5 secs for a normal user, just by doing this

' Does user have access to the forum??
if cLng(Forum_ID) <> cLng(currForum) then
testAllow = chkForumAccess(Forum_ID,MemberID,false)
end if
if testAllow then

instead of

' Does user have access to the forum??
if chkForumAccess(Forum_ID,MemberID,false) then

This reduced the number of queeries on my test from 1856 to 43

Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 25 March 2002 :  07:54:31  Show Profile  Visit Gremlin's Homepage
Wow ! Thats a pretty massive saving , I've just this minute finished changing the chkForumAccess routine so its like the ones I've got above and only calls the DB once per page.

I'll make your suggested change now too, which should save my new routine from being excessively called also.



www.daoc-halo.com
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 25 March 2002 :  08:04:47  Show Profile  Visit Gremlin's Homepage
Alright, that helped.

Almost 1300 topics being retrieved from active.asp in 0.8 seconds

www.daoc-halo.com
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 25 March 2002 :  08:12:57  Show Profile  Visit HuwR's Homepage
I am now working on reducing the load if ou are an admin, since that is pretty heavy currently, the same active.asp which takes the user 43 queeries takes the admin over 4000

Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 25 March 2002 :  08:27:03  Show Profile  Visit Gremlin's Homepage
Yes its nasty isn't it. I'm down to 8 DB calls on my forum regardless of Normal, Mod, or Admin status.

www.daoc-halo.com
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 25 March 2002 :  08:57:17  Show Profile  Visit HuwR's Homepage
Don't forget however, that on a very busy forum, the extra overhead of storing the info in strings may be more than the actual queeries, they all take up memory.

Go to Top of Page

Aaron S.
Average Member

USA
985 Posts

Posted - 25 March 2002 :  09:04:27  Show Profile  Visit Aaron S.'s Homepage
Gremlin:

When you have a chance, can you post the new additions since your last code posting.

I am mucking around also, but don't want to change something that has already been touched.



Go to Top of Page
Page: of 6 Previous Topic Topic Next Topic  
Previous Page | Next 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.18 seconds. Powered By: Snitz Forums 2000 Version 3.4.07