I want to dispute Andrey's first point but... I don't disagree so much
as I gotta point out that they are just fundamentally different.

Unless you find an asynchronous version of the mysql library for PHP,
and rewrite your PHP code using reactphp.org's stuff plus that
asynchronous version of the mysql library for PHP... it's not going to
act all that much like node.

But yes, there might be some case where most of the work is in the
actual string-crunching in the node/php code, and in that case, you'd
need something like the cluster module to match what PHP does
automatically (but without much finesse).

On Sat, Feb 28, 2015 at 6:31 PM, Andrey <[email protected]> wrote:
> I'll outline some difference between your php and node implementation and
> share my results
>
> 1) Apache runs multiple workers / threads. You'll need to use cluster in
> your node script to match this.
> 2) mysql_connect in php does implicit connection pooling. Use "createPool()"
> in node script
>
> My results using cluster/pool  and wrk as load generator ( "wrk -t 10 -c 100
> -d 100s http://localhost:9615/"; ) -
> https://gist.github.com/sidorares/5f90ecb853c902786338
>
> php ~500 resp/sec
> node ~3000 resp/sec
>
>
> On Sunday, 1 March 2015 09:24:17 UTC+11, Anirban Bhattacharya wrote:
>>
>> Tom,
>> Thanks for taking yourbtime going through the code.
>> I did add connection.createPool as you suggested when I startes this post.
>> But didn't see much difference so removed.
>>
>> You are right i mixed up my two thkughts in one i tried to test with
>> default of both, in other i was assuming they are having similar
>> configuration.
>>
>> So the failures in apache for 15 mins run is probably due to Apache
>> started rejecting new proccesses as anymore proceas could maxout runtime
>> memory.
>>
>> I didn't understand the point you said the query size is greater than 1 in
>> node. What is that?
>>
>> Yes I may do pool in both and see again.
>
> --
> Job board: http://jobs.nodejs.org/
> New group rules:
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "nodejs" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/nodejs/mf0Qhj1WVl8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nodejs/1acca32e-9ec8-4842-b419-e4fbf33dd2f5%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 


THOMAS BOUTELL, DEV & OPS
P'UNK AVENUE | (215) 755-1330  |  punkave.com

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAORXhG%2BUwWSpXq9thBJ%2BBGXhbd%3Dh0qFJtWGW0QVLK%2B7oSmSfBw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to