Re: High SYS CPU - need advise

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Vlad <marchenko(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: High SYS CPU - need advise
Date: 2012-11-15 23:52:51
Message-ID: 27746.1353023571@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Merlin Moncure <mmoncure(at)gmail(dot)com> writes:
> What I've been scratching my head over is what code exactly would
> cause an iterative sleep like the above. The code is here:

> pg_usleep(cur_delay * 1000L);

> /* increase delay by a random fraction between 1X and 2X */
> cur_delay += (int) (cur_delay *
> ((double) random() / (double) MAX_RANDOM_VALUE) + 0.5);
> /* wrap back to minimum delay when max is exceeded */
> if (cur_delay > MAX_DELAY_MSEC)
> cur_delay = MIN_DELAY_MSEC;

IIRC that coding is of relatively recent vintage. The OP is probably
running some older version that increased cur_delay differently.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vlad Marchenko 2012-11-16 00:06:24 Re: High SYS CPU - need advise
Previous Message David Johnston 2012-11-15 22:58:46 Re: Percent of Total in Histogram Query