Session login too slow or timeout, how to improve?

Results 1 to 2 of 2

Thread: Session login too slow or timeout, how to improve?

  1. #1
    Join Date
    Dec 1969

    Default Session login too slow or timeout, how to improve?

    Hi there,<BR>I have a problem and hope someone can help. <BR>I am running a system which ask for user password before they can proceed to use the system, users always complain that the login and verify password process take too long (sometime more than 60 seconds!). The loading speed is back to normal if they have successfully login (very often the script will return timeout! error) to the users.<BR><BR>Initially I suspect that the server is overloaded, but after I have upgraded the server with more memory & faster CPU, the problem persists. On top of the problem mentioned, sometimes users will be "kicked" off from the system (being routed to the login box again) while they are working in the system, even though it is still within session timeout period (default is 20 min).<BR><BR>My question here:<BR>1. Is there a way to tune IIS to allow more users login at the same time without any problem?<BR>2. Is there any problem with my ASP script below(verifypassword.asp) below? Please check to troubleshoot together and how to improve it.<BR><BR>verifypassword.asp<BR><BR>&#060;!--#include file="config.asp"--&#062;<BR>&#060;%<BR> Server.ScriptTimeOut = 2000<BR> Dim ep_no, password, user_type<BR> Dim conntemp, rstemp<BR> <BR> <BR> ep_no = trim(request.form("ep_no"))<BR> password = trim(request.form("password"))<BR> user_type = trim(request.form("user_type"))<BR> adm_type = trim(request.form("adm_type"))<BR> status = trim(request.form("status"))<BR> <BR> <BR> <BR> Set conntemp = Server.CreateObject("ADODB.Connection")<BR> strConn<BR> if user_type = 2 then<BR> set rstemp = conntemp.execute("SELECT mbr_id, mbr_type, mbr_epno, mbr_email, mbr_passwd, mbr_nick, mbr_country, mbr_segment, mbr_prefered_lob, mbr_prefered_language, mbr_prefered_top FROM member WHERE mbr_epno=&#039;"&ep_no&"&#039; AND mbr_approval = &#039;A&#039;;")<BR> if not rstemp.eof then<BR> rs_mbr_password = trim(rstemp("mbr_passwd"))<BR> rs_mbr_type = trim(rstemp("mbr_type"))<BR> rs_mbr_id = trim(rstemp("mbr_id"))<BR> rs_mbr_nick = trim(rstemp("mbr_nick"))<BR> rs_mbr_epno = trim(rstemp("mbr_epno"))<BR> rs_mbr_email = trim(rstemp("mbr_email"))<BR> rs_mbr_country = trim(rstemp("mbr_country"))<BR> rs_mbr_segment = trim(rstemp("mbr_segment"))<BR> rs_mbr_prefered_lob = trim(rstemp("mbr_prefered_lob"))<BR> rs_mbr_prefered_language = trim(rstemp("mbr_prefered_language"))<BR> rs_mbr_prefered_top= trim(rstemp("mbr_prefered_top"))<BR> else <BR> if len(status & "") &#062; 0 then<BR> response.redirect("admin_login.asp?login_failed=1& status="&status)<BR> else<BR> response.redirect("promo.asp?login_failed=1")<BR> end if<BR> end if<BR> rstemp.close<BR> set rstemp = nothing<BR> <BR> elseif user_type = 1 then <BR> set rstemp = conntemp.execute("SELECT adm_id, adm_name, adm_email, adm_epno, adm_password, adm_type, adm_lob, adm_prefered_lob, adm_prefered_language, adm_prefered_top FROM admin WHERE adm_epno=&#039;"&ep_no&"&#039; AND adm_type="&adm_type)<BR> if not rstemp.eof then<BR> rs_adm_password = trim(rstemp("adm_password"))<BR> rs_adm_type = trim(rstemp("adm_type"))<BR> rs_adm_id = trim(rstemp("adm_id"))<BR> rs_adm_name = trim(rstemp("adm_name"))<BR> rs_adm_epno = trim(rstemp("adm_epno"))<BR> rs_adm_email = trim(rstemp("adm_email"))<BR> rs_adm_lob = trim(rstemp("adm_lob"))<BR> rs_adm_prefered_lob = trim(rstemp("adm_prefered_lob"))<BR> rs_adm_prefered_language = trim(rstemp("adm_prefered_language"))<BR> rs_adm_prefered_top= trim(rstemp("adm_prefered_top"))<BR> else <BR> if len(status & "") &#062; 0 then<BR> response.redirect("admin_login.asp?login_failed=1& status="&status)<BR> else<BR> response.redirect("promo.asp?login_failed=1")<BR> end if<BR> end if<BR> rstemp.close<BR> set rstemp = nothing<BR> end if <BR><BR> conntemp.close<BR> set conntemp = nothing<BR><BR> if user_type = 2 then<BR> <BR> If password = rs_mbr_password then<BR> select case rs_mbr_type<BR> case "1" <BR> session("user_type") = "C"<BR> session("user_type_desc") = "Sales Leader"<BR> case "2"<BR> session("user_type") = "D"<BR> session("user_type_desc") = "Sales Executive"<BR> end select <BR> <BR> session("auth") = "Y"<BR> session("user_id") = rs_mbr_id<BR> session("name") = rs_mbr_nick<BR> session("ep_no") = rs_mbr_epno<BR> session("email") = rs_mbr_email<BR> session("country") = rs_mbr_country<BR> session("segment") = rs_mbr_segment<BR> <BR> if len(rs_mbr_prefered_lob & "") &#062; 0 then<BR> session("prefered_lob") = rs_mbr_prefered_lob<BR> end if<BR> if len(rs_mbr_prefered_language & "") &#062; 0 then<BR> session("prefered_language") = rs_mbr_prefered_language<BR> end if<BR> if len(rs_mbr_prefered_top & "") &#062; 0 then<BR> session("prefered_top") = rs_mbr_prefered_top<BR> end if<BR> response.redirect("index.asp")<BR> else<BR> response.redirect("promo.asp?login_failed=1")<BR> end if <BR> elseif user_type = 1 then<BR> If password = rs_adm_password then<BR> select case adm_type<BR> case "1" <BR> session("user_type") = "A"<BR> session("user_type_desc") = "Administrator"<BR> case "2"<BR> session("user_type") = "B"<BR> session("user_type_desc") = "Content Reviewer"<BR> case "3"<BR> session("user_type") = "E"<BR> session("user_type_desc") = "Content Creator"<BR> end select <BR> session("auth") = "Y"<BR> session("user_id") = rs_adm_id<BR> session("name") = rs_adm_name<BR> session("email") = rs_adm_email<BR> session("ep_no") = rs_adm_epno<BR> session("lob") = rs_adm_lob<BR> if len(adm_prefered_lob & "") &#062; 0 then<BR> session("prefered_lob") = rs_adm_prefered_lob<BR> end if<BR> if len(adm_prefered_language & "") &#062; 0 then<BR> session("prefered_language") = adm_prefered_language<BR> end if<BR> if len(adm_prefered_top & "") &#062; 0 then<BR> session("prefered_top") = adm_prefered_top<BR> end if<BR> <BR> response.redirect("index.asp")<BR> else<BR> response.redirect("admin_login.asp?login_failed=1& status="&status)<BR> end if <BR> end if<BR> <BR>%&#062;<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Session login too slow or timeout, how to impr

    I&#039;m a bit confused about what you are doing with all these redirections:<BR><BR>i.e.<BR> response.redirect("admin_login.asp?login_failed=1& status="&status)<BR>else<BR> response.redirect("promo.asp?login_failed=1")<BR>< BR>in both cases has the login failed? if the page is timing out, how do you know its not timing out on the page that you redirecting to, after all, you said that successful login as fast, perhaps we need to be looking at the failed login page&#039;s code.

Posting Permissions

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