Improving the Performance of a VM by Using a Real Disk Partition

Please download to get full document.

View again

of 2
13 views
PDF
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Document Description
I have used zentyal as a gateway server, and it is actually running on a virtual machine. An important component of it is squid, which is supposed to improve the efficiency of the network connection by saving in cache the web pages that have been
Document Share
Document Tags
Document Transcript
  Improving the Performance of a VM by Using a Real Disk Partition I have used zentyal as a gateway server, and it is actually running on a virtual machine. Animportant component of it is squid, which is supposed to improve the efficiency of the network connection by saving in cache the web pages that have been already visited, and fetching themfrom the cache when they are re-visited.This is an operation that makes intesive usage of the disk, and virtual disks (used on virtualmachines) are not particularly efficient for it. However, a virtual machine can also use a real partition, so the efficience of squid can be improved by attaching a real partition to the virtualmachine and using it for the cache.The host where zentyal is installed is a CentOS system, and the disk partitions are managed byLVM. So, first of all we should create a new LVM partition to be attached to the virtualmachine: vgdisplaylvdisplaylvcreate vg_data -L 50G -n /dev/vg_data/lv_cache In LVM, Volume Groups (VG)  are the equivalents of disks , and Logical Volumes (LV)  arethe equivalents of partitions . In this case, we are creating a logical volume  withname /dev/vg_data/lv_cache , on the volume group  with name vg_data . The size of this LV partition is 50G , and this is enough for the squid cache.Then we add this partition to the configuration file of the virtualmachine /etc/libvirt/qemu/zentyal.xml : <devices> . . . . . <disk type='block' device='disk'> <driver name='qemu' type='raw' cache='none' io='native'/> <source dev='/dev/vg_data/lv_cache'/> <target dev='sdb' bus='ide'/> <address type='drive' controller='0' bus='0' unit='1'/> </disk> . . . . .</devices> Inside the virtual machine this disk will appear and will be accessed as /dev/sdb . Now we have to enable it, by reloading (re-defining) the configuration file: virsh define /etc/libvirt/qemu/zentyal.xmlvirsh shutdown zentyalvirsh start zentyal Inside the virtual machine (zentyal), we can access the new disk as /dev/sdb . First we have toformat and mount it, and then we can change the  squid  configuration to use it.Format the new partition with the reiserfs  format (which is a recommended formatfor the squid cache): Attach a Real Partition to the Virtual MachineUsing the New Disk Inside the Virtual Machine  mkfs.reiserfs -f /dev/sdb Append this line to /etc/fstab : /dev/sdb /var/spool/squid reiserfs defaults,notail,noatime Then stop squid and mount the new partition: service squid stoprm -rf /var/spool/squid/*mount -achown proxy:proxy /var/spool/squid/chmod 750 /var/spool/squid/squid -zservice squid start Edit /usr/share/zentyal/stubs/squid/squid.conf.mas  andchange this line: cache_dir ufs /var/spool/squid <% $cacheDirSize %> 16 256 to this one (by adding an a  option): cache_dir aufs /var/spool/squid <% $cacheDirSize %> 16 256 Then restart: service squid restart http://tecnologia.2020mobile.es/improving-zentyal-proxy-performance-squid-dansguardian/http://www.linux-faqs.com/squid.phphttp://sourcelinux.wikidot.com/setting-up-squid-in-gateway-as-a-transparent-proxyhttp://daddy-linux.blogspot.com/2012/03/configuring-squid-proxy-server.htmlhttp://en.kioskea.net/faq/804-ubuntu-installing-an-http-proxy-server-squidhttp://doc.zentyal.org/en/proxy.html Referencies:
Similar documents
View more...
Search Related
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks