Hi gavin,

The thing is that your test is is using async writes in SmartOS (dd does async 
writes) and sync writes in KVM (KVM does only sync writes) so the performance 
is inherently lower in KVM. Cache is not the issue here I think.

So if you can’t go for SSD log devices, just disable the sync writes for the 
partition in ZFS. If your real workload is mainly async writes, it won’t change 
your data safety but will improve your write performance dramatically.

If your real workload is mainly sync writes, you better keep the syncing on but 
in that case, write performance will be lower. 

Note that If you intend to use MySQL INNODB, you might consider optimising 
writes ( innodb_flush_log_at_trx_commit ) which will give you more IOPS and 
limited loss risk.  

Cheers,

Michel


If you want to test sync writes, you’re better using 

> On 28 Apr 2015, at 16:52, Gavin Ang <[email protected]> wrote:
> 
> Hi,
>     Thanks for all the inputs on this issue. I have limited hardware options 
> cause I am running this on a blade server which only has those 4 slots for 
> disks. Am using this in production too, so having redundant disks means I 
> have very little manouvering room.
>  
>    Anyway, what I was trying to get at was the disparity between host and 
> guest io performance. Other posts like 
> http://serverfault.com/questions/425607/kvm-guest-io-is-much-slower-than-host-io-is-that-normal
>  
> <http://serverfault.com/questions/425607/kvm-guest-io-is-much-slower-than-host-io-is-that-normal>
>  point to qemu tuning of the disk caching mechanism. There are a lot more 
> tuning suggestions by IBM at 
> http://www-01.ibm.com/support/knowledgecenter/linuxonibm/liaat/liaatbpkvmguestcache.htm
>  
> <http://www-01.ibm.com/support/knowledgecenter/linuxonibm/liaat/liaatbpkvmguestcache.htm>
>   so I think there is more I can do before resorting to disk changes. Also, 
> there is a IBM benchmark presentation at a linux conference (can’t find it as 
> I write this) which suggests that the kvm overhead for io can be less than 
> 15% of bare metal performance.
>  
>    Seems like there is little documentation on how to tweak SmartOS 
> virtualization. I can see the place I would like to change in the smartvm 
> script, I just don’t know how to get it done because it seems like that 
> script is being generated when I issue the vmadm start $uuid command. 
>  
>    The guest machine I am trying to set up is for a database anyway, so would 
> be mostly sync writes, and looking at the literature out there, it just seems 
> that there must be a way to narrow the gap between the host and the guest 
> cause other OS can do it. I should be able to do it for smartOS too. Question 
> is HOW?
>  
> Rgds,
> Gavin
>  
> From: smartos-discuss [mailto:[email protected] 
> <mailto:[email protected]>] 
> Sent: Tuesday, 28 April, 2015 4:31 PM
> To: [email protected] <mailto:[email protected]>
> Subject: Digest for smartos-discuss
>  
>  
>  
>  <> <> 
> Re: [smartos-discuss] Disk IO optimization for Guest OS 
> <https://www.listbox.com/member/archive/184463/2015/04/20150428042222:AF48A096-ED7F-11E4-8929-BCC322AA7471>
> Sent by Michel Jansens <[email protected] 
> <mailto:[email protected]>> at Tue, 28 Apr 2015 10:25:55 +0200
> 
> Hi, Like Greg and Ian said, this slowdown is due to the lack of log device. 
> There are 2 kinds of writes: -async (asynchronous) writes calls gets buffered 
> and the write call returns without waiting for the actual write to disk to 
> complete. This is used to add performance for unimportant data (e.g.: log 
> files,..) that could be missing on a panic or powerloss. -sync (synchronous) 
> writes calls wait for the confirmation that data is on permanent storage 
> before returning. This is used especially in databases and filesystem 
> internal to ensure coherence of data. You could disable the sync writes with: 
> zfs set sync=disabled zones/<uuid>-disk0 This will speed your sync writes 
> quite dramatically. Downside is you could end up with corrupted data or 
> filesystem if the Host system goes down unexpectedly. You could limit damage 
> if you snapshot regularly. Snapshots are coherent, so if you rollback to the 
> latest snapshot you’re safe. I’ve done just this with some Windows 7 VMs 
> running stuff with non critical data. The speedup is quite dramatic for IO 
> bound workloads. Another way around this I think, is to use the recently 
> released LX brand zones where you run Linux natively in SmartOS (with 
> translated system calls). From the release notes, I think they implement 
> async writes. That being said, if you use a database with sync writes that is 
> important to you, you better invest in a pair of small and fast ssds (log 
> devices) to speed-up the sync writes. — Michel On KVM zones only does sync 
> writes. [ trailing quoted section removed ] 
> smartos-discuss | Archives 
> <https://www.listbox.com/member/archive/184463/=now>  
> <https://www.listbox.com/member/archive/rss/184463/27082038-11726f40>| Modify 
> <https://www.listbox.com/member/?&;> Your Subscription
>  <http://www.listbox.com/>
>  
> smartos-discuss | Archives 
> <https://www.listbox.com/member/archive/184463/=now>  
> <https://www.listbox.com/member/archive/rss/184463/23529323-02f95a03> | 
> Modify <https://www.listbox.com/member/?&;> Your Subscription  
> <http://www.listbox.com/>



-------------------------------------------
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com

Reply via email to