Session ids are sometimes created with javas SecureRandom class. On first
invocation this takes up to 30 seconds.
After the first random was created the time for creating other randoms is
negligible.

Peter

psalazar wrote:

> Greetings,
>
> I have a servlet that when a request arrives, it makes a profile using
> the header "User-Agent" (which contains the type of the client). But,
> this process was taking too long and I thought it was my
> ProfileFinder.getProfile() method! But, when I made some logs (I put it
> below with the source), I saw that the time is "wasted" in the process
> of retrieving of session object from request!!!
>
> How can it be?? 20 seconds to get (create) a session object?? The first
> time I create a session object it takes 20 seconds!!
>
> I really, really appreciate any help on this....
>
> My system:
> -linux redhat 6.2 (kernel 2.2.18)
> -tomcat3.2.1
> -jdk1.3.0
> -PII400 with 256MB
>
> thanks,
> Pedro Salazar (my stuff is below)
>
> ---------------SOURCE------------------------
>
> long t0=System.currentTimeMillis();
>
> HttpSession sesssion=req.getSession(true);
>
> long t1=System.currentTimeMillis();
> getServletContext()log("time:"+(t1-t0) );
>
> Profile p=(Profile)session.getAttribute("profile");
>
> long t2=System.currentTimeMillis();
> getServletContext().log("time:"+(t2-t1) );
>
> if(p==null){
>         String value = req.getHeader("User-Agent");
>
>          long t3=System.currentTimeMillis();
>          getServletContext().log("time:"+(t3-t2) );
>
>          p=new Profile(ProfileFinder.getProfile(value));
>
>          long t4=System.currentTimeMillis();
>          getServletContext().log("time:"+(t4-t3) );
>
>         session.setAttribute("profile",p);
> }
>
> ---------OUTPUT---------------------------
> 2001-07-17 09:29:49 - path="/sad" :servletInicio: time:21338
> 2001-07-17 09:29:49 - path="/sad" :servletInicio: time:1
> 2001-07-17 09:29:49 - path="/sad" :servletInicio: time:1
> 2001-07-17 09:29:49 - path="/sad" :servletInicio: time:146
> -------------------------------------------
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

--

*** Bitte beachten Sie unsere neuen Mail- und Internet-Adressen ***
*** Please notice the new mail- and internet-address            ***

--

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to