Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Hosting on Remote SQLServer?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Hosting on Remote SQLServer?

 Post Reply Post Reply Page  12>
Author
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Topic: Hosting on Remote SQLServer?
    Posted: 14 May 2003 at 12:24pm
Just recently I finished made the mods to WWF to fit the needs of my web site. The database for said web site is hosted outside the local network of the web site. The web site is heavily dependent of on the database and some pages are graphics heavy with the average page loading in 1 - 7 seconds.

On my development server on the local network with the database server page loads for the forum is always less than 1 second. On the production server it's over 15 seconds and as high as 25 seconds.

No major changes were made to the underlying code of the forum. Could anyone explain this?

Dev Server local to Database
http://69.26.135.138/msg
Production Server
http://www.longbox.com/msg/

I have run a few test and it appears to be the multiple calls to the database that is slowing down the forum. Has anyone else run into this problem our does every else use a SQL server local to their web server?


Edited by ljamal
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 14 May 2003 at 1:10pm
It appears that the multiple connections to the remote database is the problem. I've rewritten the default page to use one stored procedure call to access the Cats and Forums from one view and it has cut out 3 calls to the database and reduced the time from 19+ seconds down to just under 4 seconds.

As this will probably be the only message board I use for a while it looks as though I will have to modify it even more to fit my needs.

It still a great product, but I have highly customized needs and it looks like that optimizing the code for my SQL setup will supercede reducing the forum cookies for the time being.

Edited by ljamal
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 14 May 2003 at 10:26pm
I'm finished with most of the default page.
I reduced Categories, forums, moderators, and last post to one SQL connection which has reduced the default page from 19+ seconds to 2-3 seconds.

The only additional SQL calls are made off the page in the include file so I won't be touching those until complete as they will affect other pages that I really don't want to clean-up now.

See the difference between the page before optimization
http://www.longbox.com/msg/default-pre.asp
and the page with the optimizations
http://www.longbox.com/msg/
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 2003 at 7:42am
Whats the new stored procedure you have created to cut down the calls to the SQL server?
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 2003 at 8:10am
What I did was take advantage of SQL Server ability to return multiple record sets from single query.

The first returns a view which joins the category names and IDs with the forum information. This reduce the multiple calls oer category needed to return the forum information. I stored the recordset into an array and I use a for statement to loop through the array. It stores the previous CATID for comparison as it loops and it not eaqual it displays the category name and update the CATID storage variable. If equal it just returns the forum names.

For moderators, I return all the moderator group information complete with forum_ID and loop through to create a string of variables. Each database row is separated by "|" and each column by "::". This string is then parsed to into an array (using Split). If the array element is associated with a forum then, the forum moderator information is stored. The moderator user information is stored and returned in the same way.

For the last post, I created a view with returns the last post for each forum and store it into an array much like I did with the moderators. I then iterate through the array until the forum ID is equal and use that information as the last post.

As is evident by visiting the URLs I posted above this system of store and iterate is much faster in my situation than making multiple SQL calls to the remote server. Even on the development server local to the SQL Server it's much faster, because the machine can parse through strings much faster than it can make and return calls to the database. If you would like to see the code, I can forward it to you.
Back to Top
Bunce View Drop Down
Senior Member
Senior Member
Avatar

Joined: 10 April 2002
Location: Australia
Status: Offline
Points: 846
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bunce Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 2003 at 3:47pm

Getstring(), Getrows(), Stored Procs, Multiple RS'.

You've made my day!!

There have been many, many posts made throughout the world...
This was one of them.
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 2003 at 3:51pm

I removed most of the Access code to as it was just taking up space. The default barely resembles the original code.

Edited by ljamal
Back to Top
boyohboy View Drop Down
Groupie
Groupie


Joined: 15 October 2002
Location: United States
Status: Offline
Points: 197
Post Options Post Options   Thanks (0) Thanks(0)   Quote boyohboy Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 2003 at 6:47pm

http://www.longbox.com/msg/forum_topics.asp?FID=21

this page took 10 sec to load. what's up with your prod. server?

the dev server isn't that bad.

Visit my community website @
EverythingVIET.com
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.