
Show HN: RaspChat a chat system that can handle thousands of users on basic RPi - maxpert
https://beta.raspchat.com/
======
dmitrygr
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...

~~~
niftich
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)

~~~
dmitrygr
not even close to bare metal...

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

50MB!

------
Mehni
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?

~~~
maxpert
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.

~~~
Mehni
Got server load averages? how much ram is used?

~~~
maxpert
1K parallel connections were handled under 100MB of memory. 2K were around
150MB

~~~
dmitrygr
50KB/connection and 50MB fixed cost?!!?

~~~
maxpert
Nops nothing is fixed it's just one scenario, besides your math is wrong.
50KB/connection won't map to 2000 connections.

~~~
RubyPinch
(rate of) change in memory per user

    
    
        150MB    - 100MB
        -------------------  =  50KB/user
        2k users - 1k users
    

no?

~~~
maxpert
if 0 -> 1000 users is 100MB, how can you explain 1000 -> 2000 with 150MB

~~~
throway21312
Fixed cost: 50 MB

Variable Cost: 50KB/user

50 + 1000 * (0.05) => 100 MB

50 + 2000 * (0.05) => 150 MB

Pretty straightforward?

~~~
maxpert
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.

------
stevenhubertron
Very cool, could be very useful for things look like occupy Wall Street or
even on a long plane ride with no internet!

------
niftich
Which parts are Go and which parts are Node?

~~~
maxpert
Backend and server is compiled in Go, NodeJS is only used for asset
compilation (for frontend) and minification.

------
tinboat
This chat is pretty cool I especially enjoy the "/gif" command.

~~~
maxpert
Yep syntax is /gif <keywords>

------
leovarmak
Awesome thing !

------
conchman
nice job on this

