Date: Fri, 27 Jun 2008 20:57:11 GMT From: Marcus Reid <marcus@blazingdot.com> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/125056: Unnecessary msync() call kills rrdtool performance under FreeBSD Message-ID: <200806272057.m5RKvBW1058617@www.freebsd.org> Resent-Message-ID: <200806272100.m5RL092b072873@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 125056 >Category: ports >Synopsis: Unnecessary msync() call kills rrdtool performance under FreeBSD >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Jun 27 21:00:09 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Marcus Reid >Release: 7.0-STABLE >Organization: >Environment: FreeBSD socbox.megapath.biz 7.0-STABLE FreeBSD 7.0-STABLE #0: Tue Jun 17 07:02:32 UTC 2008 toor@socbox.megapath.biz:/usr/obj/usr/src/sys/FARK i386 >Description: Version 1.3.0 of rrdtool calls msync() for each update, which is necessary under Linux but severely impacts update performance under FreeBSD. Due to differences in the buffer caches of the different platforms, msync() is obsolete under FreeBSD but necessary under Linux (see the man page for each platform.) >How-To-Repeat: Do back-to-back updates using some fast rrdtool language bindings and watch as it goes really slow. >Fix: *** src/rrd_open.c.orig Fri Jun 27 20:55:00 2008 --- src/rrd_open.c Fri Jun 27 20:55:20 2008 *************** *** 388,396 **** int ret; #ifdef HAVE_MMAP - ret = msync(rrd_file->file_start, rrd_file->file_len, MS_ASYNC); - if (ret != 0) - rrd_set_error("msync rrd_file: %s", rrd_strerror(errno)); ret = munmap(rrd_file->file_start, rrd_file->file_len); if (ret != 0) rrd_set_error("munmap rrd_file: %s", rrd_strerror(errno)); --- 388,393 ---- Patch attached with submission follows: *** src/rrd_open.c.orig Fri Jun 27 20:55:00 2008 --- src/rrd_open.c Fri Jun 27 20:55:20 2008 *************** *** 388,396 **** int ret; #ifdef HAVE_MMAP - ret = msync(rrd_file->file_start, rrd_file->file_len, MS_ASYNC); - if (ret != 0) - rrd_set_error("msync rrd_file: %s", rrd_strerror(errno)); ret = munmap(rrd_file->file_start, rrd_file->file_len); if (ret != 0) rrd_set_error("munmap rrd_file: %s", rrd_strerror(errno)); --- 388,393 ---- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806272057.m5RKvBW1058617>