Live data from Hacker News

Modern messaging: Running your own XMPP server

codedge.de

21–30 of 156 posts

Re: Modern messaging: Running your own XMPP server

#21

Earlier quoted context omitted.

If you’re running a single machine, you’ll be limited by the number of available ports. It’s a TCP limitation and nothing to do with XMPP. You’d need a cluster of XMPP servers to handle 40M users. Even for just text. Port limits are port limits.

40M users don’t all simultaneously send messages, or does XMPP need to sustain an open connection to each user?

Yes, you need to have open connection to receive messages.

Re: Modern messaging: Running your own XMPP server

#22
post #9

Any idea what kind of server we’d need to handle 40M users if it’s just text chat (no files or audio)?

If you’re running a single machine, you’ll be limited by the number of available ports. It’s a TCP limitation and nothing to do with XMPP. You’d need a cluster of XMPP servers to handle 40M users. Even for just text. Port limits are port limits.

You can put multiple IPs on a computer. (Or VMs, LXCs, etc. which would each get an IP)

Now what size of machine?

(I don't really care, and the original question does have a whiff of malicious intent, but scaling discussions are sometimes interesting...)

Re: Modern messaging: Running your own XMPP server

#23
post #12
post #8

Earlier quoted context omitted.

what about - single point of failure of rooms (server creating the chat room) - media access via 3rd party servers - gossiping encrypted message access across multiple devices - encrypted audio-visual (group) communication - good clients for iOS - reliable server-side storage of messages (of all(!) chats) - realistic verification concept for e2ee with multiple devices

Not my project, but I was hoping to see more stuff like https://prose.org/ As others have pointed out, for iOS Monal is good.

> for iOS Monal is good.

Monal looks like something that would be good in 2005, not 2025. There is no way you'll convince people nowadays to use it unless you force them to.

Re: Modern messaging: Running your own XMPP server

#24

Earlier quoted context omitted.

If you’re running a single machine, you’ll be limited by the number of available ports. It’s a TCP limitation and nothing to do with XMPP. You’d need a cluster of XMPP servers to handle 40M users. Even for just text. Port limits are port limits.

You're thinking of outbound port limits. Inbound connections all come in on the same port and there's no port-related limits there. The real limits are going to be on hardware. If we want 40M concurrent connections, the server will need a few hundred to a few thousand gigabytes of memory.

Unless you're doing multicast or anycast, there's a port bound IP handshake that happens. You have your listener (your server port) and the connected TCP/IP client (client port, on the server machine). You're limited to 64533 clients (0-65535 but the first 1000 are reserved). If there's a way to get more client on a single machine, I'm all ears - but that's baked into IP protocol. TCP/UDP doesn't matter. It's a limitation of IP.

Assume 10% of 40M users are active at once. That's 4M clients to deal with. You would need 62 servers (and probably a few for cache) to handle the load. But those could be small core cheap servers.

Re: Modern messaging: Running your own XMPP server

#25
Does anyone use ejabberd inside a wireguard network? I'm hoping to set it up on the main server, and connect to it with aTalk on Android - but I'm worried ssl is going to be a pain if it's not exposed with a proper domain name. I don't know if aTalk will accept a self-signed certificate (or even better, just use non-ssl with an address and port without a domain name)?

Re: Modern messaging: Running your own XMPP server

#28
post #14

Last time I tried this I couldn’t even find an iOS client that supported reactions. Hate on the complexity of Matrix all you like, but at least when you ask your family to use it, they get a modern experience and don’t feel like they’re giving up everything vs every other messenger they are used to.

I’m using Monal and it’s decent. Agree reactions are a big thing missing, but notifications etc have been flawless which was a harder requirement for me

Re: Modern messaging: Running your own XMPP server

#29
post #17

One potential issue with XMPP is the default port is commonly blocked on public wifi. There is an nginx-xmpp to proxy it, but it is archived. https://github.com/robn/nginx-xmpp For that reason http based protocol just seems much easier on the network or something that can be easily reverse proxied without extensions will be easier to self-host and have wilder internet connection accessibility.

At least Prosody implements BOSH (xmpp over http) and communication over Websocket.

https://prosody.im/doc/setting_up_bosh

https://prosody.im/doc/modules/mod_websocket

But I never tried it myself and from a quick search the popular non-browser XMPP apps/clients don't seem to use it.

Re: Modern messaging: Running your own XMPP server

#30
Although material like this is extremely important, instructions like 'Fill in the IPv6 addresses accordingly.' are a roadblock to anyone who isn't particularly knowledgeable about networking. You could argue that those people should go away and learn, but not everyone has the time or frankly the ability to do so.
Post reply on HN