memaksimalkan non-blocking io pada node.js

Post on 07-Jan-2017

1.234 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Memaksimalkan Penggunaan Non Blocking pada Node.js

Rovan AlfarryCTO of SELabSuite

Informatics EngineeringInstitut Teknologi Indonesia

Pixel House StudioJanuary 2016

Nodejs Programmer2015-2016

Pixel House StudioFounder: Bramantya Farid in 2010World Class Product (programming, design, video & internet marketing)

3,4 MillionKeywords

68.000URLs

300Projects

Scraping Google Connect to 7 API

Why Node.js?

We hate callback hell

We hate single threaded (single point of failure)

Blocked by google (use CURL)

20 seconds per-process

Google scraping

5 seconds per-process

Selenium

Google scraping

2 seconds per-process

PhantomJS

Express js Mongodb Monk Phantom js Socket io Request Nodemon PM2

Redis Node

Cluster/NginX/HAProxy

67%

13%

10%

5%5%

Node.js Python PHP

Java ElasticSearch

Technologies

Non-blocking + node-sync

No standard / No best practice

Catch everything

Node.js handles asynchronous I/O requests with a non-blocking, single-threaded event loop. It is particularly well-suited to distributed systems that make a lot of network requests.

Memory Leak- Heapdump + Chrome Developer Tools- Force Garbage Collection node --expose-gc app.js -> global.gc()

V8 Memory Limit- node --max-old-space-size=16000 app.js pm2 start bin/www –node-args=“--max-old-space-

size=16000 ”

V8Engine

EVERY PRO WAS ONCE AN AMATEUREVERY EXPERT WAS ONCE A BEGINNER

SO KEEP LEARNING

Thank You. Any Questions?

Nodejs Indonesia – Telegram Group

We are hiring!

telegram.me/nodejs_jakarta

top related