From owner-freebsd-current@FreeBSD.ORG Tue Aug 12 21:36:27 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D52995; Tue, 12 Aug 2014 21:36:27 +0000 (UTC) Received: from mail-qa0-x233.google.com (mail-qa0-x233.google.com [IPv6:2607:f8b0:400d:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE673262D; Tue, 12 Aug 2014 21:36:26 +0000 (UTC) Received: by mail-qa0-f51.google.com with SMTP id k15so9140923qaq.38 for ; Tue, 12 Aug 2014 14:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=P6HwJjuC1lBpaSdeq0qKfWJgobtnaZR9SENeJE8kAaY=; b=gYYfTM/jbnHY+TGEIP0z2Jd8EBz5JOT5Y3wWGegdYHJunP2FKshJdOqsYPbyEQtnHM XpjfT147RCUI2gCjvfsEJhwU69L075TBRh+ty+6Pb0K48UlmOg3A3imcgCJF3zEM7/M3 vHJ+/4GkHfyLvLB8oCmEOWWKuhiWIzBO/QRwfDd7UTq4I0QGRugFS4bcIqnz/HdPAIYS 519UQkdj94wTkKhz4jCCO9E5LGb+qcBOF1/cr4A4X/C23tiqc5Ks3FeAWKKv5S5dfMsj Tuhse0EJ2D49xB56c3ZZ8wHsk5Uqw7rTlsNqurvMe1bpGkoGoVK+lZOUPg4i4vxCbDtG fecg== MIME-Version: 1.0 X-Received: by 10.140.27.144 with SMTP id 16mr748440qgx.18.1407879386162; Tue, 12 Aug 2014 14:36:26 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.39.139 with HTTP; Tue, 12 Aug 2014 14:36:26 -0700 (PDT) In-Reply-To: <201408121409.40653.jhb@freebsd.org> References: <20140627125613.GT93733@kib.kiev.ua> <20140716132938.GB93733@kib.kiev.ua> <201408121409.40653.jhb@freebsd.org> Date: Tue, 12 Aug 2014 14:36:26 -0700 X-Google-Sender-Auth: Ul21HWjPHQrdSrY658-LIWJGqFw Message-ID: Subject: Re: PostgreSQL performance on FreeBSD From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: Konstantin Belousov , freebsd-current , performance@freebsd.org, "current@freebsd.org" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2014 21:36:27 -0000 On 12 August 2014 11:09, John Baldwin wrote: > On Wednesday, July 16, 2014 1:52:45 pm Adrian Chadd wrote: >> Hi! >> >> >> On 16 July 2014 06:29, Konstantin Belousov wrote: >> > On Fri, Jun 27, 2014 at 03:56:13PM +0300, Konstantin Belousov wrote: >> >> Hi, >> >> I did some measurements and hacks to see about the performance and >> >> scalability of PostgreSQL 9.3 on FreeBSD, sponsored by The FreeBSD >> >> Foundation. >> >> >> >> The results are described in https://kib.kiev.ua/kib/pgsql_perf.pdf. >> >> The uncommitted patches, referenced in the article, are available as >> >> https://kib.kiev.ua/kib/pig1.patch.txt >> >> https://kib.kiev.ua/kib/patch-2 >> > >> > A followup to the original paper. >> > >> > Most importantly, I identified the cause for the drop on the graph >> > after the 30 clients, which appeared to be the debugging version >> > of malloc(3) in libc. >> > >> > Also there are some updates on the patches. >> > >> > New version of the paper is available at >> > https://www.kib.kiev.ua/kib/pgsql_perf_v2.0.pdf >> > The changes are marked as 'update for version 2.0'. >> >> Would you mind trying a default (non-PRODUCTION) build, but with junk >> filling turned off? >> >> adrian@adrian-hackbox:~ % ls -l /etc/malloc.conf >> >> lrwxr-xr-x 1 root wheel 10 Jun 24 04:37 /etc/malloc.conf -> junk:false >> >> That fixes almost all of the malloc debug performance issues that I >> see without having to recompile. >> >> I'd like to know if you see any after that. > > OTOH, I have actually seen junk profiling _improve_ performance in certain > cases as it forces promotion of allocated pages to superpages since all pages > are dirtied. (I have a local hack that adds a new malloc option to explicitly > memset() new pages allocated via mmap() that gives the same benefit without > the junking overheadon each malloc() / free(), but it does increase physical > RAM usage.) Hm. this isn't a jemalloc config option? -a