Posts

Showing posts from March, 2010

The power of Intel Quad core * 2 + FreeBSD 8 amd64

Image
因工作上的需求,我必須處理 Subversion 因為 svn blame 造成的高系統負載問題。 作業環境如下: FreeBSD 7.2 Apache 2.x Subversion 1.x viewvc 1.x 在原來的硬體環境: CPU: Intel Xeon 3.06 GHz with HT RAM: 2GB HDD: SCSI FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs cpu0 (BSP): APIC ID: 0 cpu1 (AP/HT): APIC ID: 1 cpu2 (AP): APIC ID: 6 cpu3 (AP/HT): APIC ID: 7 一旦使用者透過 viewvc 執行 annotate 的工作,只要一個! 且單一檔案內容超過萬行的情況下,就會造成系統高負載 (average load 破百) 的情況,最嚴重的狀況是連 console 操作都會 hang 住! 而且 httpd 和 svn 的 process 數量也 fork 很多出來! 深究其因,應該是 viewvc 造成的! 其次,CPU 僅是透過 HT 虛擬成 4 個 cpu,而並非真正 multiple core,因此運算能力也相對較弱! 以提供服務的角度來看,這個功能是使用者經常用到的! 因此,除了去 trace viewvc 外,唯一可解的就是硬體升級了! 新的硬體環境: CPU: Intel Xeon E5420 2.5 GHz RAM: 48 GB HDD: SAS FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs FreeBSD/SMP: 2 package(s) x 4 core(s) cpu0 (BSP): APIC ID: 0 cpu1 (AP): APIC ID: 1 cpu2 (AP): APIC ID: 2 cpu3 (AP): APIC ID: 3 cpu4 (AP): APIC ID: 4 cpu5 (AP): APIC ID: 5 cpu6 (AP): APIC ID: 6 cpu7 (AP): APIC ID: 7 OS 改用 FreeBSD 8 amd64 的版本,將 /tmp 透過 md 掛載大小為 18G

Indexers in C# and VB.net

What are Indexers? Indexers allow instances of a class or struct to be indexed just like arrays. Indexers resemble properties except that their accessors take parameters. A class can have only one Indexer In VB.net, default keyword is required to make it indexer Index can be accessed either by a numeric index or even string How to Use (C#)? using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace CSconsole { class NamesList { public int Length { get { return objList.Count; } } List < String > objList = new List < string >(); public string this [ int index] { get { return objList[index]; } set { objList.Add ( value ); } } } public class TestIndexers { public static void Main () {

Convert nrg file to iso

There are 2 options on Debian/Linux: nrg2iso iat I tried nrg2iso at first, it told me the nrg file is already in ISO9660 format and did not covert. And I tried iat then that. It works fine! $ iat image.nrg image.iso Iso9660 Analyzer Tool v0.1.3 by Salvatore Santagati Licensed under GPL v2 or later Detect Signature ISO9660 START at 32768 Detect Signature ISO9660 END at 36864 Image offset start at 0 Sector header 0 bit Sector ECC 0 bit Block 2048 Done The outputed iso can be used with no wrong.