<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Node.js vs SilkJS</title>
	<atom:link href="http://blog.tfd.co.uk/2012/09/28/node-js-vs-silkjs/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tfd.co.uk/2012/09/28/node-js-vs-silkjs/</link>
	<description>Open Source Open Thought</description>
	<lastBuildDate>Thu, 24 Jan 2013 05:22:45 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Ian</title>
		<link>http://blog.tfd.co.uk/2012/09/28/node-js-vs-silkjs/#comment-1779</link>
		<dc:creator><![CDATA[Ian]]></dc:creator>
		<pubDate>Fri, 19 Oct 2012 21:21:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tfd.co.uk/?p=715#comment-1779</guid>
		<description><![CDATA[Michael,

Thank you for the clarifications and insights. Getting thoughts directly from the creator is always better than from any other source. Your comment on consistent and predictable memory usage is particular interesting, as I have noticed that although the event driven application environments don&#039;t exhaust the available process or thread resources, they are particularly unpredictable when it comes to cpu and memory usage. Optimising apps to deal with that is hard, and I suspect there will be a whole new class of DDOS attacks that exploit that unpredictability to bring even the most capable event driven web servers to their knees. Any endpoint that performs mild computation or has any memory footprint is all that&#039;s need.

SilkJS is great work, and it was refreshing to experiment with it.

Ian]]></description>
		<content:encoded><![CDATA[<p>Michael,</p>
<p>Thank you for the clarifications and insights. Getting thoughts directly from the creator is always better than from any other source. Your comment on consistent and predictable memory usage is particular interesting, as I have noticed that although the event driven application environments don&#8217;t exhaust the available process or thread resources, they are particularly unpredictable when it comes to cpu and memory usage. Optimising apps to deal with that is hard, and I suspect there will be a whole new class of DDOS attacks that exploit that unpredictability to bring even the most capable event driven web servers to their knees. Any endpoint that performs mild computation or has any memory footprint is all that&#8217;s need.</p>
<p>SilkJS is great work, and it was refreshing to experiment with it.</p>
<p>Ian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Schwartz</title>
		<link>http://blog.tfd.co.uk/2012/09/28/node-js-vs-silkjs/#comment-1778</link>
		<dc:creator><![CDATA[Michael Schwartz]]></dc:creator>
		<pubDate>Fri, 19 Oct 2012 20:20:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tfd.co.uk/?p=715#comment-1778</guid>
		<description><![CDATA[Thanks for the reasoned review.

When I wrote SIlkJS, I was not so much focused on the requests/second performance but concurrency.  I was both surprised and pleased with the actual request/second results.

Initially, I ran ab tests against SilkJS to assure it could handle 2+ simultaneous requests.   When I saw it do 2, then 10, then 50, then 5000 simultaneously, I just figured it was working pretty well.

When I saw that it was fast, I thought I&#039;d compare against Apache.  SilkJS is not as fast as Apache, but it&#039;s pretty close (90%) for static content.  For running business logic you&#039;d do with Apache+PHP, SilkJS+V8/JavaScript is up to two orders of magnitude faster.

You mentioned many of SilkJS&#039;s strengths.  You wrote that SilkJS uses pthreads, which it doesn&#039;t.  It uses system processes via fork(), much the same way each tab in your browser is a separate system Process in Chrome.  In a pthread application, a single thread can bring down the entire process (threads share the address space of the main program/process).  SilkJS&#039;s use of Processes allows any Process to die, get killed, crash, etc., and the other processes continue to run.  Much like closing a tab in your browser, the other tabs continue to work.

A benefit of Processes you didn&#039;t mention is garbage collection.  The nature of V8 as a JavaScript engine is that it will choose to garbage collect freed variables and objects pretty much when it chooses.  You can force a garbage collect to occur, which SilkJS does, and on a per Process basis.  When one process is done serving all the keep-alive requests from a browser, it will garbage collect.  Other Processes in other CPU cores will run just fine, the OS scheduler will allow a CPU core to part-time GC for one process and execute business logic for another, and so on.  With a single threaded application, GC will kick in probably when you don&#039;t want it to :)

As well, the SilkJS Processes will execute some predefined (configurable) number of requests from all sources/browsers and will then exit.  The exit causes all memory used by V8 and your JavaScript code to be returned to the system.  The other Processes continue to run, of course.  The main program detects when a &quot;child&quot; process exits and spawns a new one to replace it.  For these reasons, I believe memory usage for SilkJS may be more consistent and predictable.

I am a big fan of NodeJS.  Where I think it excels is at massive numbers of long-lived connections like WebSockets or large file downloads.  In production, though, I wouldn&#039;t recommend either NodeJS or SilkJS or any other WWW server for static content.  No matter how concurrent you can get NodeJS to be, a really big CDN is going to handle more connections and deliver content faster.

I&#039;m a realist, though.  Neither NodeJS nor SilkJS are going to cause major WWW sites like Yahoo! or Google or ESPN to junk their existing technology and rewrite it all in JavaScript.  The trick is to figure out a place alongside that existing infrastructure to thrive, and I believe there&#039;s room for both SilkJS and NodeJS.

Regards,
Michael Schwartz - Creator of SilkJS]]></description>
		<content:encoded><![CDATA[<p>Thanks for the reasoned review.</p>
<p>When I wrote SIlkJS, I was not so much focused on the requests/second performance but concurrency.  I was both surprised and pleased with the actual request/second results.</p>
<p>Initially, I ran ab tests against SilkJS to assure it could handle 2+ simultaneous requests.   When I saw it do 2, then 10, then 50, then 5000 simultaneously, I just figured it was working pretty well.</p>
<p>When I saw that it was fast, I thought I&#8217;d compare against Apache.  SilkJS is not as fast as Apache, but it&#8217;s pretty close (90%) for static content.  For running business logic you&#8217;d do with Apache+PHP, SilkJS+V8/JavaScript is up to two orders of magnitude faster.</p>
<p>You mentioned many of SilkJS&#8217;s strengths.  You wrote that SilkJS uses pthreads, which it doesn&#8217;t.  It uses system processes via fork(), much the same way each tab in your browser is a separate system Process in Chrome.  In a pthread application, a single thread can bring down the entire process (threads share the address space of the main program/process).  SilkJS&#8217;s use of Processes allows any Process to die, get killed, crash, etc., and the other processes continue to run.  Much like closing a tab in your browser, the other tabs continue to work.</p>
<p>A benefit of Processes you didn&#8217;t mention is garbage collection.  The nature of V8 as a JavaScript engine is that it will choose to garbage collect freed variables and objects pretty much when it chooses.  You can force a garbage collect to occur, which SilkJS does, and on a per Process basis.  When one process is done serving all the keep-alive requests from a browser, it will garbage collect.  Other Processes in other CPU cores will run just fine, the OS scheduler will allow a CPU core to part-time GC for one process and execute business logic for another, and so on.  With a single threaded application, GC will kick in probably when you don&#8217;t want it to <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>As well, the SilkJS Processes will execute some predefined (configurable) number of requests from all sources/browsers and will then exit.  The exit causes all memory used by V8 and your JavaScript code to be returned to the system.  The other Processes continue to run, of course.  The main program detects when a &#8220;child&#8221; process exits and spawns a new one to replace it.  For these reasons, I believe memory usage for SilkJS may be more consistent and predictable.</p>
<p>I am a big fan of NodeJS.  Where I think it excels is at massive numbers of long-lived connections like WebSockets or large file downloads.  In production, though, I wouldn&#8217;t recommend either NodeJS or SilkJS or any other WWW server for static content.  No matter how concurrent you can get NodeJS to be, a really big CDN is going to handle more connections and deliver content faster.</p>
<p>I&#8217;m a realist, though.  Neither NodeJS nor SilkJS are going to cause major WWW sites like Yahoo! or Google or ESPN to junk their existing technology and rewrite it all in JavaScript.  The trick is to figure out a place alongside that existing infrastructure to thrive, and I believe there&#8217;s room for both SilkJS and NodeJS.</p>
<p>Regards,<br />
Michael Schwartz &#8211; Creator of SilkJS</p>
]]></content:encoded>
	</item>
</channel>
</rss>
