7 ms·
Pretty much what I predicted here: https://news.ycombinator.com/item?id=16054674 https://news.ycombinator.com/item?id=16054674 > Sounds like servers handling l
by contrarian_ 9y ago
Pretty much what I predicted here: https://news.ycombinator.com/item?id=16054674 https://news.ycombinator.com/item?id=16054674
> Sounds like servers handling lots of small UDP packets would be hit pretty hard.
- tgb 9y agoSince they describe this as log-in issues, should we expect that to be a server using lots of UDP? Or do you think that the log-in service is hemmed in by the load on the game servers?
- dogma1138 9y agoNo, login in Fortnite is over 443 and it uses normal HTTPS. It also uses HTTPs to load a lot of other data such as server data, friends list, chat etc. Unreal Engine comes with a version of chromium built in which is used for many in game things like social tabs, news, and in game purchases these all work over HTTP/S. Game data is sent over 5222 TCP.
- _wmd 9y agoThere's potential for a little rearchitecting to help, at least in the case of UDP: NAME sendmmsg - send multiple messages on a socket SYNOPSIS #define _GNU_SOURCE /* See feature_test_macros(7) */ #include <sys/socket.h> int sendmmsg(int sockfd, struct mmsghdr *msgvec, unsigned int vlen, unsigned int flags);
- contrarian_ 9y agoYep, I was actually debating whether I'd mention sendmmsg/recvmmsg in my original post but I left it out. Definitely an option for UDP, but you're out of luck if your game server uses TCP (surprisingly many do) because you have to recv from each socket separately.
- _wmd 9y agoThere may still be some options depending on the structure of your server and where the added CPU load is hurting most, for example, shunting IO to a thread/threadpool where futex() calls (if necessary) only occur for every N IO requests, rather than pay the syscall price for every IO on the main thread. But that might introduce new latency/ordering problems all of its own
- dogma1138 9y agoThe majority of online games use TCP these days with good prediction it’s more reliable than UDP.
- Demiurge 9y agoLatency is more important than reliability for online gaming because the world state instantly gets stale. Instead of retransmit you want latest snapshot. I'd be curious to find out in what online games that is not the case.
- dogma1138 9y agoLatency isn’t an issue today what so ever, it’s not like UDP also has a magical lower latency it had in the past because of smaller packets and slower computers but today? Online games work today with fixed ticks and polling usually at half of full frame rate which means that the server updates and polls the client 30 or 60 times a second or any other even multiplier of the expected synced frame rate.
- dogma1138 9y agoFortnite doesn’t use UDP at all (80, 443 and 5222 all TCP), UE4 uses TCP for its network stack by default.
- kevindqc 9y agoAre you sure? I would be extremely surprised if it wouldn't use UDP. For things like getting stats, probably from a HTTP endpoint, sure, but for gameplay? The lag would be very bad, no? Lose a packet and everything is slowed down I see this, which indicates it uses UDP: https://imgur.com/al6KTwT https://imgur.com/al6KTwT and according to wireshark it's used heavily when in a game, so I assume that's the gameplay protocol. Also when I left my game (but stayed in the lobby), immediately the port 61879 stopped listening. I'm not sure about UE4, but previous versions of the unreal engine used UDP for replication and RPC.
- dijit 9y agoIt's not entirely uncommon to have TCP on the backend even for AAA games. I worked on a huge open world third-person shooter always-online AAA game and it uses TCP for everything.
- kevindqc 9y agoInteresting. I know World of Warcraft uses TCP, but I imagine it's less "real-time" than shooters (ie: no hitscan) so a few dropped packets wouldn't have a huge impact (ie. if you're standing casting a spell for 2sec, the game can recover the lag easily). Didn't know some shooters used TCP
- vvanders 9y agoNope, it might use TCP for negotiation of things that aren't time sensitive but it uses UDP for replication[1] as has pretty much every Unreal or Quake based engine since they were first developed. I've worked on a variety of engines which were either UE or Quake based. All of them use UDP for temporal game state updates to avoid head of line blocking[2][3]. [1] https://answers.unrealengine.com/questions/197713/is-replication-and-reliability-made-with-udp-or-tc.html https://answers.unrealengine.com/questions/197713/is-replica... [2] https://stackoverflow.com/questions/39323556/why-do-game-developers-avoid-tcp-and-make-udp-reliable-in-the-application-level https://stackoverflow.com/questions/39323556/why-do-game-dev... [3] https://www.gamasutra.com/view/feature/131781/the_internet_sucks_or_what_i_.php?print=1 https://www.gamasutra.com/view/feature/131781/the_internet_s...
- mtgx 9y agoI wonder if this means Google's QUIC protocol is dead in the water, since it works over UDP.
- dsign 9y agoYou can basically have bigger UDP packets, that will get fragmented and may not make it to their end. As far as I know, in Linux there is no support for multi-packet UDP vectored I/O. I wonder if it would be possible to "simulate" that with a raw socket....
- Thaxll 9y agoGameservers don't handle that many packets because they're limited in the number of player they host. A game a 60hz with 64 players will only receive 3840 packets/sec.
- johnbellone 9y agoI don’t know the game or the engine, but if this is a login service, this is likely traffic from all of the players.
- abstractbeliefs 9y agoAnd then it has to communicate new state to those 64 players 60 times a second for another 3840 reaching 7680 packets per second.
- dxhdr 9y agoAnd then how many game servers can you run on a machine? Hopefully a lot more than just one.