background preloader

Read Later

Facebook Twitter

DeveloperWorks 中国 : IBM's resource for developers and IT professionals. Mario Andrés Pagella - Software Developer, Author, Game Development Junkie. Channel 9: Videos about the people building Microsoft Products & Services. High Performance .NET - 思創軟體. 高負載應用系統效能改善策略 Problems?

High Performance .NET - 思創軟體

Case Study Cassandra CouchDB HBase MongoDB ← Redis Trends JavaScript basis: 0 structural object-oriended functional ← JavaScript basis: 1 var f = function() { var c = 0; c++; alert(c); }; f(); f(); f(); JavaScript basis: 2 var c = 0;var f = function() { c++; alert(c); }; f(); f(); f(); JavaScript basis: 3 var op1 = function(a, b) { return a + b; };var op2 = function(a, b) { return a * b; };var func1 = function(o1, o2) { return function(a, b, c) { return o2(o1(a, b), c); };};var inst1 = func1(op1, op2); alert(inst1(1, 2, 3)); mongoDB: 1 解壓縮至 C:\mongodb、設定 PATH=C:\mongodb\bin;… 建立資料夾(前置作業) cd C:\ mkdir \data mkdir \data\db 啟動 Server mongod 執行 Client mongo mongoDB: 2 切換(建立)資料庫 use school db.classes.find() mongoDB: 3 Interactive with Query Results var rows = db.classes.find(); while (rows.hasNext()) print(rows.next().name); mongoDB: 4 mongoDB: 5 In Access data with JavaScript / JSON Out SQL Results → Processing → JSON mongoDB: 6 mongoDB: 7 mongoDB: 8 mongoDB: 9 Remember: db.foo.find().limit(10)

Dotfuries. 读书频道-IT技术图书-51CTO.COM. Lifehacker, tips and downloads for getting things done - Nightly. Gizmodo, the Gadget Guide - Nightly. 開放資料的願景與策略. 歡迎來到台北土虱社群的網站 - Taipei Open Source Software User Group. CSDN研发频道 - CSDN.NET - 中国领先的IT技术社区,为IT专业技术人员提供最全面的信息传播和服务平台. Node.js. 玩物尚誌: NodeJS. Node.js 讓 JavaScript 也能用於網站後端開發,開發人員只要精熟 JavaScript 語言,就能夠輕鬆開發高效能 Web 應用程式。

玩物尚誌: NodeJS

習慣在 Windows + IIS 工作的朋友,不妨也玩玩看 Node.js。 在 Node.js 官網已經提供安裝程式,包含 NPM(Node.js 的套件管理工具)。 Iisnode 是讓 IIS 管理 Node.js 程式的 IIS 模組,也有很簡便的安裝程式。 關於 iisnode 的使用,請參考原作者這篇。 給 IIS 執行的 Node.js 程式,和 Node.js 提供的官方範例幾乎沒有差異,唯一的差別只是在 Port 的部份不是直接指定,而是用 process.env.PORT 接收來自 iisnode 動態配給的 Port 代號。 如果要寫出可以同時在 iisnode 模式下自動執行,也可以用 console 模式啓動的 Node.js 程式,方法是 var port = process.env.PORT || 3000; (動態判斷是否有來自 iisnode 指定的 Port,否則就使用靜態指定的號碼)。 在效能的部份,預設模式下,iisnode 執行 Node.js 的「Hello World」程式,和 ASP.NET(.aspx)的 Hello World 相比,似乎沒有顯著差別。 但是可以在 web.config 指定這個參數:maxProcessCountPerApplication="4" 再做一次負載測試,大多數的情況下,可以發現這個簡單的調校帶來效能不少的增進。

Iisnode 會自動管理 Node.js 的 process,但是預設只會啓動 1 個 process,對於 4、8 顆以上核心數目的伺服器來說,在負載高峰期間只會有一個 CPU Core 忙碌,其它 Core 都在睡覺,所以就沒有讓耐操的 Node.js 發揮 Server 的能耐。 但是 process 數量並不是愈多就愈好,一般來說建議可以設定成 CPU Core 的數量,並配合其他參數與壓力測試找出最佳值。 我有一份簡單的筆記,提供一些簡單的範例,可以參考: 為什麼 Windows + IIS + ASP.NET 的開發者,也要開始學習 Node.js? 原因很簡單,未來應用程式想要上雲端(微軟 Azure 雲),這無疑是一條捷徑,請參考: How To Node - NodeJS. NodeJS 華文維基平台.