跳到主要內容

發表文章

目前顯示的是 2009的文章

MySQL INSERT 修飾詞

<br />INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]<br /> [INTO] tbl_name [(col_name,...)]<br /> {VALUES | VALUE} ({expr | DEFAULT},...),(...),...<br /> [ ON DUPLICATE KEY UPDATE<br /> col_name=expr<br /> [, col_name=expr] ... ]<br /> DELAYED 由MySQL所添加的專屬指令,Client在送出Insert命令後,若此時MySQL無法執行此命令,則會將此命令放入INSERT-Buffer內等候可用時間再將資料寫入table,Client無須等候MySQL完成此命令便可繼續處理後續工作執行 缺點 INSERT DELAYED指令即使在Table處於可用狀態下的執行效能仍低於標準INSERT指令,INSERT DELAYED對於MySQL會有額外的系統負擔,因為每一個用於INSERT DELAYED的TABLE必須要有一個個別的Thread處理這些被Delayed-Rows的insert工作 風險: 因為Insert Delayed是採用memory-buffer方式儲存Delayed Rows,若是不當使用kill command或是系統當機,將可能造成資料遺失 支援引擎: MyISAM / Memory / Archive Tables LOW_PRIORITY 採用此修飾詞的insert會等候資料table在無任何client存取的情況下才會執行此insert動作, (I/O量大的Tables 有可能造成 Long-Time Waiting狀態產生) 支援引擎: MyISAM / Memory / Archive Tables

MySQL -- Truncate Table

通常清除Table內的所有資料採用 Delete SQL命令的做法並不好,除了效率不好之外另外也可能造成過度使用系統資源,因此DBCS都會提供快速刪除資料的方式 MySQL在5.03版之前,InnoDB Truncate採用 Row by Row方式刪除每一筆資料 5.0.3之後除非Table本身有Foreign Key參考到本table是採用Row by Row方式刪除資料 若無Foerign Key的話則採用 Fast-Truncate方式( Drop & Re-create )重建新 Table 並且會 Reset AUTO_INCREMENT 計數器 而在5.0.13版本之後無論是否採用 Fast-Truncat都會重置 AUTO_INCREMENT 計數器 ** Trigger注意事項 Truncate 若不採用Delete SQL Command 因此並不呼叫任何 ON DELETE Trigger

NLB Parameters: miimon

MIIMON stands for media-independent interface monitoring its value is set in milli seconds which defines how often mii link monitoring occurs then it will checks if NICs is active or not To check if NIC drivers supports MII, please use the following commands: # ethtool eth0 |grep "Link detected" Link detected: yes

MySQL Virtualization Performance Issues

Often the biggest consideration is the performance of a virtualized environment once hosted. In most cases, the virtualized environment involves some level of emulation of one or more of the hardware interfaces (CPU, network or disk) of the host environment. The effect is to reduce the effective performance of the virtualized environment compared to running an application natively on the host. Some core resourcing issues to be aware of include: •Using virtualization does not reduce the amount of CPU required to support a particular application or environment. If your application stack requires 2GB of RAM on an individual machine, the same RAM requirement will apply within your virtualized environment. The additional overhead of the virtualization layer and host operating system or environment often mean that you will need 2.5GB or 3GB of RAM to run the same application within the virtualized environment. You should configure your virtualization environment with the correct RAM allocati

MySQL HA 建議

MySQL 的High Availability 設計參考資訊 Requirements MySQL Replication MySQL Replication + Heartbeat MySQL Heartbeat + DRBD MySQL Cluster MySQL + memcached Availability Automated IP failover No Yes Yes No No Automated database Failover No No Yes Yes No Typical failover time User/script-dependent Varies < 30 seconds < 3 seconds App dependent Automatic resynchronization of data No No Yes Yes No Geographic redundancy support Yes Yes Yes, when combined with MySQL Replication Yes, when combined with MySQL Replication No Scalability Built-in load balancing No No No Yes Yes Supports Read-intensive applications Yes Yes Yes, when combined with MySQL Replication Yes Yes Supports Write-intensive applications No No Yes Yes No Maximum number of nodes per group One master, multiple slaves One master, multiple slaves One active (primary), one passive (secondary) node 255 Unlimited Maximum number of slaves Unlimited (reads only) Unlimited (reads only) One (failover only) Unlimited (reads only) Unlimite

MySQL 5.4發展

MySQL 5.4主要是以 5.1版的核心為主要架構,再針對特殊應用加以修改或是補強功能設定 以下是我個人比較關注的部分 架構調整與改進 5.4最主要是針對多核心系統加以改進,以往要增進MYSQL的執行速度都過於仰賴 CPU Clock Speed 提升效能,現今的主機都以 Multi-Core 為主要架構,因此5.4版便是針對Multicore架構做調整,增進 mySQL的執行效能,使mySQL可以充分利用SMP系統 增進的部分主要針對 InnoDB 的locking,記憶體管理與執行緒同步管理問題 的增進 後續會將 5.4使用心得更新到本部落格

Window CE BootLoader for x86 ( MS-DOS )

CEPC X86採用了幾種開機方式,其中一種運用MS-DOS當成Booting OS 利用 Windows CE Platform builder所提供的 Image disk 製作一片 1.44M的開機片,內有提供 LoadCepc.exe命令作為 CE Boot Loader 不過首先得先將磁片的開機檔案移植到嵌入式設備的CF / FLASH / DISK 上 以下提供傳統的MS-DOS開機系統製作方式供學員參考 : 使用MS-DOS開機片開機後, 透過 Fdisk.exe與 Format.com 工具製作 Windows CE Boot Loader 過程如下 圖一: MS-DOS開機 圖2: 開機後,載入 Fdisk執行 Partition切割工作 圖3: 選擇第一項,建立 Partition 圖4: 選擇第一項,建立 DOS Partition 圖5: 詢問是否全部切割成單一PARTITION,若CF過大可回答 N 自行切割大小 圖6: 輸入欲切割的Partition大小 圖7:切割後,按一下鍵盤的 esc鍵回到檢視畫面,就可看到所切割的Partition大小 圖8: esc回到主選單後,在選擇 [2] 設定啟動磁區 圖9: 選擇欲啟動作業系統的Partition 圖10: 選擇後應該會看到 Partition清單上的 Status欄位出現 A 字元 圖11: 切割後 重新啟動系統 圖12: 格式化所切割的新磁區 圖13: 格式化完成後 便可將 Platform Builder所製作的 Windows CE Bootloader磁片內容複製到C:內 重新開機後,進入c:> 輸入 C:>Loadcepc /L:800x600x16 nk.bin 便可載入nk.bin到記憶體 並且以800x600的解析度執行 windows ce 作業系統

NLB Operation Mode / Modes of Bonding

mode=1 (active-backup) Active-backup policy: Only one slave in the bond is active. A different slave becomes active if, and only if, the active slave fails. The bond's MAC address is externally visible on only one port (network adapter) to avoid confusing the switch. This mode provides fault tolerance. The primary option affects the behavior of this mode. mode=2 (balance-xor) XOR policy: Transmit based on [(source MAC address XOR'd with destination MAC address) modulo slave count]. This selects the same slave for each destination MAC address. This mode provides load balancing and fault tolerance. mode=3 (broadcast) Broadcast policy: transmits everything on all slave interfaces. This mode provides fault tolerance. mode=4 (802.3ad) IEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the same speed and duplex settings. Utilizes all slaves in the active aggregator according to the 802.3ad specification. Prerequisites: Ethtool support in the base drivers fo

NLB in CentOS

設定CentOS NLB 備忘錄 1.增加虛擬網卡 編輯 /etc/modeprobe.conf 增加下列設定 以 mode 5 為例 Mode 模式參考文章 alias bond0 bonding options bond0 miimon=80 mode=5 2.設定虛擬網卡啟動資訊 建立 /etc/sysconfig/network-scripts/ifcfg-bond0 DEVICE=bond0 IPADDR=192.168.1.100 NETMASK=255.255.255.0 NETWORK=192.168.1.0 BROADCAST=192.168.1.255 GATEWAY=192.168.1.1 ONBOOT=yes BOOTPROTO=none USERCTL=no 3.設定實體網卡啟動資訊 /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 ONBOOT=yes BOOTPROTO=none USERCTL=no MASTER=bond0 SLAVE=yes /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 ONBOOT=yes BOOTPROTO=none USERCTL=no MASTER=bond0 SLAVE=yes

Windows System Programming

Windows System Programming 開發系統程式必學知識

Windows Driver 開發系列

Developing Drivers with the Windows Driver Foundation

書籍推薦: Windows Via C/C++

書籍推薦: Windows Via C/C++ Target Audience: Driver Developer , WIndows Developer Chapter List: ===========================================

Automatic Building Process: 建置 Windows CE 6.0 Images

對於常常需要改變各種 Windows CE Image設定並且需要重新編譯Image的人來說,透過Visual Studio的GUI操作介面來說變成是一種負擔,互動式介面造成必須等候每一步驟的完成後才能繼續進行下一步 因此自動化編譯的需求便是這種情形下最適當不過的一種操作方式 自動化編譯是透過命令模式(command Prompt)來完成,但是命令模式並非一般的Command Prompt,必須要 事先將所有的Windows CE Environment Variables 設定完成後才能進行編譯,因此可以透過下列方式將編譯所需的環境變數轉換成一個批次檔後便可以進行自動化編譯的任務 1.使用 PBXMLUtils.exe 將Windows CE環境變數提取轉存 批次設定檔 首先,先在Visual Studio 2005工具內開啟Windows CE外掛的build選單下的Open Build Release Windows 在此命令模式下執行: c:>"c:\program files\Microsoft Platform Builder\6.00\cepb\IdeVS\Pbxmlutils.exe" /getbuildenv > SetupCEEvn.bat 便可將 Windows CE Building Command Prompt內的環境變數轉存到 SetupCEEnv.bat 批次檔內 2. 測試自動化編譯程序 首先,開啟一般的Windows Command Prompt命令模式,並執行 SetupCEEnv.bat批次檔後,再使用 set命令檢視Win CE Building Environment Variables是否設定成功 接下來便可以使用 blddemo -q 測試編譯 Windows CE 6.0 Image了

書籍推薦: 笛卡兒 拜拜

書籍推薦: 笛卡兒 拜拜 適合閱讀: 程式開發人員 這本《笛卡兒,拜拜!》裡,德福林花了開頭三分之一的篇幅綜觀了邏輯的發展歷史。這部分是一般邏輯教科書裡不會著墨的題材,而德福林把它表達得十分容易理解,尤其一些令人感覺困擾的邏輯基本概念,例如條件句與實質蘊涵的來歷,都有極具啟發性的交代。在學校裡上邏輯、理則學或任何思想方法課程的學生,都應看看本書提供的歷史背景,一定會讓你體會到那些看似枯燥無味的邏輯規律的深刻意義,以及它們存在的理由。   本書中間的三分之一,德福林介紹了喬姆斯基的笛卡兒式語言學,也就是把數理邏輯手法搬到語言學的革命性成就。以及在這種氛圍與進路下,人工智能研究的一些成果與遭遇的障礙。本書對語言學的學生,會有增加瞭解喬姆斯基理論背景與來歷的功效。至於研究人工智能的學生,也會從這類檢討中發現有些構想無法完全落實的根源,恐怕不是純粹技術的問題,而是涉及深刻的方法論的立場。   德福林在本書的最後三分之一,逐漸導入了脈絡對於理解人類心智活動的重要性,他介紹了與喬姆斯基語言學旨趣相異的社會語言學,強調了溝通所應扮演的角色。他也用了一些篇幅介紹「情境邏輯」的最基本觀點,普通這種程度的書籍裡幾乎不會包含這麼前沿的內容。   在最後一章裡,作者總結檢討了笛卡兒理性方法的限制,而終於說出了「笛卡兒,拜拜!」。這種新的領悟是在一個高的、綜觀全局的層次,並不是說在每一個細節上,暫時脫離脈絡的作法都要揚棄。事實上在適當的範圍,在一定的侷限裡,傳統的邏輯仍然是可靠有效的工具,我們切莫在倒洗澡水時,把盆裡的嬰兒一起倒掉了 引言: 數學研究推動中心

推薦書籍: 達爾文大震撼

書名: 達爾文大震撼 天下文化出版社 達爾文: .... 突然間,我的腦中蹦出了一絲靈感.. 在這種競爭的狀況下,較有生存優勢的變異品種,應該比較能生存; 而不太能適應環境的個體就較易被淘汰。  這種情形若經年累月的延續下去,就會造成新種的產生。 給予: 過度保護子女的父母以及不敢與大陸人士競爭的朋友們

Cisco VLAN 設定提示

1. VLAN Pre-requisite Step: Before you create VLANs, you must decide whether to use VTP in your network. Using VTP, you can make configuration changes centrally on one or more switches and have those changes automatically communicated to all the other switches in the network. Without VTP, you cannot send information about VLANs to other switches. VTP only learns about normal-range VLANs (VLAN IDs 1 to 1005). Extended-range VLANs (VLAN IDs greater than 1005) are not supported by VTP or stored in the VTP VLAN database VTP Server: (Default Mode) VLAN Config. are saved in NVRAM VTP Client: VTP Transparent: doesn't participate in VTP doesn't advertise its VLAN configuration and doesn't sync its VALN VLAN Configuration based on received advertisements. ***: The switch must be in VTP transparent mode when you create extended-range VLANs ** When the switch is in VTP transparent mode, th

Microsoft 烤麵包機

微軟牌烤麵包機 : 不過美國全麥吐司看起來就是永遠不覺得好吃

My ADC Project in windows ce 6

ARM S3C2443 ADC Diagram: 透過 ADC Driver 讀取 ADC Register ,如下: GPS Application 透過 ADC Driver 讀取 心跳 與氣壓高度資訊 :

Windows CE Shared Source Information

對於想要深入了解 Windows CE 架構的人,Windows CE 6.0提供了幾種不同的原始碼分享來源: 1. Public Shared Source 安裝 Windows CE Platform builder即自動安裝於 \WinCE600\Public 資料夾,無須任何特殊安裝選項與步驟 2. Private Shared Source 此等級在安裝光碟上即可取得,安裝時只要勾選 Shared Source即可安裝到開發人員所使用的電腦內 ( \WinCE600\Private ) 3. Premium Shared Source 欲取得此等級的原始碼資訊必須是微軟核可的OEM廠商或是合作夥伴才能對微軟提出存取許可,透過 Premium Shard Source 可以更深入了解 Windows CE作業系統核心架構,例如: GWES元件、檔案系統元件以及TCP/IP堆疊架構等資訊 詳細資訊可參考 MSDN: Windows CE 6.0 Shared Source

Windows CE Platform Builder 6.0 in Windows 7 ?

some of you might want to know if Win CE Platform builder 6 can works with windows 7 ? The Answer is Yes , I did a fresh installation of windows 7 on my laptop last week , and also install the windows ce platform builder 6 , it works fine so far . Fortunately , the installation process doesn't require any extra patch files for windows 7 , just like windows vista , all you have to do is patch the visual studio 2005 service pack for vista after visual studio 2005 installed (Windows CE Installation) by the way , windows 7 is much better than vista ^^

Windows CE 6.0 R2 Installation

Follow the steps below: 安裝 Windows CE Platform Builder 6.0 R2的次序: 1. Installing Visual Studio 2005 2. Patch Visual Studio 2005 Serivce Pack 1 3. Patch Visual Studio 2005 Service Pack for vista ( Windows 7 同樣要安裝此修補檔) 4. Installing Windows CE Platform Builder 6.0 5. Installing Windows CE Platform Builder 6.0 Service Pack 1 6. Installing Windows CE Platform Builder R2 7. Check MSDN Website for Monthly Update for Windows CE