Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZsV8I-00028o-DE for pgsql-bugs@arkaria.postgresql.org; Sat, 31 Oct 2015 12:19:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZsV8H-0003Rk-HT for pgsql-bugs@arkaria.postgresql.org; Sat, 31 Oct 2015 12:19:41 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZsV7e-0002l0-T7 for pgsql-bugs@postgresql.org; Sat, 31 Oct 2015 12:19:03 +0000 Received: from c.mail.sonic.net ([64.142.111.80]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZsV7c-0001ap-7G for pgsql-bugs@postgresql.org; Sat, 31 Oct 2015 12:19:01 +0000 Received: from engels (162-236-13-58.lightspeed.sntcca.sbcglobal.net [162.236.13.58]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id t9VCIpZw017849 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA256 bits=128 verify=NOT); Sat, 31 Oct 2015 05:18:51 -0700 Date: Sat, 31 Oct 2015 05:18:53 -0700 From: David Gould To: Jeff Janes Cc: Tom Lane , Alvaro Herrera , Pg Bugs Subject: Re: BUG #13750: Autovacuum slows down with large numbers of tables. More workers makes it slower. Message-ID: <20151031051853.074e23b7@engels> In-Reply-To: <20151031032051.2aa03b65@engels> References: <20151030133252.3033.4249@wrigleys.postgresql.org> <20151030134646.GE5726@alvherre.pgsql> <20151030072704.1a4db344@engels> <20151030151711.GF5726@alvherre.pgsql> <13594.1446219627@sss.pgh.pa.us> <20151030231952.70eb5887@engels> <20151031013714.7e29af3b@engels> <20151031032051.2aa03b65@engels> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVbrmusTXeG8zSnOJHLRMG6VI3ODnWhBPXs5commIgLPxpmR9FjjNcjtkMHxPHRkKSxFyb5eLZOGRqT9qgGrmq7v X-Sonic-ID: C;mnu1i8l/5RG6v70U9jFv0A== M;SGTni8l/5RG6v70U9jFv0A== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org I've collected strace output for a one minute interval with 4 autovacuum workers on my test setup for stock 9.5beta1, Jeff Janes vac_mov_lock patch, and my ordered oids / high watermark patch. These results are normalized to times and number of calls per table analyzed by autovacuum. To refresh, on this setup: Patch Version TPM none 85 vac_mov_lock 600 ordered oids 5225 Strace summary: postgresql 9.5 beta1 cost per table @ 85 tables per minute. ----------------------------------------------------------- calls msec system call [ 4 autovacuum workers ] ------ ------ ------------------- 19.46 196.09 select(0, <<< Waiting for stats snapshot 3.26 1040.46 semop(43188238, <<< Waiting for AutovacuumScheduleLock 2.05 0.83 sendto(8, <<< Asking for stats snapshot calls msec system call [ stats collector ] ------ ------ ------------------- 3.02 0.05 recvfrom(8, <<< Request for snapshot refresh 1.55 248.64 rename("pg_stat_tmp/db_16385.tmp", <<< Snapshot refresh 9.5beta1 + Jeff Janes vac_mov_lock.patch cost per table @ 600 tpm ----------------------------------------------------------------- calls msec system call [ 4 autovacuum workers ] ------ ------ ------------------- 24.90 260.16 select(0, <<< Waiting for stats snapshot 1.41 0.02 sendto(8, <<< Asking for stats snapshot calls msec system call [ stats collector ] ------ ------ ------------------- 1.29 0.02 recvfrom(8, <<< Request for snapshot refresh 0.59 62.40 rename("pg_stat_tmp/db_16385.tmp", <<< Snapshot refresh 9.5beta1 + David Gould autovacuum ordering patch cost per table @ 5225 tpm -------------------------------------------------------------------------- calls msec system call [ 4 autovacuum workers ] ------ ------ ------------------- 0.63 6.34 select(0, <<< Waiting for stats snapshot 0.21 0.01 sendto(8, <<< Asking for stats snapshot 0.07 0.00 semop(43712518, <<< Waiting for AutovacuumLock calls msec system call [ stats collector ] ------ ------ ------------------- 0.40 0.01 recvfrom(8, <<< Request for snapshot refresh 0.04 6.75 rename("pg_stat_tmp/db_16385.tmp", <<< Snapshot refresh -dg -- David Gould daveg@sonic.net If simplicity worked, the world would be overrun with insects. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs