High CPU usage of stats collector

Started by komuncaabout 13 years ago6 messagesgeneral
Jump to latest
#1komunca
komunca@gmail.com

On my db server I have noticed a very high CPU usage of process:
*postgres: stats collector process*

It is not below 50% of CPU. (Info from htop).

What is best way to decrease CPU usage of this process?

Thanks

--
View this message in context: http://postgresql.1045698.n5.nabble.com/High-CPU-usage-of-stats-collector-tp5750271.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Magnus Hagander
magnus@hagander.net
In reply to: komunca (#1)
Re: High CPU usage of stats collector

On Sun, Mar 31, 2013 at 11:44 PM, komunca <komunca@gmail.com> wrote:

On my db server I have noticed a very high CPU usage of process:
*postgres: stats collector process*

It is not below 50% of CPU. (Info from htop).

What is best way to decrease CPU usage of this process?

Do you by any chance have a large number of databases, and/or a large
number of objects in your databases (tables or indexes)?

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3komunca
komunca@gmail.com
In reply to: Magnus Hagander (#2)
Re: High CPU usage of stats collector

yes. maybe ~200 databases

--
View this message in context: http://postgresql.1045698.n5.nabble.com/High-CPU-usage-of-stats-collector-tp5750271p5750918.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Michael Paquier
michael@paquier.xyz
In reply to: Magnus Hagander (#2)
Re: High CPU usage of stats collector

On Fri, Apr 5, 2013 at 7:44 PM, Magnus Hagander <magnus@hagander.net> wrote:

On Sun, Mar 31, 2013 at 11:44 PM, komunca <komunca@gmail.com> wrote:

On my db server I have noticed a very high CPU usage of process:
*postgres: stats collector process*

It is not below 50% of CPU. (Info from htop).

What is best way to decrease CPU usage of this process?

Do you by any chance have a large number of databases, and/or a large
number of objects in your databases (tables or indexes)?

Could you output the result of this query?
SELECT count(*) FROM pg_class;
--
Michael

#5komunca
komunca@gmail.com
In reply to: Michael Paquier (#4)
Re: High CPU usage of stats collector

*288*

--
View this message in context: http://postgresql.1045698.n5.nabble.com/High-CPU-usage-of-stats-collector-tp5750271p5750925.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#6Jeff Janes
jeff.janes@gmail.com
In reply to: komunca (#1)
Re: High CPU usage of stats collector

On Sun, Mar 31, 2013 at 2:44 PM, komunca <komunca@gmail.com> wrote:

On my db server I have noticed a very high CPU usage of process:
*postgres: stats collector process*

It is not below 50% of CPU. (Info from htop).

What is best way to decrease CPU usage of this process?

This is a known issue when you have a large number of databases with a
large number of objects each.

It will be fixed in 9.3. In the meantime you can perhaps increase
autovacuum_naptime, but that has tradeoffs.

Cheers,

Jeff