tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From psalazar <>
Subject getSession(true) takes more than 20 seconds????
Date Tue, 17 Jul 2001 21:04:40 GMT

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)
-PII400 with 256MB

Pedro Salazar (my stuff is below)


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) );

     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) );


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

View raw message