Central servers: issues and possible approaches #1035
Replies: 55 comments 76 replies
-
The reason they were split still exists. At the moment, the list can get fragmented if too large and, where UDP fragmentation causes routing issues, this can cause the list to become only partially visible. I'd also note that All Genres is pretty close to full, so something is going to need to be done one way or another. As a further point, having the client poll a very large list of servers, most of which they won't be using is a waste of resources both on that client and on every server in the list. |
Beta Was this translation helpful? Give feedback.
-
It feels strange that we would use genre as a means of solving this scalability issue. Normally I would rely on pagination for that. The client only gets 50 servers or so from the server, then if they want they can request the next 50 and so forth. The problem is that we can't send them the 50 servers with the lowest ping since the client needs to compute the ping for all the servers before it can sort them. Would it be possible to sort by distance instead of ping? The user experience should be comparable even if the ordering is slightly different. We can get/cache the locations using the client and server IPs. This would also get rid of the ordering issues when pings fluctuate, and the time required for the servers to sort when switching genres. I'm also curious how much of this scalability issue is client vs server (jamulus.fischvolk.de). |
Beta Was this translation helpful? Give feedback.
-
Distance from the server list? That wouldn't help much. To sort per client, it would have to have some way to compute -- on every client request, every two seconds -- the distance between the client and every server. That sounds like a lot of work. And physical distance isn't much use when it's the ping time that's important. I get half the ping to Frankfurt than Cardiff from London. Even Zurich is better than some places in England. |
Beta Was this translation helpful? Give feedback.
-
Sort per client yes. We wouldn't necessarily need it to update every two seconds though. The initial request (to central server) would just run once (with a refresh button to re-query). It would require looping through every server, but if you can cache the IP -> location mapping, then you'll just have to do a bit of basic math per server per request: https://stackoverflow.com/a/27943. You may even be able to avoid checking every server if they are stored in a data structure that is organized by location. Once the client has the 50 servers, it can poll them every 2 seconds for the ping/musicians. For the Frankfurt vs Cardiff example, my hope is that all those servers would appear near the top of the list, so while the lowest ping may not appear first, it would be easy enough to find. |
Beta Was this translation helpful? Give feedback.
-
The genre-based system is not ideal and has some clear disadvantages. So if the CS limit issue could be solved in a different way that would be nice.
That's an an interesting observation I think because most people will only have a handful of fast enough servers to use anyway, and once they find one they're probably not going to care about sort order after that. So a "rough" sort on location (however that's done) should be fine even in a list of 50 I would think. Similarly with a fresh button: servers and players don't churn very fast, so I doubt you'd need to hit the button more than a couple of times before joining a server for a jam. I take it also that servers would attempt to register on all central servers and go with the first free slot they were given? |
Beta Was this translation helpful? Give feedback.
-
It may be advantageous to separate the query that gets the 50 servers from the query that checks players. With the current system, does each server report the players to the central server, then the central server reports the players to the client, or does it work like ping where each client asks the server directly?
What do you mean by a "free slot"? The simplest set up would be to have one central server with a single unified list of servers. Depending on the load it gets, this could be done with a single beefy computer or require load balancing between multiple computers (still with a single domain and shared unified list). Load balancing may be tricky, although we could tackle it piece by piece, start by implementing the distance sorting, then unify the genres. We need a way to avoid the inevitable issue of a genre having too many servers in it (unless we want to have a jazz1 and jazz2). However, I think this proposal does more than that: it paves the way for some nice improvements to the user experience:
If the user opens Jamulus back up, it would remember the filters so the servers would appear in the same order right away. We could still support filtering by server name or occupied, the server would just find the 50 closest servers that match the name/have musicians. |
Beta Was this translation helpful? Give feedback.
-
Please don't implement a "nearest 50 server" list. I recently moved across 5 timezones. I now have Jamulus friends across 8 timezones. I won't see my friends from my old place with only the nearest 50 servers displayed. Also, my old friends won't see my new server and visit. It has been really great to have old friends dropping in, even if the total delay is >140ms. |
Beta Was this translation helpful? Give feedback.
-
I just checked Jamulus Explorer and there are 78 servers under Genre Classical/Folk/Choir. My client shows 38. Any clue why the number of servers are different? |
Beta Was this translation helpful? Give feedback.
-
Maybe Jamulus should display all servers (ip addrs Or fqdn Or whatever can be displayed) in the list before pinging them instead of not displaying the unpinged servers. Then the list can be sorted by the client as it pings (the way it is now). I think adding heuristics etc. is just adding bloat. |
Beta Was this translation helpful? Give feedback.
-
Would these options be sufficient for your use case?
Additionally, we can make the page size larger than 50. Could probably make it the current max server count per genre without hurting performance. |
Beta Was this translation helpful? Give feedback.
-
The problem with sorting by ping is that you need to ping every server in the list. Creating separate lists per genre has worked for now, but that isn't a long term solution. We shouldn't need to separate "default" and "All Genres", and it should be possible to see all genres in one list if you don't care about what genre you want to play/listen to. This is made especially painful because it takes a while for the servers to sort when switching genres. The location heuristic I think has the potential to actually remove bloat both in the user experience and in the code. For example, we could get rid of the logic that prevents ping sort order changes on mouse hover. |
Beta Was this translation helpful? Give feedback.
-
@gustebeast I would prefer the connection window scroll. "Next" would work also work. It would be nice for the connection window to indicate the number of servers detected. Keep the list simple and just sort by ping times. |
Beta Was this translation helpful? Give feedback.
-
If you don't sort the server list by ping, how will I know how long it will take my packets to reach the server? Also, the ping times could change by network traffic (e.g. time of day). Of course, we don't want the list to churn because of jitter in the ping times. I am sensitive to this issue because I don't live in the center of a metropolitan city. Locations at the edge of the city or further see more delay from fluctuations in network trafic. |
Beta Was this translation helpful? Give feedback.
-
The ping would still be displayed in the same place. It's just a matter of how the list is sorted. If distance is a good enough approximation of ping, you'll still see the low ping servers at the top of the list. Per pljones' example above, there will be cases where a server with a lower ping appears lower in the list, but so long as it is still close to the top, it should be easy enough to look at the pings and pick out the best one. |
Beta Was this translation helpful? Give feedback.
-
What if the client keeps a single list of all servers, only the selected subset would be displayed. I agree that we don't want to be pinging all the servers frequently. We could ping the serves in a slow background process. If we keep the list between sessions, the old data should be a good starting approximation. Then only new users starting the client for the first time would need to have all the servers pinged. I often see some servers that are farther away with shorter ping times. It depends on whether those servers are close to a major backbone. |
Beta Was this translation helpful? Give feedback.
-
Hi all - this seems to be more of a general discussion about central servers. Until we have some agreed definable action to take, I'll move it to a discussion (and update the title) if that's OK. |
Beta Was this translation helpful? Give feedback.
-
What I found to be useful is to just make the serverlist sortable and make it sort by most musicians on a server per default. |
Beta Was this translation helpful? Give feedback.
-
We measure distance by ping, though. |
Beta Was this translation helpful? Give feedback.
-
We have some disagreements, but hopefully we can agree that having Any Genre 1-3 isn't a good solution, especially for new people coming to the platform. I proposed sorting by distance as a means of querying a larger list of servers without spamming too many pings. @gene96817 made good points about there being people for whom that heuristic won't work well (I still have a feeling it would work well enough to get the server you want to join in the top 20). What if we sort by distance by default, then allow the user to sort by ping if desired. When they sort by ping, the client pings all the servers (in a round robin if there are a lot of them). This goes on for a minute or so, then repeats at a slow interval. We can reduce the issue of too much pinging if we make distance the default, and employee some techniques to limit the number of pings for those who choose to sort by ping. Also, I feel like we haven't discussed the other big element here:
Are there any leads on how to fix this? Seems like it should be strait forward to send a block of data down to a client, although I'm used to web development where that stuff is easy. |
Beta Was this translation helpful? Give feedback.
-
If we had geographically distributed directory servers (which we don't -- mine and the Franfurt ones aren't far enough apart in ping time), then a registering server that wanted to provide a public service for jamming (and that is a distinction that needs emphasising) could choose the nearest directory with space to register by default. Similarly, a client run for the first time could ping each directory server a few times to get their ping time and then default to the fastest. That might provide the user with a better experience. Neither of the above should need protocol changes, as far as I can see - they're just different strategies over the existing ping message. But it does need investment in the infrastructure. |
Beta Was this translation helpful? Give feedback.
-
An empty server explicitly means one thing only: no one is using that server. There are a number of possible state transitions:
(OK, the last case could be broken into the individual client connections but that's missing the point.) (My point being, you can't get some random bunch of people turning up without one of them being first.) From there, there are two new states: occupied by a solitary person and occupied by a band. @gilgongo, if I understand correctly, you're suggesting the server with the band hoping for an uninterrupted practice session is likely to attract more people than the solitary player? Personally, I'm put off joining any session with a drummer, as I'm a drummer. That often ends up with me being in that "solitary player" state. I find people drop in just about as often as new people join a jam with multiple players - if I'm keeping track, which is of course harder. |
Beta Was this translation helpful? Give feedback.
-
I had another idea :) For the existing directory servers, change the names (again...) to all have "public" at the front. Both client and server UI dropdowns would have these listed. These would be intended for any server provider granting public access to their server. In addition, in the server UI dropdown (but not the client), add two directory servers with "private" at the front. These would be for server providers who did not intend them to be generally known (so Jamulus Explorer, as a client, should not show them) but to help with the ping-back issue. Ideally server operators would provide their hostname to their userbase, rather than instructing them to enter the private directory server into the client UI. (I'd hesitate before saying prevent that happening, though.) Currently Volker provides one "official" private directory server (I forget the name) and I've got a bunch on the "unused" ports where the genre-specific servers currently aren't -- 22124, 22224, 22624 and 22824. |
Beta Was this translation helpful? Give feedback.
-
The 150 server limit may actually be independent from the client-side problem described here. If we can figure out how to display a large number of servers in a unified list without over-pinging, clients could query all the central servers and compile them into a single list. Responding to the concern about empty servers, private servers, etc. let me summarize a few user stories:
It seems like #1 could be addressed by toggling on/off the "hide empty servers" filter. Maybe it would help if there was a way to highlight/promote the non-empty servers without hiding the empty ones. Having a large number of servers is good for #2 since it gives you more options for finding a closest/best ping server. For #3 I feel similarly to @pljones. We allow private servers to appear in the connection window, but behind a filter that defaults to public. We would either need a way to opt out and fully hide your server, or add a server password for those who want extra assurance no one join. There are a number of techniques being discussed to reduce the number of servers we need to show to the user. This is good both for reducing pings and helping the user get connected more easily. This may be enough to get Any Genre 1-3 down to just Any Genre, but I doubt it will be enough to merge all the genres into a single list. To fully solve the scalability issue, we need a way to sort a list of servers by ping without regularly pinging every server. We may be able to do this with a clever pinging strategy, but I still think distance is our best bet. It has two major flaws:
To address these, here's my proposal:
Once the filter is selected, we can sort the servers by ping. The best ping server may not be the closest, but presumably it is at least in the closest 150. That should mitigate flaw 1. Many servers already provide their location, but it is just a user provided string. Some are quite vague, some use abbreviations like "CDMX, Mexico". I propose that we replace the current For the client, if you try to open the connection window without a location, we would need to show a dialog asking for it, ideally prefilling with a best guess. We could store this location in your profile, but we would need to clarify that it is private. Even better would be if you could choose to make it public. Once we have the location identifiers, we just need to map them into geocoordinates (Spreadsheet from World Cities Database), and then we can compute distance. |
Beta Was this translation helpful? Give feedback.
-
I still think the jumbo UDP problems can be fixed by having Jamulus breakdown the payload to send only small UDP packets. This would then require sending the table in N fragments where each fragment is labeled M-of-N. A lost fragment can be individually requested by the client. The only real distance we have is ping time. Trying to geolocate IP addresses will yield wildly inaccurate positions. Since many servers are up for long periods of time, a slow ping update is adequate. Only a newly installed server will wish for a quick ping update. If the client maintains a persistent server list, it creates opportunities to reduce ping traffic. Consider (1) the client could ask for only servers that had a status change since time T, when the client was last running. (2) most of the server ping times would be similar to the last session. We could immediately update the servers that had less than 70 ms ping, and then do a slow ping update on everything else. (3) the only time the user would notice bad server entry is when the server went offline and no longer answers to a ping. I believe only a restructuring of how we manage ping updates (similar to this) is necessary to significantly reduce the global ping traffic. |
Beta Was this translation helpful? Give feedback.
-
How to make list shorter:
|
Beta Was this translation helpful? Give feedback.
-
So we have three proposals for solving the client-side server count scalability issue:
Number 1 is quite intriguing, but you'll use up your 150 server budget on far away servers rather than pulling ones that are closer (due to it pulling from a circle around the central server). It still may be good enough to get your desired servers in the top 150, but I'm somewhat doubtful. It will also require more pings to the central server to establish an accurate client-central ping. Number 2 is promising, and can be implemented without any changes from server operators or new profile information from clients. I am hesitant though because this hinges on our ability to hide the ping reduction logic. I think it is bound to lead to confusion around why certain servers get ping updates and others do not, although with some time and polish we could address each confusion and improve our heuristics. I like number 3 in part because it is a fairly simple/intuitive design. You specify your location, then you can select 0-150 closest, 150-300 closest, etc. You'll get consistent results each time, and aren't left wondering why a server appears where it does. The additional friction to server operators and clients is a tough pill, but it is also a one time deal. |
Beta Was this translation helpful? Give feedback.
-
Hi Guys, I am having a few thoughts on the topic and hope I can help with these: Jamulus uses UDP to be able to do Audio streaming with as little latency as possible. Regarding the idea to use Pings to estimate distance, I see the following problem:
I'd suggest to focus on filters in the server lists, which the client has full control of, rather than trying to guess, which servers are best for him. Filtering could support:
|
Beta Was this translation helpful? Give feedback.
-
I'm a late participant to the discussion, but it seems to me that the core problem is (1) central servers are limited to 150 listed servers and (2) there aren't enough central servers for all the servers that want to be listed. What about (A) allowing a central server to redirect a query to one of its listed servers and (B) having all servers be able to respond? Go a step further and have the central server redirect ALL queries to listed servers, essentially serving as a load balancer for the queries. |
Beta Was this translation helpful? Give feedback.
-
@gilgongo I've previously requested that we make the column headers clickable on the Connect Setup window, so a user can sort by Server Name, Ping, etc. Maybe add a column for # Of Participants, then make it the default sort? Or add a checkbox for "Show Only Servers In Use" and have it be checked on by default? Or even break the list in two, with separate scrollable tables for In Use and Not In Use servers? There are lots of ways to better expose the In Use servers, we just have to pick one. :) |
Beta Was this translation helpful? Give feedback.
-
Here is how to refine 'ping radius': Of course the client will have to supply the 3 servers with appropriate ping radii, either by responding or initiating pings. |
Beta Was this translation helpful? Give feedback.
-
The server documentation says that "Default" has been deprecated in favor of "All Genres". Can we merge these two lists in the client?
Beta Was this translation helpful? Give feedback.
All reactions