Re: Debug Messages on clientReadRequest?

From: Jaeho Yang <jhyang@dont-contact.us>
Date: Tue, 21 Apr 1998 17:51:15 +0900

> When I used squid, I encountered odd messages from cache.log.
>
> That log has several messages.
>
> -- < here > --
> 1998/04/20 07:42:30| clientReadRequest: FD 28: no data to process
> ((35) Resource temporarily unavailable)
> 1998/04/20 07:42:30| clientReadRequest: FD 24: no data to process
> ((35) Resource temporarily unavailable)
> 1998/04/20 07:42:31| requestTimeout: FD 41: lifetime is expired.
> 1998/04/20 07:42:31| clientReadRequest: FD 27: no data to process
> ((35) Resource temporarily unavailable)
> 1998/04/20 07:42:38| clientReadRequest: FD 40:
> (54) Connection reset by peer
>
> -- ---- ---
>
> I'm using squid 1.2beta19.
>
> Could you explain what resource needed more ?
>
> Our squid runs very well, but sometimes the throughput stops 10~30 seconds.
>

   I got the simple rule about such a phenomenon.

   When the blocking occurrs in "hh:mm:ss", the blocking problem cleared around
   "hh:mm+1:00". For examle, when 02:10:10 blocking started.. around 02:11:00,
   the blocking phenonmeon stop..(it produces throughputs...)

   I wrote performance metering program to check throughput of access.log.
   I doubt that squid program has routine for *some blocking* when busy..

   I posted sime metering program..

-- Start of meter.c --

/*
 * performace metering for squid log
 *
 * meter.c - Jaeho Yang (jhyang@nuri.net)
 */

# include <stdio.h>
# include <time.h>
# include <sys/time.h>
# include <unistd.h>

# define SQUID_LOG "/usr/cache/logs/access.log"

main(int argc, char **argv)
{
  FILE *lf;
  char lpath[255], lbuf[255], *cp, *readline;
  char timestamp[80], elapsedtime[80];
  long tailp;
  long lastsec, sec, msec;
  struct tm *ct;

  if ((lf = fopen(SQUID_LOG, "r")) == NULL) { exit(0); }

  tailp = 0L;
  lastsec = 0;
  tailp = fseek(lf, 0, SEEK_END);
  sleep(2);

  for (;;) {
    readline = fgets(lbuf, 255, lf);
    if (readline == NULL) {
      msleep(0, 200); fseek(lf, tailp, SEEK_SET); continue;
    }
    if ((cp = (char *) strchr(lbuf, '\n')) == NULL) {
      msleep(0, 200); fseek(lf, tailp, SEEK_SET); continue;
    }

    tailp = ftell(lf);
    sscanf(lbuf, "%s %s", timestamp, elapsedtime);
    sscanf(timestamp, "%ld.%ld", &sec, &msec);
    if (lastsec != sec) {
      if (lastsec == 0) lastsec = sec;
      for (lastsec++; lastsec < sec; lastsec++) {
        ct = localtime(&lastsec);
        printf("\n%02d:%02d ", ct->tm_min, ct->tm_sec);
      }
      ct = localtime(&sec);
      printf("\n%02d:%02d ", ct->tm_min, ct->tm_sec);
      fflush(stdout);
    }

    lastsec = sec;
    printf("#"); fflush(stdout);
  }
}

msleep(int sec, int msec)
{
  struct timeval tick;

  tick.tv_sec = sec; tick.tv_usec = 1000*msec;
  select(0, NULL, NULL, NULL, &tick);
}

--- End of meter.c ---

> I doubt it was blocked in some routines, or it doen't support resource
> management..
>
> Is there any debugging techniqueue ?
>
> My testing squid server's performance made throughput of 100~150 hit/sec at
> peak time. And 100,000 hit per day.
>
> But I can't see any performance degrade on memory. (It have enough
> memory (no swap-in&swap-out occurs)
>
> Any Idea !!
>
> --
> Jaeho Yang
> jhyang@nuri.net
Received on Tue Apr 21 1998 - 02:42:54 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:39:47 MST