首页IT科技nodejs多线程如何实现(NodeJs 多核多进程并行框架实作 CNode)

nodejs多线程如何实现(NodeJs 多核多进程并行框架实作 CNode)

时间2025-05-02 04:58:53分类IT科技浏览4396
导读:NodeJs 多核多进程并行框架实作 Linux 2.6.18-164.el5xen x86_64...

NodeJs 多核多进程并行框架实作

Linux 2.6.18-164.el5xen x86_64

CPU X5             ,Intel(R) Xeon(R) CPU E5620 @ 2.40GHz

free -m

total used free shared buffers cached

Mem: 7500 3672 3827 0 863 1183

ransactions: 100000 hits

Availability: 100.00 %

Elapsed time: 10.95 secs

Data transferred: 1.05 MB

Response time: 0.01 secs

Transaction rate: 9132.42 trans/sec

Throughput: 0.10 MB/sec

Concurrency: 55.61

Successful transactions: 100000child req total : 23000

child req total : 16000

child req total : 17000

child req total : 22000

child req total : 22000child req total : 13000

child req total : 30000

child req total : 14000

child req total : 22000

child req total : 21000

(#1) TCP.bind --- > TCP.listen (process.binding(“tcp_wrap            ”))

|

|TCP.emit(“connection                   ” ,handle)

|

(#2) Wrap TCP handle to Socket (Tcp.onconnection)

|

|Net.Server.emit(      ”connection      ” , socket)

|

(#3)Create Req ,Res based on a Socket(net.server.connectionListen)

|

|Http.server.emit(“request                   ” ,req ,res)

|

(#4)your code writen here :function(req ,res){

res.writeHead(200 ,“content-type/text/html             ”);

res.end(“hello,world      ”)

}

ransactions: 100000 hits

Availability: 100.00 %

Elapsed time: 10.47 secs

Data transferred: 1.05 MB

Response time: 0.01 secs

Transaction rate: 9551.10 trans/sec

Throughput: 0.10 MB/sec

Concurrency: 60.68

Successful transactions: 100000child req total : 20000

child req total : 20000

child req total : 20000

child req total : 20000

child req total : 200000 -> /dev/pts/30

1 -> /dev/pts/30

10 -> socket:[71040]

11 -> socket:[71044]

12 -> socket:[71054]

2 -> /dev/pts/30

3 -> eventpoll:[71027]

4 -> pipe:[71028]

5 -> pipe:[71028]

6 -> socket:[71030]

8 -> socket:[71032]

9 -> socket:[71036]0 -> socket:[71031]

1 -> /dev/pts/30

2 -> /dev/pts/30

3 -> eventpoll:[71049]

4 -> pipe:[71050]

5 -> pipe:[71050]

声明:本站所有文章                   ,如无特殊说明或标注      ,均为本站原创发布             。任何个人或组织      ,在未征得本站同意时                   ,禁止复制             、盗用                  、采集      、发布本站内容到任何网站             、书籍等各类媒体平台                  。如若本站内容侵犯了原著者的合法权益             ,可联系我们进行处理      。

创心域SEO版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!

展开全文READ MORE
网站设计方案模板范文(网站设计方案模板图片) 未备案网站(未备案的网站怎么看)