Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZcfZo-0003Tk-38 for pgsql-performance@arkaria.postgresql.org; Thu, 17 Sep 2015 20:14:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZcfZn-0004aM-Fj for pgsql-performance@arkaria.postgresql.org; Thu, 17 Sep 2015 20:14:39 +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 1ZcfY8-0008Rf-Re for pgsql-performance@postgresql.org; Thu, 17 Sep 2015 20:12:57 +0000 Received: from proofpoint1.mail.rice.edu ([128.42.201.100] helo=pp1.rice.edu) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZcfY5-0000lT-ND for pgsql-performance@postgresql.org; Thu, 17 Sep 2015 20:12:55 +0000 Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.15.0.59/8.15.0.59) with SMTP id t8HK8o30005576; Thu, 17 Sep 2015 15:12:52 -0500 Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by pp1.rice.edu with ESMTP id 1wyehcrte0-1; Thu, 17 Sep 2015 15:12:51 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel X-SMTP-Auth: no X-SMTP-Auth: no Received: from aart.rice.edu (aart.rice.edu [168.7.56.48]) by mh1.mail.rice.edu (Postfix) with ESMTP id B106C460254; Thu, 17 Sep 2015 15:12:51 -0500 (CDT) Received: by aart.rice.edu (Postfix, from userid 18612) id A959510090B; Thu, 17 Sep 2015 15:12:51 -0500 (CDT) Date: Thu, 17 Sep 2015 15:12:51 -0500 From: "ktm@rice.edu" To: Dave Stibrany Cc: pgsql-performance@postgresql.org Subject: Re: Occasional Really Slow Running Updates/Inserts Message-ID: <20150917201251.GA30163@aart.rice.edu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 kscore.compositescore=1 compositescore=0.9 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 rbsscore=0.9 spamscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310000 definitions=main-1509170253 X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On Thu, Sep 17, 2015 at 03:14:43PM -0400, Dave Stibrany wrote: > Hi all. I am occasionally seeing really slow update/inserts into a fairly > large table. By really slow I mean around 10-40 seconds, > while the majority of queries take milliseconds. I cannot reproduce this > problem myself, but it is occurring multiple times a day > (maybe 30 times). > > System Info > --------------- > Model: Dell PowerEdge R420 > CPU: 12 core Intel(R) Xeon(R) @ 2.20GHz > Memory: 16GB > Disk: PERC H310 Mini Raid Controller using Raid 1 > OS: Ubuntu 14.04.3 LTS > > DB Settings > ---------------- > ... a lot of information deleted... Hi Dave, This search index is almost certainly the cause of your slowdowns: > Indexes: > "document_search_ix" gin (contents_search) We observed similar odd slowdowns with a GIN text search index. We had to disable the 'fastupdate' option for the index to stop the large pauses by the index entry clean-up processing. There have been some recent patches to address the penalty problem caused by the fastupdate processing. > What I haven't tried > -------------------- > - more aggressive auto-vacuum > - trying gist table for full text search index instead of gin > - removing full text search altogether (are users don't use it very much) Nope, keep using GIN. GIST is too slow for this usage. Just disable the 'fastupdate' on the index: ALTER INDEX document_search_ix SET (fastupdate = off); Regards, Ken -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance