I tried that, and I got back error from specweb99 stating that the responses
were not conforming. (or something like that)..
Now, I have a global time variable, that I set once in
specweb99_quick_handler(), and the other two instances, try to use it,
rather than compute again.. The third time() - in the ap_log_error(), I've
put it in "ifdef DEBUG" :-).. Trying this out now..
-Madhu
-----Original Message-----
From: David Hill [mailto:ddhill@zk3.dec.com]
Sent: Thursday, January 23, 2003 1:56 PM
To: test-dev@httpd.apache.org
Subject: Re: gettimeofday calls
I would think that using the http request time would meet the spec and
be easier than your alternatives...
Dave
----- Original Message -----
From: "MATHIHALLI,MADHUSUDAN (HP-Cupertino,ex1)"
To:
Sent: Thursday, January 23, 2003 4:05 PM
Subject: RE: gettimeofday calls
> I don't know if this has been discussed already, but I was thinking
of the
> following alternatives :
> 1. how about the listener thread in each of the child process keeps
updating
> a global time variable that each of the threads can refer to ?.
> 2. set the time at the begining of the process, and then each of the
thread
> measures the amount of time it has been running.. (Current time =
startup
> time + delta time).. AFAIK, the time taken to compute delta time is
much
> lesser than gettimeofday..
>
> Is this against the spec or something ?.
>
> -Madhu
>
> -----Original Message-----
> From: Greg Ames [mailto:gregames@apache.org]
> Sent: Thursday, January 23, 2003 11:19 AM
> To: test-dev@httpd.apache.org
> Subject: Re: gettimeofday calls
>
>
> MATHIHALLI,MADHUSUDAN (HP-Cupertino,ex1) wrote:
>
> > The following is the tusc output of httpd (2.0.43) +
> mod_specweb99.c
> > on HP-UX.. Almost every single request has a gettimeofday
> system call - is
> > there any way to avoid it ?.
>
> The GET /file_set/* requests are just plain ol' static files
> served by the httpd
> core, so I think the gettimeofday is due to:
>
> r->request_time = apr_time_now();
>
> ...line 681 from server/protocol.c. I don't see that going
> away in the near future.
>
> OTOH, the GET /?/file_set/* is a dynamic request served by
> mod_specweb99. The
> three time() syscalls there bother me. I'm guessing that this
> request had a
> cookie which drives do_cadget() and friends. Looking at code
> in that path I do
> see three different time calls. One of them will go away if
> you select a
> quieter LogLevel...you probably have "Found ad expire
> " messages in your error log.
>
> Off the top of my head, we could probably change mod_specweb99 to
use
> r->request_time in place of the time() syscalls and make it a
> little faster.
> But then we will have to take into account the difference
> between apr_time_t's
> and seconds. :-(
>
> Greg
>
> >
> > {72114} poll(0x6fd88910, 1, 120000) ...................... = 1
> > {72114} read(149, "G E T / ? / f i l e _ s e t / ".., 8000) =
159
> > {72114} gettimeofday(0x6fd88448, NULL) ................... = 0
> > {72114} time(NULL) ....................................... =
> 1043344112
> > {72114} time(NULL) ....................................... =
> 1043344112
> > {72114} time(NULL) ....................................... =
> 1043344112
> > {72114}
> stat("/opt/apache2/htdocs//file_set/dir00016/class1_8", 0x6fd885c8)
> > = 0
> > {72114}
> open("/opt/apache2/htdocs//file_set/dir00016/class1_8", O_RDONLY,
> > 0666)
> > = 43
> > {72114} read(43, " 9 2 1 6 f i l e _ s ".., 9216) =
9216
> > {72114} writev(149, 0x6fd88988, 4) ....................... = 9803
> > {72114} read(149, 0x40288078, 8000) ......................
> ERR#11 EAGAIN
> > {72114} write(8, "1 9 2 . 1 6 8 . 3 . 2 [ 2 3 / ".., 95) = 95
> > {72114} close(43) ........................................ = 0
> > {72114} poll(0x6fd88910, 1, 120000) ...................... = 1
> > {72114} read(149, "G E T / f i l e _ s e t / d i ".., 8000) = 70
> > {72114} gettimeofday(0x6fd88448, NULL) ................... = 0
> > {72114}
> stat("/opt/apache2/htdocs/file_set/dir00047/class1_0", 0x6fd88548) =
> > 0
> > {72114}
> open("/opt/apache2/htdocs/file_set/dir00047/class1_0", O_RDONLY, 0)
> > = 55
> > {72114} read(149, 0x40288078, 8000) ......................
> ERR#11 EAGAIN
> > {72114} sendfile(149, 55, 0, 1024, 0x6fd88688, 0) ........ = 1289
> > {72114} write(8, "1 9 2 . 1 6 8 . 3 . 2 [ 2 3 / ".., 93) = 93
> > {72114} poll(0x6fd88910, 1, 120000) ...................... = 1
> > {72114} read(149, "G E T / f i l e _ s e t / d i ".., 8000) = 70
> > {72114} gettimeofday(0x6fd88448, NULL) ................... = 0
> > {72114}
> stat("/opt/apache2/htdocs/file_set/dir00009/class0_3", 0x6fd88548) =
> > 0
> > {72114}
> open("/opt/apache2/htdocs/file_set/dir00009/class0_3", O_RDONLY, 0)
> > = 59
> > {72114} read(149, 0x4038c098, 8000) ......................
> ERR#11 EAGAIN
> > {72114} sendfile(149, 59, 0, 409, 0x6fd88688, 0) ......... = 673
> > {72114} write(8, "1 9 2 . 1 6 8 . 3 . 2 [ 2 3 / ".., 92) = 92
> > {72114} poll(0x6fd88910, 1, 120000) ...................... = 1
> > {72114} read(149, "G E T / f i l e _ s e t / d i ".., 8000) = 70
> > {72114} gettimeofday(0x6fd88448, NULL) ................... = 0
> > {72114}
> stat("/opt/apache2/htdocs/file_set/dir00000/class1_2", 0x6fd88548) =
> > 0
> > {72114}
> open("/opt/apache2/htdocs/file_set/dir00000/class1_2", O_RDONLY, 0)
> > = 76
> > {72114} read(149, 0x40288078, 8000) ......................
> ERR#11 EAGAIN
> > {72114} sendfile(149, 76, 0, 3072, 0x6fd88688, 0) ........ = 3336
> > {72114} write(8, "1 9 2 . 1 6 8 . 3 . 2 [ 2 3 / ".., 93) = 93
> >
>
>
>