Live data from Hacker News

High-Throughput Game Message Server with Python WebSockets

mortoray.com

51–60 of 61 posts

Re: High-Throughput Game Message Server with Python WebSockets

#51

Earlier quoted context omitted.

I feel like I have to ask: where are you getting a server that'll run arbitrary erlang code for 2 bucks a month? The absolute cheapest I've seen seems to be 5, from digitalocean/linode

There are a few websites which aggregate VPS offers, for example https://lowendbox.com/ or https://lowendstock.com/ However, you usually get what you pay for, so be prepared for - long and frequent server outages - tech support which takes weeks to respond or no tech support at all - IP changes without warning - system images which have last been updated 5 years ago - machines which simply fail to reboot - retroactiv…

Fair warning you've posted, I'd say with a caveat some of the cheap ones are good enough.

There's also a community that [0] splintered off the ones you mentioned that are not ColoCrossing centric unlike LET/LEB. I'd bought hundreds of servers there over the years (with cost being a main factor) and it tended to be the Colocrossing ones that'd be volatile or not last your entire billing period.

For specific servers/recommendations, I have a few servers with Ramnode (might be a grandfathered service) for $15/y. There are a bunch of good providers in that price range but without knowledge of them they can be hit and miss and for the most part makes it worthwhile paying more to worry less about it.

[0] https://talk.lowendspirit.com/

Re: High-Throughput Game Message Server with Python WebSockets

#52
post #23

Earlier quoted context omitted.

That's quite a ridiculous statement in this context. Even highly-trained, extremely smart developers are proven to not be able to use C without introducing gaping security holes. That's not "it can hurt you". That's "it hurts you and everyone that is exposed to your RCE machine".

C is not C++. There is a reason core services for DHCP, DNS, etc are built in C and not Rust. If you're a careless developer you can have security vulnerabilities in any language.

That's only true on Linux and other systems where the kernel has been written in C. On some platforms the kernel provides no backwards compatibility guarantees and that means backwards compatibility is handled by libc. This means C is enshrined into the platform and often the path of least resistance.

There was also a pure Rust Wayland binding that failed because Wayland assumes that you are using C semantics which made it hard to provide a safe interface for Rust that was also convenient.

Re: High-Throughput Game Message Server with Python WebSockets

#53

Looks like a perfect case for erlang. And while we are at it, one of existing xmpp servers written in erlang. One puny $2/month server will serve thousands of users without sweating.

I feel like I have to ask: where are you getting a server that'll run arbitrary erlang code for 2 bucks a month? The absolute cheapest I've seen seems to be 5, from digitalocean/linode

[deleted]

Re: High-Throughput Game Message Server with Python WebSockets

#54

Author contemplating an eventual C++ rewrite, but this is a perfect use case for Rust. When you want performance and where memory mistakes can be a serious security problem.

Or anything that isn’t a scripting language

indeed, C#/Go/Java etc would all be a big boon without the mental overhead of Rust. Data races being caught at compile time is also nice though when doing a multithreaded server.

Re: High-Throughput Game Message Server with Python WebSockets

#55
post #4

Earlier quoted context omitted.

Or java

I used to be on the java hate train, but honestly the JVM is magic for infra. I worked at AWS, and I groaned so hard when I started. Then, I came to appreciate it because of the tooling and the types of issues that actually cropped up. This may also be stockholm syndrome.

the nice thing about Java is you get pretty good performance even while pretending the hardware concerns don't exist. This takes a lot of things to think about off your brain. The downside is you can't choose to think about them even if you want to.

Re: High-Throughput Game Message Server with Python WebSockets

#56
post #46

Earlier quoted context omitted.

> but this is a perfect use case for Rust Idk it seems like for someone prototyping things alone, Python is the perfect langauge

I don't think the parent is disagreeing with that, but the article mentions graduating from Python to something else, which is where the recommendation fits. Parent isn't saying the article's original version should be in Rust.

got it thx

Re: High-Throughput Game Message Server with Python WebSockets

#57

Earlier quoted context omitted.

As with any tool, if you don't use it properly it can hurt you.

That's quite a ridiculous statement in this context. Even highly-trained, extremely smart developers are proven to not be able to use C without introducing gaping security holes. That's not "it can hurt you". That's "it hurts you and everyone that is exposed to your RCE machine".

Have you looked at code by AntiRez, the author of Redis? Redis is written in plain C.

What about QMail and DJBDNS, from Dan Bernstein? Again, all C.

And the mother of all: the Linux kernel. Again, in C.

Re: High-Throughput Game Message Server with Python WebSockets

#58
post #23

Earlier quoted context omitted.

C is not C++. There is a reason core services for DHCP, DNS, etc are built in C and not Rust. If you're a careless developer you can have security vulnerabilities in any language.

The reason they're built in C is legacy and the fact that Rust hasn't been around all that long.

Well, what's stopping you from rewriting it in Rust?

Re: High-Throughput Game Message Server with Python WebSockets

#59
post #37

Earlier quoted context omitted.

Memory fragmentation is generally a problem for pets, not cattle. In 90% of use cases it’s nothing that frequently reaping processes won’t fix. This works regardless of language, as it pushes the job of garbage collection onto the os. Another nice feature of treating your processes like dirt is that you tend to get high fault tolerance and scalability as emergent properties.

I really think it's a good solution for many cases but I haven't seen any server-side web framework that implements a kill-the-process-often strategy. Do you know of any? If so, when do they decide to kill the process and how do they handle client disconnect?

Some pre-forking web servers will shut down a child process after it has processed a configured number of requests.

E.g. Apache in mpm_prefork mode, MaxRequestsPerChild configuration.

Re: High-Throughput Game Message Server with Python WebSockets

#60

Earlier quoted context omitted.

That's quite a ridiculous statement in this context. Even highly-trained, extremely smart developers are proven to not be able to use C without introducing gaping security holes. That's not "it can hurt you". That's "it hurts you and everyone that is exposed to your RCE machine".

Have you looked at code by AntiRez, the author of Redis? Redis is written in plain C. What about QMail and DJBDNS, from Dan Bernstein? Again, all C. And the mother of all: the Linux kernel. Again, in C.

Redis has RCE exploits which would not exist in a memory safe language [1]. QMail had an RCE as well[2] and DJBDNS has had a security bug which would not have occurred in a memory safe languages [3]. The linux kernel has had an incredible amount of memory bugs over the years. The software you mentioned does much, much better then the average C written code. But it still has had issues with memory. So in fact all your examples prove my point.

[1] https://github.com/jas502n/Redis-RCE

[2] https://www.qualys.com/2020/05/19/cve-2005-1513/remote-code-...

[3] https://web.archive.org/web/20190126114638/http://article.gm...

Post reply on HN