Solved

ASP with SQL queries keeps crashing

Posted on 2011-09-14
10
265 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 53

Expert Comment

by:Huseyin KAHRAMAN
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 53

Accepted Solution

by:
Huseyin KAHRAMAN 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
Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

 
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 53

Expert Comment

by:Huseyin KAHRAMAN
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 53

Expert Comment

by:Huseyin KAHRAMAN
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
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…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

710 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