Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
slact
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
by
slact
11y ago
After last week's discussion [1], I've made some improvements and bumped up this project from alpha to beta status. I've also run some benchmarks, and they're reasonably impressive. New subscribers, HTTP multipart/m
2.
▲
Nchan, a pub/sub module for Nginx: 64K websockets in .2sec
(nchan.slact.net)
2 points
by
slact
11y ago
|
1 comments
3.
▲
by
slact
11y ago
Thanks! I'll be adding a sample JS subscriber client and some sample code with that as well.
4.
▲
by
slact
11y ago
> besides directive prefix The old setting is still recognized. > Subscribers" section of "Push Module" should include websocket Nope, push module didn't do websocket. You may be thinking of the Push _Stream_ modul
5.
▲
by
slact
11y ago
> global message id / global channel Yeah, I don't have global ids. every message is bound to the channel it was published to. But I do understand that for your use case, (user + arbitrary list of groups), you'd need a goo
6.
▲
by
slact
11y ago
No, ack/nack would need to be implemented in the client or the application. However, messages do not disappear from the queue when received. All subscriber requests are idempotent, and can be repeated so long as the message queue is st
7.
▲
by
slact
11y ago
Nice project, and a curious featureset overlap, too... > We have a concept of "reliable pub sub" [...] Does the redis store you have do something similar (I can not see backing lists in the redis store implementation in store.
8.
▲
by
slact
11y ago
Well, if it ain't broke, as they say... here's a page on the differences between Nchan and the Push Module: https://nchan.slact.net/upgrade . One important thing I forgot to add is that the Push Module suffered fr
9.
▲
by
slact
11y ago
That's correct, that feature is for authentication only. I may add a feature to replace the message with the back end response. By multiplexing I mean that a single websocket (or any other) subscriber can subscribe to multiple channels
10.
▲
by
slact
11y ago
Yes. All messages are buffered for a configurable length of time. Longpoll and EventSource clients receive the last message id with each message, and if interrupted can be resumed from there provided the message has not timed out. I don
11.
▲
by
slact
11y ago
Yes, backend-authenticated access control is possible. See https://nchan.slact.net/details#authenticate-with-nchan_auth...
12.
▲
by
slact
11y ago
Yep, I'll be adding an example js client, but I don't intend on standardizing this. Mostly because I'm also a js guy and I like mootools, and I don't want to start a best-js-framework flamewar with an official client. Bu
13.
▲
by
slact
11y ago
> the execution of middlewares when a user publishes a message (to filter them or something else) You can do that with nchan: https://nchan.slact.net/details#authenticate-with-nchan_auth... > Right now, I'm usi
14.
▲
by
slact
11y ago
Nchan is about 12K lines of C, I'd say 2-5K of that is dealing with Nginx guts. To get rid of Nginx entirely, you'd need to add an event loop, forking and multiprocess management, config parsing and reloading, and shared memory al
15.
▲
by
slact
11y ago
I'm not familiar with MQTT, I've just glanced over the spec right now. Nchan is basically a message broker with channels, optimized for message broadcast. MQTT is a TCP-level protocol, whereas all the currently implemented subscri
16.
▲
by
slact
11y ago
Interesting, I'll read through this. Nchan code is quite modular, so it would be pretty easy to add some kind of negotiation like this. Let's talk more. For reference, here's the old document I wrote for the long-polling prot
17.
▲
by
slact
11y ago
Yes, this is a different project, although they are related. Push Stream is a fork of my Nginx HTTP Push Module, so they both descend from the same original codebase. Push Stream uses a blocking concurrency model, whereas Nhan is completely
18.
▲
by
slact
11y ago
I consider those two and socket.io my main competition. Nchan is built to scale, but of course you'd need some numbers to back that up. I plan on doing benchmarks once I iron out the documentation, although I realize it would be a grea
19.
▲
by
slact
11y ago
Well, it would be very easy to make a realtime 4chan-like thing with Nchan, but it's far from the only use case. It's a general-purpose server and pubsub proxy. The name is a play on nginx and channels. I got tired of saying "
20.
▲
by
slact
11y ago
This is a huge refactoring of an old project of mine -- the Nginx HTTP Push Module. I'm wondering if anyone here has used it. Most importantly, I want feedback on the documentation. Did I overcomplicate things? Does it need more exampl
21.
▲
Show HN: Nchan – a pub/sub server as an Nginx module
(nchan.slact.net)
149 points
by
slact
11y ago
|
41 comments
22.
▲
by
slact
17y ago
Everything is pretty much as efficient as vanilla nginx. There are some O(log(n)) lookups, but i've not noticed CPU usage hit anything even remotely suspicious (fixed bugs aside). Memory usage for long-polling requests is regular nginx usag
23.
▲
by
slact
17y ago
Beep. I wrote this. Questions, comments -- ask away.
24.
▲
NGiNX HTTP Push Module - turn nginx into an adept long-polling Comet server.
(pushmodule.slact.net)
1 points
by
slact
17y ago
|
0 comments
25.
▲
by
slact
17y ago
hey guys, I'm responsible for this frankenstein of a creation. I am 2 bugs away from a release with quite a few essential improvements. (of course, the bugs in question seem to be concurrency related, so it might take a day or two or more t