﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-tommy-随笔分类-Unix</title><link>http://www.cppblog.com/tommy/category/18112.html</link><description>It's hard to tell the world we live in is either a reality or a dream</description><language>zh-cn</language><lastBuildDate>Fri, 11 Nov 2011 00:11:12 GMT</lastBuildDate><pubDate>Fri, 11 Nov 2011 00:11:12 GMT</pubDate><ttl>60</ttl><item><title>Ubuntu efficiency adjustment</title><link>http://www.cppblog.com/tommy/archive/2011/11/11/159944.html</link><dc:creator>Tommy Liang</dc:creator><author>Tommy Liang</author><pubDate>Thu, 10 Nov 2011 23:02:00 GMT</pubDate><guid>http://www.cppblog.com/tommy/archive/2011/11/11/159944.html</guid><wfw:comment>http://www.cppblog.com/tommy/comments/159944.html</wfw:comment><comments>http://www.cppblog.com/tommy/archive/2011/11/11/159944.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/tommy/comments/commentRss/159944.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/tommy/services/trackbacks/159944.html</trackback:ping><description><![CDATA[<div><p style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; color: #222222; font-family: tahoma, geneva, sans-serif; font-size: 10px; line-height: 14px; background-color: #ffffff; "></p><div><a href="http://www.phocean.net/2006/12/06/slow-performance-in-vmware-using-ubuntu.html">http://www.phocean.net/2006/12/06/slow-performance-in-vmware-using-ubuntu.html</a></div><span style="font-size: 14pt; "><br /><br />Hmm the output from the system monitor is weired, you can&#8217;t have a process not using memory at all (the virtual memory is huge but matches with the way you configured your VM).</span><p>&nbsp;</p><p style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; color: #222222; font-family: tahoma, geneva, sans-serif; font-size: 10px; line-height: 14px; background-color: #ffffff; "><span style="font-size: 14pt; ">I advise you to use &#8220;top&#8221; in a terminal, as root, to get some reliable info.</span></p><p style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; color: #222222; font-family: tahoma, geneva, sans-serif; font-size: 10px; line-height: 14px; background-color: #ffffff; "><span style="font-size: 14pt; ">Concerning your performance problem, you should not swap within the virtual machine with such an impressive of allocated memory.</span></p><p style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; color: #222222; font-family: tahoma, geneva, sans-serif; font-size: 10px; line-height: 14px; background-color: #ffffff; "><span style="font-size: 14pt; ">How much physical memory do you have ? Maybe, the problem is that your machine lacks of memory and makes your Ubuntu swapping&#8230;</span></p><p style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; color: #222222; font-family: tahoma, geneva, sans-serif; font-size: 10px; line-height: 14px; background-color: #ffffff; "><span style="font-size: 14pt; ">To boost performance, I use the following settings :</span></p><p style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; color: #222222; font-family: tahoma, geneva, sans-serif; font-size: 10px; line-height: 14px; background-color: #ffffff; "><span style="font-size: 14pt; ">(1) in the options of VMWare, I deactivate &#8220;taking snapshots in the background&#8221; and, in the memory section, I force all the virtual memory to fit in the available physical memory (no swap)</span></p><p style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; color: #222222; font-family: tahoma, geneva, sans-serif; font-size: 10px; line-height: 14px; background-color: #ffffff; "><span style="font-size: 14pt; ">(2) I also adjust the swappiness parameter of the linux kernel.</span></p><p style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; color: #222222; font-family: tahoma, geneva, sans-serif; font-size: 10px; line-height: 14px; background-color: #ffffff; "><span style="font-size: 14pt; ">By default, the linux kernel uses quite often the swap even if you still have plenty of free memory.</span></p><p style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; color: #222222; font-family: tahoma, geneva, sans-serif; font-size: 10px; line-height: 14px; background-color: #ffffff; "><span style="font-size: 14pt; ">You can change this behaviour with this command :</span><br /><span style="font-size: 14pt; ">echo &#8220;15&#8243; &gt; /proc/sys/vm/swappiness</span></p><p style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; color: #222222; font-family: tahoma, geneva, sans-serif; font-size: 10px; line-height: 14px; background-color: #ffffff; "><span style="font-size: 14pt; ">I use &#8220;15&#8243;, which gives a pretty high priority to the physical memory, before the kernel uses the swap. By default, the value is 60. The higher, the more it will use the swap.</span></p><p style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; color: #222222; font-family: tahoma, geneva, sans-serif; font-size: 10px; line-height: 14px; background-color: #ffffff; "><span style="font-size: 14pt; ">After testing, you can make it permanent by adding such a line at the end of /etc/sysctl.conf :</span></p><p style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; color: #222222; font-family: tahoma, geneva, sans-serif; font-size: 10px; line-height: 14px; background-color: #ffffff; "><span style="font-size: 14pt; ">vm.swappiness = 15</span></p><p style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; color: #222222; font-family: tahoma, geneva, sans-serif; font-size: 10px; line-height: 14px; background-color: #ffffff; "><span style="font-size: 14pt; ">(3) I would, anyway, just try to reduce the memory amount you allocate to you VM. Just in case.</span></p><p style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; color: #222222; font-family: tahoma, geneva, sans-serif; font-size: 10px; line-height: 14px; background-color: #ffffff; "><span style="font-size: 14pt; ">(4) Also check the processes runing on your XP when it is slow ! Are you sure that your Windows image did not get infected by some trojan or virus ?</span></p><p style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; color: #222222; font-family: tahoma, geneva, sans-serif; font-size: 10px; line-height: 14px; background-color: #ffffff; "><span style="font-size: 14pt; ">(5) For graphics, did you set up VMWare tools ?</span></p></div><img src ="http://www.cppblog.com/tommy/aggbug/159944.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/tommy/" target="_blank">Tommy Liang</a> 2011-11-11 07:02 <a href="http://www.cppblog.com/tommy/archive/2011/11/11/159944.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>