LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 03-25-2012, 05:46 AM   #1
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS 6, CentOS 7
Posts: 299

Rep: Reputation: Disabled
Turn off caching on entire partition


Is it possible to turn off caching for the whole partition which stores the virtual machines?

I know it can be done individually for each VM but considering that all virtualized operating systems will always be doing their own caching it seems more correct to turn it off for the whole partition which stores all of my VMs.

Nick
 
Old 03-25-2012, 06:36 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
You could use sync on the file system mount options but there may be significant performance penalties (would have to test). If the data the VMs are writing is critical it might be worth investigating whether they can use raw partitions instead of files on the host.
 
Old 03-26-2012, 04:52 AM   #3
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS 6, CentOS 7
Posts: 299

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by catkin View Post
You could use sync on the file system mount options but there may be significant performance penalties (would have to test). If the data the VMs are writing is critical it might be worth investigating whether they can use raw partitions instead of files on the host.
Thanks catkin, I will try the 'sync' mount option, see how that performs. It is not so much that the data is critical but that I want to prevent double caching, all of the host VMs will be doing their own caching anyway just don't want to double up with caching on top of caching and the problems that entails.

Cheers,
 
Old 03-26-2012, 06:03 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by Nick_C View Post
don't want to double up with caching on top of caching and the problems that entails.
What problems are those?
 
Old 03-26-2012, 06:10 AM   #5
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS 6, CentOS 7
Posts: 299

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by catkin View Post
What problems are those?
Speed; double caching is very slow turning off caching on the VMs allows them to run much faster.
 
Old 03-26-2012, 07:00 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by Nick_C View Post
Speed; double caching is very slow turning off caching on the VMs allows them to run much faster.
Thanks Nick

I am surprised. Normally caching is faster because the data is written less often (and in larger chunks, but that has a small effect on the time taken), hence caching vs. not caching is usually a choice between performance and data security. Do you have any test results to demonstrate the scale of the problem?
 
Old 03-27-2012, 04:32 PM   #7
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by Nick_C View Post
Speed; double caching is very slow turning off caching on the VMs allows them to run much faster.
why?
 
Old 03-28-2012, 06:32 AM   #8
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS 6, CentOS 7
Posts: 299

Original Poster
Rep: Reputation: Disabled
Why I don't know. Just that I have found Win 7 VMs install much quicker with individual machine caching set to none rather than default. Now instead of having to do this for each VM I thought that because I have all VMs in the same partition perhaps I could turn off caching for all of them by using this mount option.
 
Old 03-28-2012, 06:57 AM   #9
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS 6, CentOS 7
Posts: 299

Original Poster
Rep: Reputation: Disabled
How can I see what mount options are currently in use and then how can I add that sync mount option to the mounting of my /vm partition?
 
Old 03-28-2012, 08:19 AM   #10
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by Nick_C View Post
Why I don't know. Just that I have found Win 7 VMs install much quicker with individual machine caching set to none rather than default. Now instead of having to do this for each VM I thought that because I have all VMs in the same partition perhaps I could turn off caching for all of them by using this mount option.
which caching option is this? where do you install the VM from? you cannot post such claims without investigating the underlying root cause, that's all I'm saying, and your conclusions are pretty far fetched

---------- Post added 03-28-12 at 01:20 PM ----------

Quote:
Originally Posted by Nick_C View Post
How can I see what mount options are currently in use
Code:
mount

Quote:
and then how can I add that sync mount option to the mounting of my /vm partition?
edit your fstab, and add the option after "defaults"
 
Old 03-28-2012, 11:18 AM   #11
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS 6, CentOS 7
Posts: 299

Original Poster
Rep: Reputation: Disabled
Thanks dyasny, when I get all the other problems resolved I will do some proper speed tests to prove/disprove my caching theory.

It all relates to some speed tests I did here: http://www.linuxquestions.org/questi...-tests-933047/
 
Old 03-29-2012, 05:13 AM   #12
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by Nick_C View Post
Thanks dyasny, when I get all the other problems resolved I will do some proper speed tests to prove/disprove my caching theory.

It all relates to some speed tests I did here: http://www.linuxquestions.org/questi...-tests-933047/
would be great to find out, at the lowest possible level, what is causing this. I don't think double caching as such is the culprit, but maybe in the way qemu implements it's caching, some extra overhead gets introduced - this needs to be proven of course.
In addition, you might be running buggy builds that do weird things, seen plenty of that before
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
backup entire partition strycnine Linux - General 2 01-26-2010 01:09 AM
Caching entire youtube Net_Spy Linux - Networking 3 02-22-2008 03:49 AM
Turn off image thumbnail caching on KDE 3.5.2?? JamesNorris Linux - Software 2 04-03-2006 10:57 AM
What is best way to ghost an entire partition onmountain Linux - General 8 10-29-2005 11:47 AM
Delete an entire partition john8675309 Linux - Software 1 02-02-2005 08:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 09:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration