You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ro...@imdb.com> on 1996/06/27 07:15:36 UTC
Re: mod_status > 4GB
thanks. we'll look into it.
'Mark Lottor' wrote
>
>Hi -
>
>The mod_status.c routine (in 1.1b4) wraps the total traffic byte count
>when you go over 4.2GB. This is only good for about 1/4 a T1 line a
>day. When it wraps it screws up all the other stats based on it.
>Enclosed are diffs that will let it go up to approx 4300GB, which
>should be good enough for almost an OC-12.
>
>-Mark
>-------------
>*** mod_status.c.orig Tue Jun 25 18:24:53 1996
>--- mod_status.c Tue Jun 25 18:53:56 1996
>***************
>*** 112,117 ****
>--- 112,127 ----
> rprintf(r,"%.1f GB",(float)bytes/GBYTE);
> }
>
>+ void format_kbyte_out(request_rec *r,unsigned long kbytes)
>+ {
>+ if (kbytes < 1000L)
>+ rprintf(r,"%d KB",(int)kbytes);
>+ else if (kbytes < 1000000L)
>+ rprintf(r,"%.1f MB",(float)kbytes/KBYTE);
>+ else
>+ rprintf(r,"%.1f GB",(float)kbytes/MBYTE);
>+ }
>+
> void show_time(request_rec *r,time_t tsecs)
> {
> long days,hrs,mins,secs;
>***************
>*** 182,187 ****
>--- 192,198 ----
> unsigned long my_lres,my_bytes,conn_bytes;
> unsigned short conn_lres;
> unsigned long bcount=0;
>+ unsigned long kbcount=0;
> float tick=sysconf(_SC_CLK_TCK);
> #endif /* STATUS */
> int short_report=0;
>***************
>*** 269,274 ****
>--- 280,290 ----
> tcs+=score_record.times.tms_cstime;
> count+=lres;
> bcount+=bytes;
>+ if (bcount >= KBYTE)
>+ {
>+ kbcount += (bcount >> 10);
>+ bcount = bcount & 0x3ff;
>+ }
> }
> #endif /* STATUS */
> }
>***************
>*** 291,297 ****
> #if defined(STATUS)
> if (short_report)
> {
>! rprintf(r,"Total Accesses: %lu\nTotal Bytes: %lu\n",count,bcount);
>
> if(ts || tu || tcu || tcs)
> rprintf(r,"CPULoad: %g\n",(tu+ts+tcu+tcs)/tick/up_time*100.);
>--- 307,313 ----
> #if defined(STATUS)
> if (short_report)
> {
>! rprintf(r,"Total Accesses: %lu\nTotal KBytes:
>%lu\n",count,kbcount);
>
> if(ts || tu || tcu || tcs)
> rprintf(r,"CPULoad: %g\n",(tu+ts+tcu+tcs)/tick/up_time*100.);
>***************
>*** 301,314 ****
> rprintf(r,"ReqPerSec: %g\n",(float)count/(float)up_time);
>
> if (up_time>0)
>! rprintf(r,"BytesPerSec: %g\n",(float)bcount/(float)up_time);
>
> if (count>0)
>! rprintf(r,"BytesPerReq: %g\n",(float)bcount/(float)count);
> } else /* !short_report */
> {
> rprintf(r,"Total accesses: %lu - Total Traffic: ", count);
>! format_byte_out(r,bcount);
> rputs("<br>\n",r);
> rprintf(r,"CPU Usage: u%g s%g cu%g cs%g",
> tu/tick,ts/tick,tcu/tick,tcs/tick);
>--- 317,330 ----
> rprintf(r,"ReqPerSec: %g\n",(float)count/(float)up_time);
>
> if (up_time>0)
>! rprintf(r,"BytesPerSec:
>%g\n",KBYTE*((float)kbcount/(float)up_time))
>;
>
> if (count>0)
>! rprintf(r,"BytesPerReq:
>%g\n",KBYTE*((float)kbcount/(float)count));
> } else /* !short_report */
> {
> rprintf(r,"Total accesses: %lu - Total Traffic: ", count);
>! format_kbyte_out(r,kbcount);
> rputs("<br>\n",r);
> rprintf(r,"CPU Usage: u%g s%g cu%g cs%g",
> tu/tick,ts/tick,tcu/tick,tcs/tick);
>***************
>*** 324,336 ****
>
> if (up_time>0)
> {
>! format_byte_out(r,(float)bcount/(float)up_time);
> rputs("/second - ",r);
> }
>
> if (count>0)
> {
>! format_byte_out(r,(float)bcount/(float)count);
> rputs("/request",r);
> }
>
>--- 340,352 ----
>
> if (up_time>0)
> {
>! format_byte_out(r,KBYTE*((float)kbcount/(float)up_time));
> rputs("/second - ",r);
> }
>
> if (count>0)
> {
>! format_byte_out(r,KBYTE*((float)kbcount/(float)count));
> rputs("/request",r);
> }
>
--
Rob Hartill (robh@imdb.com)
The Internet Movie Database (IMDb) http://www.imdb.com/
...more movie info than you can poke a stick at.