Hey there,

I am trying to understand why psql process is taking 45 seconds to connect
to the local server when using real IP address, when using the localhost is
0.5 seconds.

Basically I would like to get a printout of the slowest system calls that
occurred while I was running the process, matched by execname == "psql".

My dtrace is very rusty, so here is what I go so far, but I don't think
it's doing what I want (:  Any hints appreciated!

#pragma D option quiet
> cat syscalls-all.d
#pragma D option quiet

BEGIN
{
  start = timestamp;
}

syscall:::entry
/execname == "psql"/
{
  @syscalls[probefunc] = count();
  self->start = timestamp;
}
syscall:::return
/self->start/
{
  @latency[probefunc] = avg(timestamp - self->start);
  self->start = 0;
}

END
{
  this->seconds = (timestamp - start) / 1000000000;
  printf("Ran for %d seconds.\n", this->seconds);

  printf("Per-second rate:\n");
  normalize(@syscalls, this->seconds);
  printa(@syscalls);
  printa(@latency);
}

-- 
Regards,
Konstantin

wanelo.com/kig  » work
tektastic.com » blog
soundcloud.com/polygroovers »  unreleased music
soundcloud.com/leftctr <http://soundcloud.com/leftctrl> » dj sets



-------------------------------------------
dtrace-discuss
Archives: https://www.listbox.com/member/archive/184261/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184261/25769126-e243886f
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=25769126&id_secret=25769126-8d47a7b2
Powered by Listbox: http://www.listbox.com

Reply via email to