Solved

ASP with SQL queries keeps crashing

Posted on 2011-09-14
10
266 Views
Last Modified: 2012-05-12
Hi all, I have an ASP site with a lot of different pages that make calls to a SQL 2005 Enterprise database. The database has approx 21,000 records. There are about 50 users who work on the site all day long (its an internal site). It seems that lately the site is crashing 10x a day, to fix it I need to do an IISRESET (yes, I tried rebooting), then everyone logs in & uses it normally for a while then it crashes again. I believe that my selects are all closed properly & now I have no idea what to look for. There are too many users to figure out what specifically is causing the crash. Can anyone help me figure out what I should be looking at?
PS - The server is Dual Xeon 3ghz HT with 16GB of Ram running Windows 2003 Enterprise Server, fully patched.

Thanks in advance.
Jon
0
Comment
Question by:Jon DeVito
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 56

Expert Comment

by:HainKurt
ID: 36539018
probably you have a loop somewhere which never ends... ask users what was the last page they visited and what they did/clicked and they got no response... maybe you can find the crashing page... or create a table

sitelog(id, pagename, userid, starttime, endtime)

and insert a record on page load, and update it on page unload (using the same id which you get on first insert)
this way, you will have a nice visit log later and also can find the problematic pages (probably crashing page which endtime is null)
0
 
LVL 56

Accepted Solution

by:
HainKurt earned 250 total points
ID: 36539036
better

pages(pageid, pagename, description, url, minservetime, maxservetime, avgservetime,.....)
sitelog(id, pageid, userid, starttime, endtime)

insert page definitions into pages table, and on each page insert into sitelog using the id of that page...
0
 
LVL 3

Author Comment

by:Jon DeVito
ID: 36539082
Thanks for the response. If I do it that way, when the crash happens all 50 users will be on a page that never posted back on unload so I still wont be able to see which page crashed it.
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 3

Author Comment

by:Jon DeVito
ID: 36539123
I am almost positive it is because of the amount of records being retrieved from the database. I installed a new test server where I am having problems when I query the database for thousands of records.
0
 
LVL 56

Expert Comment

by:HainKurt
ID: 36539457
"If I do it that way, when the crash happens all 50 users will be on a page that never posted back on unload so I still wont be able to see which page crashed it."

I guess I could not explain :) when a user request a page, on page_init you insert a record into table, and get id,
then on page_unload, you update that record... at the end, if server crashes you will end up one record (hopefully) which is not updated, which crashes the server...

page_init : insert log, get id of inserted log
all other events: your page logic here...
page_unload : update log

this cycle happens all the time whenever a page is served... wort to try if it is not too much work for you...
0
 
LVL 3

Author Comment

by:Jon DeVito
ID: 36540509
Aaaaaah, now I understand. I thought you meant when they navigated away from the page. Thanks for explaining, I'm going to give that a shot. I'm almost positive its because the database is sending way too many records to the browser but this will be a good way to tell. I'll let you know what happens. Thanks again!

Jon
0
 
LVL 9

Assisted Solution

by:djpazza
djpazza earned 250 total points
ID: 36542835
How about checking the webserver logs for the last few users / pages that were accessed before you did a iisreset / restart.

This might narrow down the problem page.  With regards to the amount of data being display is it not being filtered ? You don't display 21000 records on a single page do you?
0
 
LVL 3

Author Comment

by:Jon DeVito
ID: 36546862
Thanks, I checked the logs & found that I was getting a lot of errors which Microsoft had a patch for. Not sure how much help it will be yet but I have my fingers crossed. Yes the page is being filtered but even filtered some date ranges have a lot of records (1000 or more) so I'm trying to get the filters a bit narrower so they dont return that many records. I'll let everyone know after work tomorrow if the site goes down 50 times. If it does I will take both of your advice in narrowing it down, checking deeper into the logs as well as creating a log on the SQL server to try to narrow down at least who's causing the crash so I can investigate exactly what they're typing.

Thanks again!
Jon
0
 
LVL 56

Expert Comment

by:HainKurt
ID: 36547117
1000 record is approximately 1 MB of data (1KB each) and it should not cause any issue unless you use session to store them... even with sessions, 1MB x 100 user = 100MB of memory... should not create any issue for the server... maybe you use viewstate a lot, which increases data coming/going to server is too much... anyway, first you should find the page, then check the code... I am assuming there is an infinite loop somewhere which eats up all memory and crashes the server...
0
 
LVL 3

Author Closing Comment

by:Jon DeVito
ID: 36560923
Thank you both. I would up moving it to a better, more updated server & the problem seems to have gone away...for now. Since I think you were both correct with the troubleshooting steps I'll split the points. Thank you both so much for all of the help!

Jon
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question