Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 91EAFBED7F3 for ; Mon, 30 Jan 2012 03:42:06 -0400 (AST) Received: from mail-ee0-f46.google.com ([74.125.83.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RrlsL-0007rr-4i for pgsql-performance@postgresql.org; Mon, 30 Jan 2012 07:42:06 +0000 Received: by eekc14 with SMTP id c14so1322514eek.19 for ; Sun, 29 Jan 2012 23:41:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=y+hI25rfUne32E3T/9sKu84ZxhkRNIGASrBuo8naCpU=; b=gJOHMnIWHZU9EA4yjd9wcMOX1BPrMSSUe6fvCXQ+ZIsyk0q0irHVw2A6rHqXDRUM7k Rcv40fDpiQIc4MQPAVQIX9ts5U222qa+p/3nchbnpVEtmSZKcqY9bX/L1waM5lD1WLwZ QFmbyCr4V3FtEvJPltpmudW6M7SNx0DkoKrBY= Received: by 10.14.4.85 with SMTP id 61mr5238517eei.58.1327909312057; Sun, 29 Jan 2012 23:41:52 -0800 (PST) Received: from MacBook-Air-van-Ron.local (i117104.upc-i.chello.nl. [62.195.117.104]) by mx.google.com with ESMTPS id n17sm69376029eei.3.2012.01.29.23.41.50 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 29 Jan 2012 23:41:51 -0800 (PST) Message-ID: <4F2649BD.3000009@gmail.com> Date: Mon, 30 Jan 2012 08:41:49 +0100 From: Ron Arts User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Jose Ildefonso Camargo Tolosa CC: pgsql-performance@postgresql.org Subject: Re: Having I/O problems in simple virtualized environment References: <4F25CCD4.8080009@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201201/115 X-Sequence-Number: 46127 Op 30-01-12 02:52, Jose Ildefonso Camargo Tolosa schreef: > On Sun, Jan 29, 2012 at 6:18 PM, Ron Arts wrote: >> Hi list, >> >> I am running PostgreSQL 8.1 (CentOS 5.7) on a VM on a single XCP (Xenserver) host. >> This is a HP server with 8GB, Dual Quad Core, and 2 SATA in RAID-1. >> >> The problem is: it's running very slow compared to running it on bare metal, and >> the VM is starving for I/O bandwidht, so other processes (slow to a crawl. >> This does not happen on bare metal. >> >> I had to replace the server with a bare-metal one, I could not troubleshoot in production. >> Also it was hard to emulte the workload for that VM in a test environment, so I >> concentrated on PostgreSQLand why it apparently generated so much I/O. >> >> Before I start I should confess having only spotty experience with Xen and PostgreSQL >> performance testing. >> >> I setup a test Xen server created a CentOS5.7 VM with out-of-the-box PostgreSQL and ran: >> pgbench -i pgbench ; time pgbench -t 100000 pgbench >> This ran for 3:28. Then I replaced the SATA HD with an SSD disk, and reran the test. >> It ran for 2:46. This seemed strange as I expected the run to finish much faster. >> >> I reran the first test on the SATA, and looked at CPU and I/O use. The CPU was not used >> too much in both the VM (30%) and in dom0 (10%). The I/O use was not much as well, >> around 8MB/sec in the VM. (Couldn't use iotop in dom0, because of missing kernel support >> in XCP 1.1). >> >> It reran the second test on SSD, and experienced almost the same CPU, and I/O load. >> >> (I now probably need to run the same test on bare metal, but didn't get to that yet, >> all this already ruined my weekend.) >> >> Now I came this far, can anybody give me some pointers? Why doesn't pgbench saturate >> either the CPU or the I/O? Why does using SSD only change the performance this much? > > Ok, one point: Which IO scheduler are you using? (on dom0 and on the VM). Ok, first dom0: For the SSD (hda): # cat /sys/block/sda/queue/scheduler [noop] anticipatory deadline cfq For the SATA: # cat /sys/block/sdb/queue/scheduler noop anticipatory deadline [cfq] Then in the VM: # cat /sys/block/xvda/queue/scheduler [noop] anticipatory deadline cfq Ron