From owner-freebsd-emulation@FreeBSD.ORG Mon Jul 21 14:21:39 2014 Return-Path: Delivered-To: emulation@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 14B3F547 for ; Mon, 21 Jul 2014 14:21:39 +0000 (UTC) Received: from smarthost1.sentex.ca (smarthost1.sentex.ca [IPv6:2607:f3e0:0:1::12]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "smarthost.sentex.ca", Issuer "smarthost.sentex.ca" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D53682BAE for ; Mon, 21 Jul 2014 14:21:38 +0000 (UTC) Received: from [IPv6:2607:f3e0:0:4:f025:8813:7603:7e4a] (saphire3.sentex.ca [IPv6:2607:f3e0:0:4:f025:8813:7603:7e4a]) by smarthost1.sentex.ca (8.14.9/8.14.9) with ESMTP id s6LELaUw030612; Mon, 21 Jul 2014 10:21:37 -0400 (EDT) (envelope-from mike@sentex.net) Message-ID: <53CD21F0.7080401@sentex.net> Date: Mon, 21 Jul 2014 10:21:36 -0400 From: Mike Tancsa Organization: Sentex Communications User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "freebsd-emulation@freebsd.org" Subject: forcing a Virtbox to flush its cache on demand or more frequently Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 14:21:39 -0000 I have been experimenting with HAST and virtbox to have failover between servers and ran into a problem with caching. I am guessing in order to prevent every little guest write from writing out to the host's disks, the hypervisor waits for some period of time to write things out. However, this delay can be upwards of hours! On a normally busy box this is not an issue, but for a guest OS that does infrequent (but important) writes, the delay is much too long. I have already set --hostiocache off, but it does not seem to make a difference. If I set a process in the guest to do something like dd if=/dev/urandom of=/tmp/junk bs=1024k count=5 that seems sufficient to trigger a write to the hypervisor's disk, but this is from limited testing only. Is there a better way to do it ? ---Mike -- ------------------- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, mike@sentex.net Providing Internet services since 1994 www.sentex.net Cambridge, Ontario Canada http://www.tancsa.com/