node.js development actual combat

1. What is RPC calls (Remote Procedure Call)

 

 Binary protocol

Smaller volume of packets

Faster rate codec

2. Buffer codec binary data packet

(Protocol Buffers) used to encode binary data

3. net structures RPC channels multiplexed

 

 4. HTTP service performance test

Stress testing tool (ab, webbench)

Usually ab & ( https://www.jianshu.com/p/43d04d8baaf7 )

Find performance bottlenecks

. Top (cpu, memory)

. Iostat (HDD)

5. Node.js performance analysis tool

1⃣️ own profile command to start time to bring --prof (eg. Node --prof app.js)

Then will generate a * .log file

By command: node --prof-process * .log> profile.txt (generated document, and then the main look here, see the main consuming)

 2⃣️ Chrome devtool (eg. node --inspect-brk app.js)

chrome: // inspect enter

3⃣️ Clinic.js  

Guess you like

Origin www.cnblogs.com/luguiqing/p/11974334.html