`
love~ruby+rails
  • 浏览: 849408 次
  • 性别: Icon_minigender_1
  • 来自: lanzhou
社区版块
存档分类
最新评论

Make Linux faster and lighter<3>

阅读更多

Boost your network

You've tweaked your router, optimised your server and replaced all your broadband filters in your house - and you still have a slow connection. Before you make an angry phone call to your ISP, there's a possibility that the client machine may be the bottleneck. With just a few of these tweaks you can improve your connections, or at the very least eliminate your client machine as the single point of failure.

Use hostname 'localhost'

This doesn't cause a drastic improvement on its own, but in conjunction with the other network tricks here can improve your local machine's network performance. Simply open /etc/hosts in a text editor with root permissions and change the top two lines to:

127.0.0.1 localhost yourhost
127.0.1.1 yourhost

where yourhost is the name of the machine (ie bobdesktop). Ensure you keep a backup of your /etc/hosts file, as not all distros are compatible with this!

Optimise TCP settings

Distros come preconfigured for "average" internet users, but in a world of 3G, dial-up and ADSL there is no such thing as an average user. Now edit /etc/sysctl.conf as root and append the following:

net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_sack = 1

(This may take some trial and error, so keep a backup of the files you edit.) The top line removes timestamps and so relieves all incoming and outgoing packets of a 12k overhead. The bottom line enables selective acknowledgements, which means fewer checks are initiated on each packet so they are delivered quicker. We don't recommend the latter tweak for dial-up connections as this increases the number of packets which need to be resent.

Metrics and backlogs

You can further optimise your TCP settings by appending the following lines to the same text file:

net.ipv4.tcp_no_metrics_save = 1
net.core.netdev_max_backlog = 2500

The top line speeds up connections by ensuring that TCP metrics are not saved for each individual packet. The second line dictates the backlog of packets allowed. To give an idea of the scale of the figure you should use for your backlog, around 2,000 is recommended for wireless or older Ethernet connections, and around 5,000 for a 1GB Ethernet cable to broadband connection. On the other hand, this figure can rise up to 30,000 for an expensive 10GB Ethernet cable. The slower the connection, the lower your backlog should be, as the aim of this tweak is to clear outstanding packets as soon as possible in order to boost connection speeds.

TCP window scaling

The TCP window settings define the minimum and maximum size of packets we can send and recieve. Dial-up users will see a speed boost with smaller packet sizes while broadband users will see a speed boost with larger packet sizes. Edit /etc/sysctl.conf as root, and append this:

net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_wmem = 10240 87380 16777216
net.ipv4.tcp_rmem = 10240 87380 16777216
net.ipv4.tcp_mem = 16777216 16777216 16777216
net.core.rmem_max = 16777216
net.core wmem_max = 16777216

Those figures are optimised for a 2Mbps connection on Sky broadband over a wireless connection, but the packet size recommendation for any given connection is usually maximum bandwidth divided by latency. You can find these figures by heading to www.speedtest.net , and you can also analyse how your changes are affecting your connection via www.speedguide.net:8080 .

www.speedguide.net can give you an indication of which values and tweaks will improve your network connection.

www.speedguide.net can give you an indication of which values and tweaks will improve your network connection.

 

Faster Firefox

Continuing with the networking theme, you can optimise much more than just your TCP settings. Mozilla Firefox has a raft of options cunningly hidden from users that can untap the browser's potential...

Disable IPv6 (again!)

With this tweak we will simply amend an existing value. Type the following into the search bar: network.dns.disableIPv6

You shouldn't have to type out the whole thing, as the listings change dynamically as you're typing. Simply double-click on the entry to change the default value of "False" to "True".

Render pages faster

Create a new integer value in about:config named content.notify.backoffcount and set the value to 5 so that Firefox won't wait for the entire page to download before rendering. You can also create a value with the name nglayout.initialpaint.delay and set the value to zero . This ensures that Firefox doesn't wait for the page layout information to be fully downloaded before rendering.

Optimise your history

If you reduce the amount of web history that Firefox stores, it will load faster and also save you some disk space. Type the following in the search bar: browser.history and change browser.history_expires_days and browser.history_expires_min to zero . You can also use low numbers if you want to keep some browser history.

More TCP tweaks

Change the network.http.pipelining and network.http.proxy.pipelining values to "True" and then set network.http.pipelining.maxrequests to 8 instead of 4 . These tweaks boost performance for broadband users as we use a TCP technique known as pipelining, which allows Firefox to make multiple requests on a single connection.

Any mistakes here could break Firefox, so once you've made a backup and a vow of honour you can unleash the power hidden in your browser.

Any mistakes here could break Firefox, so once you've made a backup and a vow of honour you can unleash the power hidden in your browser.

Speed up menus

Start by typing about:config and accepting the warning that comes up (you will need to do this for all these Firefox tips). The listing you see is much like the Firefox equivalent of the Windows registry, which means that though this is a very powerful way to tweak your browser you can cause serious stability problems if you get it wrong.

We can make our Firefox menus load faster by adding our own value to the listing. Right-click anywhere in the listing and then click New > Integer . Use ui.submenuDelay as the name and then set the value to zero . When you restart Firefox you should notice that your menus load noticeably faster, as you have removed the delay for the menu popups.

Voice of the Guru #3

Paul Frields - Fedora project leader

"Here's something I can’t live without: combining the Mutt mail reader with offlineimap. The offlineimap utility synchronises my remote IMAP stores on to my local hard disk, which means my email reading is faster by several orders of magnitude. I can sync my email before I pack for travel, and then while in transit, or waiting at an appointment, I can read email as quick as a flash because it's all stored locally. Mutt makes my mail processing chores incredibly efficient, so I can effectively deal with the thousands of email messages I get every week. When I get back online and run offlineimap again, all the flags are synchronised again and my remote IMAP stores record what I've read."

分享到:
评论

相关推荐

    VB编程资源大全(英文控件)

    &lt;END&gt;&lt;br&gt;28,ColorProgressBar.zip&lt;br&gt;Replaces the standard progress bar with one that is on the order of O(n^2) times faster, with color options, and directional options.&lt;END&gt;&lt;br&gt;29,MDITaskBarDemo.zip...

    Visual C++ 编程资源大全(英文源码 表单)

    1,01.zip&lt;br&gt;MFC Extension Library&lt;br&gt;MFC扩展界面库, 使用Visual C++ 6.0(15KB)&lt;END&gt;&lt;br&gt;2,02.zip&lt;br&gt;Visual Studio style UI&lt;br&gt;Visual Studio风格的界面效果(15KB)&lt;END&gt;&lt;br&gt;3,03.zip&lt;br&gt;Internet Explorer 4 ...

    DIBSection Class VB

    &lt;br&gt;&lt;br&gt; m_hDC = CreateCompatibleDC(0) &lt;br&gt; If (m_hDC &lt;&gt; 0) Then &lt;br&gt; If (CreateDIB(m_hDC, lWidth, lHeight, m_hDIb)) Then &lt;br&gt; m_hBmpOld = SelectObject(m_hDC, m_hDIb) &lt;br&gt; Create = True &lt;br&gt; Else &lt;br...

    Using DIB Sections in VB

    &lt;br&gt;&lt;br&gt; m_hDC = CreateCompatibleDC(0) &lt;br&gt; If (m_hDC &lt;&gt; 0) Then &lt;br&gt; If (CreateDIB(m_hDC, lWidth, lHeight, m_hDIb)) Then &lt;br&gt; m_hBmpOld = SelectObject(m_hDC, m_hDIb) &lt;br&gt; Create = True &lt;br&gt; Else &lt;br...

    VB编程资源大全(英文源码 控件)

    YOu can change the ToopTip and images in RunTime, this will make it easy to make a flashing icon to get the users attention.&lt;END&gt;&lt;br&gt;15 , ExcellOS.zip&lt;br&gt;This is a fake Operating System &lt;END&gt;&lt;br&gt;16 ,...

    VB编程资源大全(英文源码 数据库)

    The sample creates a new database file and allows you to view, add, or delete records in this database."&lt;END&gt;&lt;br&gt;2 , dbprint.zip&lt;br&gt;This demonstrates how to print data from a database.&lt;END&gt;&lt;br&gt;3 , ...

    SQLite

    Its functionality lies between MySQL and PostgreSQL, however it is faster than both databases.&lt;br&gt;&lt;br&gt;In SQLite, author Chris Newman provides a thorough, practical guide to using, administering and ...

    狗目标检测数据集VOC-xml格式100张.zip

    &lt;depth&gt;3&lt;/depth&gt; &lt;/size&gt; &lt;object&gt; &lt;name&gt;dog&lt;/name&gt; &lt;pose&gt;Unspecified&lt;/pose&gt; &lt;truncated&gt;0&lt;/truncated&gt; &lt;difficult&gt;0&lt;/difficult&gt; &lt;bndbox&gt; &lt;xmin&gt;100&lt;/xmin&gt; &lt;ymin&gt;50&lt;/ymin&gt; &lt;xmax&gt;300&lt;/xmax&gt; ...

    目标检测数据集:遥感卫星图像检测(xml标注)

    其中,`&lt;filename&gt;`指定了图像文件名,`&lt;size&gt;`包含了图像的宽、高和通道数,`&lt;object&gt;`标签下的`&lt;name&gt;`表示目标类别,`&lt;bndbox&gt;`则给出了目标的边界框坐标(`&lt;xmin&gt;`, `&lt;ymin&gt;`, `&lt;xmax&gt;`, `&lt;ymax&gt;`),描述了目标...

    VOC硬币数据集xml格式

    &lt;depth&gt;图像通道数(通常是3,RGB)&lt;/depth&gt; &lt;/size&gt; &lt;segmented&gt;0&lt;/segmented&gt; &lt;object&gt; &lt;name&gt;硬币类型(如一元、五角、一角)&lt;/name&gt; &lt;pose&gt;Unspecified&lt;/pose&gt; &lt;truncated&gt;0或1(是否被截断)&lt;/truncated...

    cuteEditor6.0

    You can also create your own policy files that define arbitrary permission sets.&lt;br/&gt;&lt;br/&gt;Comparison of the sample security policy file &lt;br/&gt;&lt;br/&gt; &lt;br/&gt;Permissions/Resource Setting Admin Default ...

    图片打标签程序windows_v1.3.0.zip

    &lt;depth&gt;3&lt;/depth&gt; &lt;/size&gt; &lt;object&gt; &lt;name&gt;car&lt;/name&gt; &lt;bndbox&gt; &lt;xmin&gt;100&lt;/xmin&gt; &lt;ymin&gt;50&lt;/ymin&gt; &lt;xmax&gt;300&lt;/xmax&gt; &lt;ymax&gt;250&lt;/ymax&gt; &lt;/bndbox&gt; &lt;/object&gt; &lt;/annotation&gt; ``` 在上述例子中,`&lt;name&gt;`...

    LabelImg图像标记.rar

    &lt;depth&gt;3&lt;/depth&gt; &lt;/size&gt; &lt;object&gt; &lt;name&gt;class1&lt;/name&gt; &lt;pose&gt;Unspecified&lt;/pose&gt; &lt;truncated&gt;0&lt;/truncated&gt; &lt;difficult&gt;0&lt;/difficult&gt; &lt;bndbox&gt; &lt;xmin&gt;100&lt;/xmin&gt; &lt;ymin&gt;50&lt;/ymin&gt; &lt;xmax&gt;200&lt;/xmax&gt; ...

    目标检测标注工具labelImg

    &lt;depth&gt;3&lt;/depth&gt; &lt;/size&gt; &lt;segmented&gt;0&lt;/segmented&gt; &lt;object&gt; &lt;name&gt;car&lt;/name&gt; &lt;pose&gt;Unspecified&lt;/pose&gt; &lt;truncated&gt;0&lt;/truncated&gt; &lt;difficult&gt;0&lt;/difficult&gt; &lt;bndbox&gt; &lt;xmin&gt;100&lt;/xmin&gt; &lt;ymin&gt;50&lt;/...

    DevExpress CodeRush 3.0.5 with Refactor! Pro (2/3)

    * Clipboard Tools - The clipboard as your trusty sidekick because a smart clipboard is a whole lot better than a simple one.&lt;br&gt; * Navigation Tools - Move through source code faster because fishing ...

    DevExpress CodeRush 3.0.5 with Refactor! Pro (1/3)

    * Clipboard Tools - The clipboard as your trusty sidekick because a smart clipboard is a whole lot better than a simple one.&lt;br&gt; * Navigation Tools - Move through source code faster because fishing ...

    基于pytorch框架的Faster-RCNN模型python源码+项目说明+数据集.zip

    1、写入训练的txt文件 &lt;br&gt; &ensp;&ensp; 修改configs包下面的config文件中三个属性 &ensp;&ensp; 然后根据自己的数据集的标注文件是怎么个形式选择执行data包下面process_data.py文件中的两个方法。 &lt;br&gt; &ensp;&...

    行人跌倒数据集 跌倒检测_fall.rar

    经典的模型如YOLO(You Only Look Once)、SSD(Single Shot Multibox Detector)或Faster R-CNN等都可以被用于目标检测任务,通过网络学习来识别和定位跌倒事件。同时,考虑到跌倒检测的动态特性,也可以考虑使用...

    HTML5小蝌蚪组成心形动画特效.zip

    &lt;label for="friction"&gt;friction &lt;span&gt;(f&gt;1: faster, faster! f&lt;1: slow....)&lt;/span&gt;&lt;/label&gt;&lt;br /&gt; &lt;input id="friction" value=".9" min="0.5" step="0.05" ...

Global site tag (gtag.js) - Google Analytics