<?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/"
		>
<channel>
	<title>Comments on: NGiNX HTTP Push Module</title>
	<atom:link href="http://ajaxian.com/archives/nginx-http-push-module/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/nginx-http-push-module</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 09 Feb 2012 06:55:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
	<item>
		<title>By: slact</title>
		<link>http://ajaxian.com/archives/nginx-http-push-module/comment-page-1#comment-276710</link>
		<dc:creator>slact</dc:creator>
		<pubDate>Thu, 19 Nov 2009 17:49:47 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7938#comment-276710</guid>
		<description>@broofa:
Nginx is quite excellent at dealing with open connections. Using this module adds a small amount of overhead -- a dozen or so bytes per channel, and around a hundred per each open subscriber request (depending, of course, on the size of the request). 				

Channel messages are stored either in memory or, when they exceed some reasonable size threshold, in temporary files. If you intend to have millions of channels open with millions of messages that take weeks to expire and be purged, consider increasing the push_max_reserved_memory setting. CPU usage should be completely unnoticeable. Channels are stored in a red-black tree, and have an O(log(N)) retrieval cost. All other NHPM operations are constant-time, so things should scale quite well.

As for running multiple instances of this thing, the only way to do that right now would indeed be to publish all messages to all instances, probably via some very basic server-side scripting. Shared memcached storage and a facility to keep multiple instances synced up is in the works.

Relaying messages introduces virtually no overhead if your application uses a keep-alive connection to talk to the server (as opposed to, say, performing standalone curl calls every time it wishes to send a message). Otherwise, you get a TCP/IP handshake overhead per each publisher request.</description>
		<content:encoded><![CDATA[<p>@broofa:<br />
Nginx is quite excellent at dealing with open connections. Using this module adds a small amount of overhead &#8212; a dozen or so bytes per channel, and around a hundred per each open subscriber request (depending, of course, on the size of the request). 				</p>
<p>Channel messages are stored either in memory or, when they exceed some reasonable size threshold, in temporary files. If you intend to have millions of channels open with millions of messages that take weeks to expire and be purged, consider increasing the push_max_reserved_memory setting. CPU usage should be completely unnoticeable. Channels are stored in a red-black tree, and have an O(log(N)) retrieval cost. All other NHPM operations are constant-time, so things should scale quite well.</p>
<p>As for running multiple instances of this thing, the only way to do that right now would indeed be to publish all messages to all instances, probably via some very basic server-side scripting. Shared memcached storage and a facility to keep multiple instances synced up is in the works.</p>
<p>Relaying messages introduces virtually no overhead if your application uses a keep-alive connection to talk to the server (as opposed to, say, performing standalone curl calls every time it wishes to send a message). Otherwise, you get a TCP/IP handshake overhead per each publisher request.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darkimmortal</title>
		<link>http://ajaxian.com/archives/nginx-http-push-module/comment-page-1#comment-276707</link>
		<dc:creator>Darkimmortal</dc:creator>
		<pubDate>Thu, 19 Nov 2009 16:36:18 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7938#comment-276707</guid>
		<description>Nginx has always been the best webserver, and now even more so.</description>
		<content:encoded><![CDATA[<p>Nginx has always been the best webserver, and now even more so.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nichol4s</title>
		<link>http://ajaxian.com/archives/nginx-http-push-module/comment-page-1#comment-276704</link>
		<dc:creator>Nichol4s</dc:creator>
		<pubDate>Thu, 19 Nov 2009 14:41:01 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7938#comment-276704</guid>
		<description>Excellent tool for applications which rely solely on JS clients. But i suppose that when you need to interface it with a different backend (Rails/Python) it doesn&#039;t really help you much unless you play with the code.</description>
		<content:encoded><![CDATA[<p>Excellent tool for applications which rely solely on JS clients. But i suppose that when you need to interface it with a different backend (Rails/Python) it doesn&#8217;t really help you much unless you play with the code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: broofa</title>
		<link>http://ajaxian.com/archives/nginx-http-push-module/comment-page-1#comment-276702</link>
		<dc:creator>broofa</dc:creator>
		<pubDate>Thu, 19 Nov 2009 13:31:15 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7938#comment-276702</guid>
		<description>Very cool!

I&#039;m quite interested to know what impact this has on scalability and architecture in cases where nginx is used as a load balancer however (which, from what I can tell, is the role it is most often used for).

For example, what&#039;s a reasonable upper limit to the number of simultaneous subscriber connections? What about subscriber message throughput (messages/sec)?  I know there are all sorts of factors that contribute to what an actual production system can do, but is there any test data the author or others can share?

If handling push message traffic is the performance bottleneck for nginx compared to whatever load balancing it might be tasked for - which seems pretty likely (right?) - how does one address that?  Spin up new nginx instances?  That seems problematic, as you now have to ensure that messages are published to all instances.  Is there a facility for this?

Also, if messages need to be processed on the back-end (e.g. to do spam filtering in the demo chat client), does the need to use HTTP to relay each message to/from the server adversely affect performance?</description>
		<content:encoded><![CDATA[<p>Very cool!</p>
<p>I&#8217;m quite interested to know what impact this has on scalability and architecture in cases where nginx is used as a load balancer however (which, from what I can tell, is the role it is most often used for).</p>
<p>For example, what&#8217;s a reasonable upper limit to the number of simultaneous subscriber connections? What about subscriber message throughput (messages/sec)?  I know there are all sorts of factors that contribute to what an actual production system can do, but is there any test data the author or others can share?</p>
<p>If handling push message traffic is the performance bottleneck for nginx compared to whatever load balancing it might be tasked for &#8211; which seems pretty likely (right?) &#8211; how does one address that?  Spin up new nginx instances?  That seems problematic, as you now have to ensure that messages are published to all instances.  Is there a facility for this?</p>
<p>Also, if messages need to be processed on the back-end (e.g. to do spam filtering in the demo chat client), does the need to use HTTP to relay each message to/from the server adversely affect performance?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: emehrkay</title>
		<link>http://ajaxian.com/archives/nginx-http-push-module/comment-page-1#comment-276701</link>
		<dc:creator>emehrkay</dc:creator>
		<pubDate>Thu, 19 Nov 2009 13:15:46 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7938#comment-276701</guid>
		<description>&quot;rhymes with Ninternet Nexplorer&quot;
.
I love good comments</description>
		<content:encoded><![CDATA[<p>&#8220;rhymes with Ninternet Nexplorer&#8221;<br />
.<br />
I love good comments</p>
]]></content:encoded>
	</item>
</channel>
</rss>

