2009年10月21日 星期三

cachefilesd


由debian的說明,來看
FSCache is a generic caching manager in the Linux kernel which can be used by network and other filesystems to cache data locally. 
FSCache是linux kernel中一個通用的cache管理者,用於管理網路和其他檔案系統的cache。 

CacheFiles is an FSCache backend that's meant to use as a cache a directory on an already mounted filesystem of a local type (such as Ext3). This package installs the userspace support required by the cachefiles backend. 
在ubuntu中即便安裝了cachefilesd,nfs還是無法使用cache機制,所以要重先編譯一下kernel module。將CONFIG_NFS_FSCACHE=y才能讓nfs支援cachefilesd。
而cache所在的partition必須是ext3或ext4並支援user_xattr屬性:
 tune2fs -o user_xattr /dev/sdaX
 sudo mount /var/cache/fscache

接著將修改/etc/cachefilesd.conf(或者使用預設值)。
當要mount nfs時,必須-o fsc告訴kernel這個nfs要使用cache機制。
 sudo mount -o fsc 10.0.100.11:/opt /opt

心得: 由於常用的是compile程式,大量的小檔讀寫,使用cache並沒有帶來好處。



2009年10月19日 星期一

quota無法正常在ubuntu 9.04上的ext4運作


這是ubuntu 9.04上package的bug,下載9.10的套件裝就好啦,here
brook@ubuntu1:~$ wget http://kr.archive.ubuntu.com/ubuntu/pool/main/q/quota/quota_3.17-3ubuntu1_i386.deb
--2009-10-19 16:09:14--  http://kr.archive.ubuntu.com/ubuntu/pool/main/q/quota/quota_3.17-3ubuntu1_i386.deb
Resolving kr.archive.ubuntu.com... 143.248.234.110
Connecting to kr.archive.ubuntu.com|143.248.234.110|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 473516 (462K) [application/x-debian-package]
Saving to: `quota_3.17-3ubuntu1_i386.deb'

100%[======================================>] 473,516      490K/s   in 0.9s

2009-10-19 16:09:17 (490 KB/s) - `quota_3.17-3ubuntu1_i386.deb' saved [473516/473516]

brook@ubuntu1:~$ sudo dpkg --purge quota
(Reading database ... 112680 files and directories currently installed.)
Removing quota ...
 * Turning off quotas...                                                 [ OK ]
 * Stopping quota service rpc.rquotad                                    [ OK ]
Purging configuration files for quota ...
Processing triggers for man-db ...
brook@ubuntu1:~$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
brook@ubuntu1:~$ sudo dpkg -i quota_3.17-3ubuntu1_i386.deb
Selecting previously deselected package quota.
(Reading database ... 112624 files and directories currently installed.)
Unpacking quota (from quota_3.17-3ubuntu1_i386.deb) ...
Setting up quota (3.17-3ubuntu1) ...
 * Checking quotas...
                                                                         [ OK ]
 * Turning on quotas...                                                  [ OK ]
 * Starting quota service rpc.rquotad                                    [ OK ]

Processing triggers for man-db ...
brook@ubuntu1:~$ sudo mount -o remount /home
[sudo] password for brook:

2009年10月18日 星期日

32位元的compiler在32bit與64bit ubuntu下效能比較


繼之前的效能比較後(64bit與32bit應用程式在64位元ubuntu下之效能比較),我們面對比較實際的問題,因為開發用的compiler為32-bit之montavista,那麼到底是32位元的ubuntu效能好還是64位元的ubuntu好,所以我們決定直接將專案分別在32bit和64bit的ubuntu下compiler 10次,最後,發現在32bit底下有較好的效能。

圖為montavista 32bit compiler分別在32bit與64bit ubuntu下,compile專案所需的時間,以及所設定的make之job數比較圖,很明顯的,當job數越多,效能越好,而且32bit效能一直好過64bit。
JOBS 64-bit(sec) 32-bit(sec)
default(4) 479.567 451.847
6 426.922 400.545
8 400.724 370.174
10 393.842 363.798
12 391.594 361.957

這邊的結論不是想說32bit或是64bit的ubuntu哪個好,而是得到在我們的編譯環境下,32bit的ubuntu是比較適合我們的

熱門文章