Hi,

Some time ago [1], I proposed print a message every time there isn't autovacuum slots available and it asks for another one. It is not a complete solution for autovacuum tuning but it would at least give us a hint that number of workers is insufficient to keep up with the current load. The accurate number of slots needed would be the optimal solution but that information is not free (it would have to check every table in the databases available to get the approximate number of slots needed. Approximate because some table could be finishing the operation). A new warning is better than nothing. If we decided to improve this area in a future we should remove the warning but right now it would be an excelent hint to tune autovacuum.


[1] http://archives.postgresql.org/pgsql-hackers/2011-06/msg00678.php


--
   Euler Taveira de Oliveira - Timbira       http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3b71232..4ec0f87 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -656,6 +656,12 @@ AutoVacLauncherMain(int argc, char *argv[])
 
 		can_launch = (AutoVacuumShmem->av_freeWorkers != NULL);
 
+		if (!can_launch)
+			ereport(LOG,
+					(errmsg("maximum number of autovacuum workers reached"),
+					 errhint("Consider increasing autovacuum_max_workers (currently %d).",
+						 	autovacuum_max_workers)));
+
 		if (AutoVacuumShmem->av_startingWorker != NULL)
 		{
 			int			waittime;
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to