21 comments

[ 1.8 ms ] story [ 61.8 ms ] thread
That's pretty slick looking. I realy like the interface.

I find it hard to believe a Pi can handle thousands of concurrent users though. How does it handle that?

Good to hear you like it. Server is written to be lightweight and keeping things simple helped a lot. NodeJS totally sucked memory, Golang helped a lot in that perspective.
Got server load averages? how much ram is used?
1K parallel connections were handled under 100MB of memory. 2K were around 150MB
50KB/connection and 50MB fixed cost?!!?
Nops nothing is fixed it's just one scenario, besides your math is wrong. 50KB/connection won't map to 2000 connections.
(rate of) change in memory per user

    150MB    - 100MB
    -------------------  =  50KB/user
    2k users - 1k users
no?
if 0 -> 1000 users is 100MB, how can you explain 1000 -> 2000 with 150MB
Fixed cost: 50 MB

Variable Cost: 50KB/user

50 + 1000 * (0.05) => 100 MB

50 + 2000 * (0.05) => 150 MB

Pretty straightforward?

Well if that's the math that works for you, but I won't assume anything here. If I would have written it in C or Rust lang I would have given quoted a more deterministic memory usage. Bottom line, benchmarks just quoted numbers. Should have put up a Notice disclaimer in comment as well.
Which parts are Go and which parts are Node?
Backend and server is compiled in Go, NodeJS is only used for asset compilation (for frontend) and minification.
This chat is pretty cool I especially enjoy the "/gif" command.
Yep syntax is /gif <keywords>
WARNING: yes, i am going to be THAT guy...

.

.

.

It amazes me that "thousands" of users sending simple messages is considered impressive nowadays on a machine with a xxxxMHz CPU and at least xxxMB ram.

This was being done decades ago on xxMB ram and xxxMHz.

sister comment says 100MB/1K connections, 150MB for 2K, so 50KB/connection and 50MB fixed cost?!!?

-

Dump Javascript/Go/$RANDOM_LATEST_BUZZWORD_7 and learn how to program [in C] if you actually want an impressive number of users per MHz/per MB

This is doable on a Cortex-M4 and an ethernet MAC...

The chat portion was written in Golang, so it's compiled and running on bare metal (edit: okay, PL0 or ring-3, like most software today)
not even close to bare metal...

Go runtime, GC, random userspace bits this is on top of

50MB!

Just quoted the benchmark numbers, that were observed there is no fixed cost ofcourse! Here is the deal, it's not something to impress people (specially THAT guy), but proof of concept that if you know how to implement something a RPi is enough. I also know IRC and XMPP has already done this, and these are the system that inspire modern systems like Slack (for which you will be happy to pay). This project started of for me to put my RPi to use, and you know what it's quite useful so far. So ya nobody needs to be impressed, I am just an engineer building toys to increase my experience.
Very cool, could be very useful for things look like occupy Wall Street or even on a long plane ride with no internet!