Solved

ASP with SQL queries keeps crashing

Posted on 2011-09-14
10
264 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 51

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 51

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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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 51

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 51

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL 2012 AOG and SQL2014 AOG 76 59
Html split(text) 2 27
Why is this SQL bringing back extra rows? (parsing XML data) 4 35
add stored proc on publlication 4 19
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
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…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

763 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