my asp crashes my server...PLZ HELP!

Results 1 to 2 of 2

Thread: my asp crashes my server...PLZ HELP!

  1. #1
    Join Date
    Dec 1969

    Default my asp crashes my server...PLZ HELP!

    I have the following in my global.asa file and it seems to crash the server when there&#039;s more then 30 active people on the site, any ideas? Its a part of a "Active Users" script...<BR><BR>Sub Session_OnStart()<BR> On Error Resume Next<BR> Session.Timeout = 5<BR><BR> Session("Start") = Now()<BR><BR> &#039;check for other sessions<BR> If rstActiveUsers.RecordCount &#062;= 1 Then<BR> If Not rstActiveUsers.BOF Then rstActiveUsers.MoveFirst<BR><BR> Do While Not rstActiveUsers.EOF<BR><BR> &#039; Check each record for the same IP<BR> If (Request.ServerVariables("REMOTE_HOST") = rstActiveUsers.Fields("ip").Value) Then<BR> rstActiveUsers.Delete<BR> End If<BR><BR> &#039; Check each record for missed timeout after 11 minutes<BR> If DateDiff("n", CDate(rstActiveUsers.Fields("lastvisit").Value), Now()) &#062; 11 Then<BR> rstActiveUsers.Delete<BR> End If<BR> <BR> If Not rstActiveUsers.EOF Then rstActiveUsers.MoveNext<BR> Loop<BR> End If<BR><BR> &#039; Move to the end so records are added in order.<BR> If Not rstActiveUsers.EOF Then rstActiveUsers.MoveLast<BR><BR> rstActiveUsers.AddNew<BR> <BR> rstActiveUsers.Fields("id").Value = Session.SessionID<BR> <BR> rstActiveUsers.Fields("ip").Value = Request.ServerVariables("REMOTE_HOST")<BR> <BR> rstActiveUsers.Fields("browser").Value = Request.ServerVariables("HTTP_USER_AGENT")<BR> <BR> rstActiveUsers.Fields("started").Value = Now()<BR><BR> rstActiveUsers.Fields("lastvisit").Value = Now()<BR><BR> rstActiveUsers.Fields("name").Value = ("Guest" & right(Session.SessionID,2))<BR> <BR> rstActiveUsers.Update<BR><BR>End Sub

  2. #2
    Join Date
    Dec 1969

    Default RE: my asp crashes my server...PLZ HELP!

    well, you could speed it up by doing a SQL insert rather than a recordset insert (which is a pointless waste of resources in this case). Might help. Also, is there REALLY any need to bother with tracking users this way?? logfiles contain this information anyway.<BR><BR>j<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts