Message from discussion
[ANN] thread.js - a high concurrent ipv4/v6 server of node.js addon
Received: by 10.68.224.71 with SMTP id ra7mr1069602pbc.3.1345826124053;
Fri, 24 Aug 2012 09:35:24 -0700 (PDT)
X-BeenThere: nodejs@googlegroups.com
Received: by 10.68.230.196 with SMTP id ta4ls6008036pbc.1.gmail; Fri, 24 Aug
2012 09:35:11 -0700 (PDT)
Received: by 10.68.201.229 with SMTP id kd5mr1201712pbc.11.1345826111942;
Fri, 24 Aug 2012 09:35:11 -0700 (PDT)
Date: Fri, 24 Aug 2012 09:35:11 -0700 (PDT)
From: Robert L <blk.rab2...@gmail.com>
To: nodejs@googlegroups.com
Message-Id: <9dfa7034-912a-44b8-bc54-34236ca7ba6c@googlegroups.com>
In-Reply-To: <EAAE534A-4AC1-4D02-9F22-540D20670216@brandedcode.com>
References: <8ccc0f94-1d84-44ec-8f75-8859f40df07c@googlegroups.com> <5993E67A-F32A-47DE-BDAA-5952AC7D09C4@brandedcode.com> <da06eed8-f42c-47c7-8605-1444da936205@googlegroups.com>
<EAAE534A-4AC1-4D02-9F22-540D20670216@brandedcode.com>
Subject: Re: [nodejs] [ANN] thread.js - a high concurrent ipv4/v6 server of
node.js addon
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_661_21348924.1345826111454"
------=_Part_661_21348924.1345826111454
Content-Type: multipart/alternative;
boundary="----=_Part_662_13829448.1345826111455"
------=_Part_662_13829448.1345826111455
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
I need to study on this, why `tj simple` get that much compares to `tj with=
=20
node` before I can be certain about it.
But I can say, after writeing thread.js, c/c++ module make the most=20
difference by comparing to javascript code and this is relate to using=20
threads. Then, reusing javascript objects is second the most issue to take=
=20
care of.
Best Regards,
Robert
Micheil Smith=E6=96=BC 2012=E5=B9=B48=E6=9C=8824=E6=97=A5=E6=98=9F=E6=9C=9F=
=E4=BA=94UTC+8=E4=B8=8B=E5=8D=8811=E6=99=8212=E5=88=8620=E7=A7=92=E5=AF=AB=
=E9=81=93=EF=BC=9A
>
> So, correct me if I'm wrong, but your initial benchmark results were=20
> skewed=20
> because of how you've implemented your HTTP module.=20
>
> That said, you do see to get some performance boost over the standard net=
=20
> module, I'm guessing this may be because you're not communicating over=20
> STDOUT/STDIN pipes to child processes, but instead directly to the=20
> individual threads?=20
>
> =E2=80=93 Micheil=20
>
> On 24/08/2012, at 4:05 PM, Robert L wrote:=20
>
> > Hi Micheil,=20
> >=20
> > You have mentioned me what I have miss.=20
> > I was only focused on the performance of http service.=20
> > After I have done the benchmark with cluster using `net`. I was=20
> surprised that `net` are not that slow as`http`.=20
> >=20
> > Here is the result:=20
> > >ab -n 200000 -c xxxx 127.0.0.1:8080/=20
> > 200client 1000client 2000client=20
> > node_cluster 21001.89 19000.00 18717.28=20
> > tj wite node 23792.30 23175.49 22707.17=20
> > tj simple 24220.45 23182.52 22709.86=20
> >=20
> >=20
> > >ab -n 200000 -c xxxx -k 127.0.0.1:8080/=20
> > 200client 1000client 2000client=20
> > node_cluster 21001.89 136077.29 18717.28=20
> > tj wite node 23792.30 109830.13 22707.17=20
> > tj simple 24220.45 105600.24 22709.86=20
> >=20
> >=20
> > >weighttp -n 200000 -c xxxx -t 8 127.0.0.1:8080/=20
> > 200client 1000client 2000client=20
> > node_cluster 48644 41211 43047=
=20
> > tj wite node 78133 76878 72929=
=20
> > tj simple 78061 73478 72209=20
> >=20
> >=20
> > >weighttp -n 200000 -c xxxx -t 8 -k 127.0.0.1:8080/=20
> > 200client 1000client 2000client=20
> > node_cluster 168867 163490 161464=20
> > tj wite node 179399 195751 178095=20
> > tj simple 289362 281941 256841=20
> >=20
> >=20
> > Thread.js get a bigger advantage when benchmark with weighttp that get=
=20
> multi thread support.=20
> > Currently I implement a simply http service in javascript and it can=20
> achieve 60,000+ both connections/sec and requests/sec.=20
> > I will try to implement a method for programs to register their=20
> protocol. When that time, I'll do another benchmark base on http service.=
=20
> >=20
> > Sincerely,=20
> > Robert=20
> >=20
> >=20
> >=20
> > Micheil Smith=E6=96=BC 2012=E5=B9=B48=E6=9C=8824=E6=97=A5=E6=98=9F=E6=
=9C=9F=E4=BA=94UTC+8=E4=B8=8A=E5=8D=885=E6=99=8220=E5=88=8608=E7=A7=92=E5=
=AF=AB=E9=81=93=EF=BC=9A=20
> > Hi Robert,=20
> >=20
> > How's this compare to a Node.js server running with Cluster (API in=20
> 0.8)?=20
> >=20
> > I expect it to certainly be better than just a single node process=20
> running a net.Server,=20
> > but if that process has been setup with Cluster, then you'd have one=20
> server per core=20
> > to deal with the shared socket (or, at least, that's my understanding o=
f=20
> it).=20
> >=20
> > Kind Regards,=20
> > Micheil Smith=20
> > --=20
> > BrandedCode.com=20
> >=20
> > On 23/08/2012, at 5:40 PM, Robert L wrote:=20
> >=20
> > > Hi everybody,=20
> > >=20
> > > I have worte a node.js addon, to support multi thread with v8, and ac=
t=20
> as a ipv4/v6 server, please give it a try.=20
> > > Your feedback is very welcome.=20
> > >=20
> > > Thread.js support:=20
> > > 1. Act as a network layer of node.js.=20
> > > 2. Register a file to thread - you then run javascript file within th=
e=20
> thread along with the network layer. Thread.js support require(),=20
> console.log, events.Emitter, net.createConnection and typedarray in threa=
d=20
> mode for now.=20
> > >=20
> > > Benchmark is done by using weighttp on a Ubuntu 12.04 LTS 64bits=20
> server with a i7 2.67G 4cores cpu.=20
> > > Performance of a simple 'Hello world' server:=20
> > > 60K+ concurrent connections per second.=20
> > > 150K~200K concurrent requests per second.=20
> > > And it's scale mainly by cpu core number. You can get higher benchmar=
k=20
> by adding more cpu power.=20
> > >=20
> > > Throughout of 50Kbytes response server:=20
> > > using typedarray: 1.7Gbytes per second.=20
> > > using javascript string: 290Mbytes per second.=20
> > >=20
> > > Stability:=20
> > > Each connection object is reused, thus the memory allocation is just=
=20
> at new age, don't need to face gc problem, and it can run days to weeks=
=20
> without restart the program.=20
> > > You can prove it by running node with v8 flag '--trace_gc=20
> --trace_gc_verbose'=20
> > >=20
> > > Detail benchmark output and test script is supported.=20
> > > Because it's written with the support of pthread and epoll , thread.j=
s=20
> is Linux only.=20
> > >=20
> > > And please support me if it make some useful for your application.=20
> Thanks very much.=20
> > >=20
> > > homepage: http://rob333.github.com/thread.js/=20
> > > github: https://github.com/rob333/thread.js=20
> > >=20
> > >=20
> > >=20
> > > --=20
> > > Job Board: http://jobs.nodejs.org/=20
> > > Posting guidelines:=20
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines=20
> > > You received this message because you are subscribed to the Google=20
> > > Groups "nodejs" group.=20
> > > To post to this group, send email to nod...@googlegroups.com=20
> > > To unsubscribe from this group, send email to=20
> > > nodejs+un...@googlegroups.com=20
> > > For more options, visit this group at=20
> > > http://groups.google.com/group/nodejs?hl=3Den?hl=3Den=20
> >=20
> >=20
> > --=20
> > Job Board: http://jobs.nodejs.org/=20
> > Posting guidelines:=20
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines=20
> > You received this message because you are subscribed to the Google=20
> > Groups "nodejs" group.=20
> > To post to this group, send email to nod...@googlegroups.com<javascript=
:>=20
> > To unsubscribe from this group, send email to=20
> > nodejs+un...@googlegroups.com <javascript:>=20
> > For more options, visit this group at=20
> > http://groups.google.com/group/nodejs?hl=3Den?hl=3Den=20
>
>
------=_Part_662_13829448.1345826111455
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
<div>I need to study on this, why `tj simple` get that much compares to `tj=
with node` before I can be certain about it.</div><div>But I can say, afte=
r writeing thread.js, c/c++ module make the most difference by comparing to=
javascript code and this is relate to using threads. Then, reusing javascr=
ipt objects is second the most issue to take care of.</div><div><br></div><=
div>Best Regards,</div><div>Robert</div><div><br><br>Micheil Smith=E6=96=BC=
2012=E5=B9=B48=E6=9C=8824=E6=97=A5=E6=98=9F=E6=9C=9F=E4=BA=94UTC+8=E4=B8=
=8B=E5=8D=8811=E6=99=8212=E5=88=8620=E7=A7=92=E5=AF=AB=E9=81=93=EF=BC=9A<bl=
ockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border=
-left: 1px #ccc solid;padding-left: 1ex;">So, correct me if I'm wrong, but =
your initial benchmark results were skewed=20
<br>because of how you've implemented your HTTP module.
<br>
<br>That said, you do see to get some performance boost over the standard n=
et=20
<br>module, I'm guessing this may be because you're not communicating over=
=20
<br>STDOUT/STDIN pipes to child processes, but instead directly to the=20
<br>individual threads?
<br>
<br>=E2=80=93 Micheil
<br>
<br>On 24/08/2012, at 4:05 PM, Robert L wrote:
<br>
<br>> Hi Micheil,
<br>>=20
<br>> You have mentioned me what I have miss.
<br>> I was only focused on the performance of http service.
<br>> After I have done the benchmark with cluster using `net`. I was su=
rprised that `net` are not that slow as`http`.
<br>>=20
<br>> Here is the result:
<br>> >ab -n 200000 -c xxxx <a href=3D"http://127.0.0.1:8080/" target=
=3D"_blank">127.0.0.1:8080/</a>
<br>> =
200client <wbr>&=
nbsp; 1000client =
<wbr>2000client
<br>> node_cluster 21001.=
89 <wbr> 19000.00  =
; 18717.28
<br>> tj wite node 23792.=
30 <wbr>23175.49  =
; 22707.17
<br>> tj simple 24220.45&=
nbsp; <wbr>23182.52 &n=
bsp; 22709.86
<br>>=20
<br>>=20
<br>> >ab -n 200000 -c xxxx -k <a href=3D"http://127.0.0.1:8080/" tar=
get=3D"_blank">127.0.0.1:8080/</a>=20
<br>> =
200client <wbr>&=
nbsp; 1000client =
<wbr>2000client
<br>> node_cluster 21001.=
89 <wbr> 136077.29 &nbs=
p; 18717.28
<br>> tj wite node 23792.=
30 <wbr>109830.13 &nbs=
p; 22707.17
<br>> tj simple 24220.45&=
nbsp; <wbr>105600.24 &=
nbsp; 22709.86
<br>>=20
<br>>=20
<br>> >weighttp -n 200000 -c xxxx -t 8 <a href=3D"http://127.0.0.1:80=
80/" target=3D"_blank">127.0.0.1:8080/</a>
<br>> =
200client <wbr>&=
nbsp; 1000client =
<wbr>2000client
<br>> node_cluster 48644&=
nbsp; <wbr>  =
; 41211 &n=
bsp; 43047
<br>> tj wite node 78133&=
nbsp; &nbs=
p;<wbr> 76878 &n=
bsp; 72929
<br>> tj simple 78061&nbs=
p; <wbr> &n=
bsp; 73478  =
; 72209
<br>>=20
<br>>=20
<br>> >weighttp -n 200000 -c xxxx -t 8 -k <a href=3D"http://127.0.0.1=
:8080/" target=3D"_blank">127.0.0.1:8080/</a>
<br>> =
200client <wbr>&=
nbsp; 1000client =
<wbr>2000client
<br>> node_cluster 168867=
<wbr> &nbs=
p; 163490 161464
<br>> tj wite node 179399=
<wb=
r> 195751 178095
<br>> tj simple 289362&nb=
sp; <wbr> &=
nbsp; 281941 256841
<br>>=20
<br>>=20
<br>> Thread.js get a bigger advantage when benchmark with weighttp that=
get multi thread support.
<br>> Currently I implement a simply http service in javascript and it c=
an achieve 60,000+ both connections/sec and requests/sec.
<br>> I will try to implement a method for programs to register their pr=
otocol. When that time, I'll do another benchmark base on http service.
<br>>=20
<br>> Sincerely,
<br>> Robert
<br>>=20
<br>>=20
<br>>=20
<br>> Micheil Smith=E6=96=BC 2012=E5=B9=B48=E6=9C=8824=E6=97=A5=E6=98=9F=
=E6=9C=9F=E4=BA=94UTC+<wbr>8=E4=B8=8A=E5=8D=885=E6=99=8220=E5=88=8608=E7=A7=
=92=E5=AF=AB=E9=81=93=EF=BC=9A
<br>> Hi Robert,=20
<br>>=20
<br>> How's this compare to a Node.js server running with Cluster (API i=
n 0.8)?=20
<br>>=20
<br>> I expect it to certainly be better than just a single node process=
running a net.Server,=20
<br>> but if that process has been setup with Cluster, then you'd have o=
ne server per core=20
<br>> to deal with the shared socket (or, at least, that's my understand=
ing of it).=20
<br>>=20
<br>> Kind Regards,=20
<br>> Micheil Smith=20
<br>> --=20
<br>> BrandedCode.com=20
<br>>=20
<br>> On 23/08/2012, at 5:40 PM, Robert L wrote:=20
<br>>=20
<br>> > Hi everybody,=20
<br>> >=20
<br>> > I have worte a node.js addon, to support multi thread with v8=
, and act as a ipv4/v6 server, please give it a try.=20
<br>> > Your feedback is very welcome.=20
<br>> >=20
<br>> > Thread.js support:=20
<br>> > 1. Act as a network layer of node.js.=20
<br>> > 2. Register a file to thread - you then run javascript file w=
ithin the thread along with the network layer. Thread.js support require(),=
console.log, events.Emitter, net.createConnection and typedarray in thread=
mode for now.=20
<br>> >=20
<br>> > Benchmark is done by using weighttp on a Ubuntu 12.04 LTS 64b=
its server with a i7 2.67G 4cores cpu.=20
<br>> > Performance of a simple 'Hello world' server:=20
<br>> > 60K+ concurrent connections per second.=20
<br>> > 150K~200K concurrent requests per second.=20
<br>> > And it's scale mainly by cpu core number. You can get higher =
benchmark by adding more cpu power.=20
<br>> >=20
<br>> > Throughout of 50Kbytes response server:=20
<br>> > using typedarray: 1.7Gbytes per second.=20
<br>> > using javascript string: 290Mbytes per second.=20
<br>> >=20
<br>> > Stability:=20
<br>> > Each connection object is reused, thus the memory allocation =
is just at new age, don't need to face gc problem, and it can run days to w=
eeks without restart the program.=20
<br>> > You can prove it by running node with v8 flag '--trace_gc --t=
race_gc_verbose'=20
<br>> >=20
<br>> > Detail benchmark output and test script is supported.=20
<br>> > Because it's written with the support of pthread and epoll , =
thread.js is Linux only.=20
<br>> >=20
<br>> > And please support me if it make some useful for your applica=
tion. Thanks very much.=20
<br>> >=20
<br>> > homepage: <a href=3D"http://rob333.github.com/thread.js/" tar=
get=3D"_blank">http://rob333.github.com/<wbr>thread.js/</a>=20
<br>> > github: <a href=3D"https://github.com/rob333/thread.js" targe=
t=3D"_blank">https://github.com/rob333/<wbr>thread.js</a>=20
<br>> >=20
<br>> >=20
<br>> >=20
<br>> > --=20
<br>> > Job Board: <a href=3D"http://jobs.nodejs.org/" target=3D"_bla=
nk">http://jobs.nodejs.org/</a>=20
<br>> > Posting guidelines: <a href=3D"https://github.com/joyent/node=
/wiki/Mailing-List-Posting-Guidelines" target=3D"_blank">https://github.com=
/joyent/<wbr>node/wiki/Mailing-List-<wbr>Posting-Guidelines</a>=20
<br>> > You received this message because you are subscribed to the G=
oogle=20
<br>> > Groups "nodejs" group.=20
<br>> > To post to this group, send email to <a>nod...@googlegroups.c=
om</a>=20
<br>> > To unsubscribe from this group, send email to=20
<br>> > <a>nodejs+un...@googlegroups.com</a>=20
<br>> > For more options, visit this group at=20
<br>> > <a href=3D"http://groups.google.com/group/nodejs?hl=3Den?hl=
=3Den" target=3D"_blank">http://groups.google.com/<wbr>group/nodejs?hl=3Den=
?hl=3Den</a>=20
<br>>=20
<br>>=20
<br>> --=20
<br>> Job Board: <a href=3D"http://jobs.nodejs.org/" target=3D"_blank">h=
ttp://jobs.nodejs.org/</a>
<br>> Posting guidelines: <a href=3D"https://github.com/joyent/node/wiki=
/Mailing-List-Posting-Guidelines" target=3D"_blank">https://github.com/joye=
nt/<wbr>node/wiki/Mailing-List-<wbr>Posting-Guidelines</a>
<br>> You received this message because you are subscribed to the Google
<br>> Groups "nodejs" group.
<br>> To post to this group, send email to <a href=3D"javascript:" targe=
t=3D"_blank" gdf-obfuscated-mailto=3D"TaMtSx2xSJ8J">nod...@googlegroups.com=
</a>
<br>> To unsubscribe from this group, send email to
<br>> <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D=
"TaMtSx2xSJ8J">nodejs+un...@<wbr>googlegroups.com</a>
<br>> For more options, visit this group at
<br>> <a href=3D"http://groups.google.com/group/nodejs?hl=3Den?hl=3Den" =
target=3D"_blank">http://groups.google.com/<wbr>group/nodejs?hl=3Den?hl=3De=
n</a>
<br>
<br></blockquote></div>
------=_Part_662_13829448.1345826111455--
------=_Part_661_21348924.1345826111454--