Remote IDEs bring speed and productivity benefits to software teams. Server-class machines lead to faster performance and reduced cycle time between changing code and seeing the result. For developers, this means faster onboarding and less time troubleshooting environments.
However, it’s important to make remote IDEs feel as fast, if not faster, than local machines. In this post, we’ll cover latency.
As demonstrated by a typing latency simulator, delays immediately impact your productivity. Even with powerful servers, a reliable connection is just as important.
In this post, we’ll refer to “latency” as the connection delay between the developer (client) and workspace (server), and not operations inside the workplace itself (compiles, builds, tests) as those are unaffected by the user’s internet speed.
Let’s take a look at how we can tune remote workspaces to have the “snappy” experience we know and love.
First, we recommend using servers close in proximity to your developers! 🌎
At Coder, we have a distributed engineering team. Our developers can pick between servers in the United States, United Kingdom, Spain, Australia for the optimal experience. If engineers join from another location, we can quickly deploy another workspace provider in that region to support them.
If you are using a managed development platform, this is not something you can control. If geolocation and network speeds are important to you, self-hosting with your workspaces is advised. You can use software such as Coder, Gitpod, or a homegrown solution.
If you’re developing through a virtual desktop solution (e.g VDI, RDP, VNC), the overhead from streaming an entire desktop environment will often result in additional latency.
Whenever possible, we recommend using native IDEs (web-based or desktop). With VS Code and JetBrains remote development extensions, you can develop directly on remote workspaces with low latency.
If you still need to access desktop-only apps, you can still use your virtual desktop to complement your IDE, potentially all through the same workspace.
If you need fast remote desktop access, Parsec is an emerging tool to keep an eye on. At the time of writing, it only supports Windows and macOS hosts.
Reducing proxies and network hops provides users a snappier and more reliable experience, which is why we went through the effort of implementing a peer-to-peer network architecture in Coder. As a result, we have achieved a 68% latency reduction, as measured by our workspace ping utility (61.23ms to 29.92ms) for our internal developer workspaces.
While your own performance improvement may vary depending on your network topology, in general, reducing the number of network hops and the physical distance between your computer and the server will reduce your perceptible latency.
For those who prefer to use vim/terminals development, mosh is a great tool for reducing perceived latency in SSH connections.
Mosh particularly comes in handy if you are on a limited internet connection, or if you’re far away from the data center.
You may find yourself in cases where you’d like to access your workspace without a stable internet connection, such as on an airplane.
We plan to cover this in a dedicated blog post, but our general recommendation is to define your remote workspaces with non-proprietary tools. With Dockerfiles, devcontainers, or standard VM images, you can optionally run your environments on local machines for an, albeit slower, offline development experience. Once an internet connection is restored, you can sync files back to your remote workspace.