More Related Content Similar to Node.js w dużej skali Similar to Node.js w dużej skali (20) Node.js w dużej skali2. Plan
• Onet.Cloud
• Metody skalowania
• Specyficzne aspekty działania w dużej skali
• Uruchomienie SG
11. Isolate
http://www.flickr.com/photos/pepemczolz/5314122337/
12. Wątki - node-threads-a-gogo
function fibo (n) {
return n > 1 ? fibo(n - 1) + fibo(n - 2) : 1;
}
function cb (err, data) {
process.stdout.write(data); this.eval('fibo(35)', cb);
}
var thread= require('threads_a_gogo').create();
thread.eval(fibo).eval('fibo(35)', cb);
https://github.com/xk/node-threads-a-gogo
18. Problem 2. Pule połączeń
NodeJS App
Storage
Business Connection
Logic Pool
19. Problem 2. Pule połączeń
NodeJS App
Storage
Business Connection
Logic Pool
20. Problem 2. Pule połączeń
NodeJS App
Storage
Business Connection
Logic Pool
21. Problem 2. Pule połączeń
NodeJS App
Storage
Business Connection
Logic Pool
22. Problem 2. Pule połączeń
NodeJS App
Storage
Business Connection
Logic Pool
23. Problem 2. Pule połączeń
NodeJS App
Storage
Business Connection
Logic Pool
24. Problem 2. Pule połączeń
NodeJS App
Storage
Business Connection
Logic Pool
25. Problem 2. Pule połączeń
NodeJS App
Storage
Business Connection
Logic Pool
26. Problem 2. Pule połączeń
NodeJS App
Storage
Business Connection
Logic Pool
27. Problem 2. Pule połączeń
export.request = function(options, cb) {
if (options.agent === undefined) {
options.agent = getAgent(options.host, options.port);
} else if (options.agent === false) {
options.agent = new Agent(options);
}
return exports._requestFromAgent(options, cb);
};
31. NodeJS + moduły w C = NodeJS++
http://www.tecnologiadiaria.com/2010/12/configurar-tiempo-expiracion-cache.html
32. Uriparser 3 razy szybszy niż url.parse
Tak robią wszyscy:
var handler = function(req, res) {
var http = require('http');
var u = http.parse(req.url);
}
Tak robimy my:
var handler = function(req, res) {
var uriparser = require('uriparser');
var u = uriparser.parse('http://www.onet.pl/);
}
https://github.com/DreamLab/node-uriparser