To keep an RDP session alive, set the idle, disconnected and active session limits to Never in Group Policy, and set "End session when time limits are reached" to Disabled. Then set the keep-alive connection interval to 5 minutes or less, so network devices don't close an idle connection. The full checklist:
-
Adjust Timeout Policies:
- Use the Local Group Policy Editor to disable or extend idle and session time limits.
- Modify the Windows Registry for direct control over session timeouts.
-
Enable Keep-Alive Packets:
- Configure keep-alive intervals to send periodic signals, preventing network devices from closing idle sessions.
-
Optimize Network Stability:
- Test port 3389 reachability using tools like Telnet or PowerShell.
- Diagnose and address packet loss and latency issues with continuous ping and traceroute commands.
-
Secure Your RDP:
- Use firewalls, IP whitelisting, and network-level authentication (NLA) to protect your connection.
- Regularly check Windows Event Logs for suspicious activity.
-
Choose the Right Timeout Settings:
- Set the disconnected session limit to Never, so your platforms keep running after you disconnect.
- Set the idle and active session limits to Never as well, and set "End session when time limits are reached" to Disabled.
These steps ensure uninterrupted RDP sessions, keeping trading platforms like MetaTrader or NinjaTrader running smoothly during critical times. QuantVPS customers can also follow the guide to keeping a VPS session active indefinitely. To reconnect faster after a drop, set up RDP auto-login with saved credentials.
Key facts
- An RDP session may disconnect after about 15 minutes with no keyboard or mouse activity. Causes of disconnects
- In the Registry, a value of 0 removes a time limit, and 14,400,000 sets a 4-hour limit. Policy and Registry settings
- Keep-alive packets are very small, typically under 100 bytes. Keep-alive packets
- Packet loss of only 2% to 3% can cause noticeable lag or disconnections. Network checks
- NinjaTrader can use 2 to 4 GB of RAM per session, so a VPS with 16 GB of RAM suits about 3 to 4 heavy sessions. Multi-session limits
Keep your platform running while you're away.
Common Causes of RDP Session Disconnections
Knowing why RDP sessions disconnect is key to avoiding interruptions. These disruptions generally arise from three main areas: timeout policies, network problems, and server configuration errors. Each of these can cut off your session, often at crucial moments like during trading. Let’s break these down to help you tackle them effectively. If the session drops with an error code rather than an idle timeout, see our guide to fixing RDP error 0x3 0x11 on Windows Server 2022.
Idle Timeout and Session Time Limits
In Windows Server environments, idle timeouts are a common culprit. If there’s no keyboard or mouse activity for about 15 minutes, the system may disconnect your session. This can be especially frustrating for traders juggling multiple screens or stepping away briefly.
Even if your trading software is running in the background, the lack of direct interaction can still trigger the timeout. On top of that, some servers enforce session time limits, disconnecting users after a fixed duration - such as 2, 4, or 8 hours - based on the VPS provider’s security settings.
Network Instability
Your internet connection plays a huge role in maintaining a stable RDP session. Issues like packet loss, firewalls filtering traffic on port 3389, or bandwidth congestion can all disrupt your connection.
Firewalls or your Internet Service Provider (ISP) might block or throttle RDP traffic, causing interruptions. Additionally, RDP requires a steady stream of data to keep everything responsive. If your connection speed drops too low or experiences heavy congestion, the session may disconnect to avoid further lags or freezes.
Service or Configuration Issues
Misconfigured servers are another frequent cause of disconnections. Problems can range from conflicting policies and registry settings to resource shortages, forced updates, licensing restrictions, or authentication errors.
For instance, if your VPS runs low on memory or CPU power, Windows might terminate your RDP session to prioritize other processes. This is more likely to happen on budget VPS plans where resources are shared among users - a dedicated algo trading VPS with reserved CPU and RAM sidesteps the problem.
Licensing limits can also come into play. Windows Server has specific rules for how many RDP sessions can run at the same time. If your setup doesn’t allow for multiple connections, you might get disconnected once the maximum number of sessions is reached.
Read next
Configuring Windows Server Policies to Prevent Idle Disconnects

To keep your trading platforms connected and avoid interruptions, you can adjust Windows Server policies to prevent idle disconnects. These settings manage how long your Remote Desktop Protocol (RDP) session can remain inactive before the system disconnects it.
QuantVPS Windows Server VPS plans are ready in under 60 seconds, and 24/7 US-based support can help if a session keeps dropping. Every plan also includes QuantVPS Detect+, which watches your platform, data feed and Remote Desktop and alerts you when something goes wrong.
Using the Local Group Policy Editor
The Local Group Policy Editor is a straightforward tool for managing RDP-related policies. To open it, press Windows + R, type gpedit.msc, and press Enter. Then navigate to:
Computer Configuration -> Policies -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Session Time Limits
Here are the key policies to configure:
- Set time limit for active but idle Remote Desktop Services sessions: This determines how long an idle session can stay connected. To remove idle timeouts, set it to Enabled with the limit set to Never, or disable it; either way Windows allows unlimited idle time by default.
- Set time limit for disconnected sessions: Controls how long a disconnected session stays available for reconnection. Set it to Enabled with the limit set to Never. When a disconnected session reaches a time limit, Windows deletes it and closes every program running in it.
- Set time limit for active Remote Desktop Services sessions: Defines the maximum time for an active session. For uninterrupted trading operations, set it to Never or disable this policy to allow unlimited session time.
- End session when time limits are reached: Set this to "Disabled" to ensure sessions are only disconnected (instead of terminated), preserving running applications.
These changes only apply to new RDP sessions. You may need to disconnect and reconnect to activate the updated settings. If Group Policy Editor is unavailable, the Windows Registry can be used for direct modifications.
Modifying the Windows Registry
If you prefer direct control or don’t have access to the Group Policy Editor, you can make changes via the Windows Registry. To do this:
-
Open the Registry Editor by pressing Windows + R, typing
regedit, and hitting Enter. -
Navigate to:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services If this key doesn’t exist, you’ll need to create the necessary folders. -
Configure the following DWORD values (in milliseconds):
-
MaxIdleTime: Sets the idle timeout. Use
0to disable idle timeouts. For a 4-hour limit, enter14,400,000. -
MaxDisconnectionTime: Specifies how long disconnected sessions are kept available. Set this to
0for unlimited time. -
MaxConnectionTime: Defines the maximum duration for active sessions. Use
0to remove time limits.
Set-ItemProperty 'HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Terminal Services' -Name MaxDisconnectionTime -Type DWord -Value 900000 -
MaxIdleTime: Sets the idle timeout. Use
Reminder: Always back up your registry or create a system restore point before making changes.
Applying and Verifying Changes
After configuring the policies, you’ll need to apply them. For Group Policy changes, run the following command in a Command Prompt to enforce the settings immediately:
gpupdate /force
If you want the changes to take effect right away, restart the server. Keep in mind, these updates only apply to new RDP sessions, so you’ll need to disconnect and reconnect to test them.
To confirm your changes, check the relevant registry paths, such as:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services
or
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
You can also test by leaving an RDP session idle for longer than the previous timeout setting. If the session remains active, your changes are working. If you see a system message that your session ended due to inactivity, double-check the MaxIdleTime policy to ensure it’s correctly configured.
Finally, remember that Group Policy settings override default configurations, and computer-level policies take precedence over user-level ones. Be sure to review settings for potential conflicts.
Setting Up RDP Keep-Alive Packets
Keep-alive packets are small signals sent periodically to inform network devices and firewalls that your RDP session is still active. These packets are crucial for preventing network devices from terminating inactive sessions, ensuring uninterrupted operations - especially important for tasks like trading that demand constant connectivity.
Configuring Keep-Alive Intervals via Group Policy
The "Configure keep-alive connection interval" policy determines how often your server sends these packets to maintain the session. This is particularly useful for avoiding disconnections caused by firewalls or network devices that automatically close idle connections.
To enable keep-alive packets:
-
Press Win+R, type
gpedit.msc, and hit Enter to open the Group Policy Editor. - Navigate to Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Connections.
- Locate the policy named Configure keep-alive connection interval.
Once there:
- Double-click the policy, select Enabled, and enter the keep-alive interval in minutes, from 1 to 5 (for example, 5). The interval sets how often the server checks the session state. If you're still experiencing disconnections, try a shorter interval, such as 1 or 2 minutes.
-
After configuring the policy, click OK and apply the changes immediately by running the following in Command Prompt (as Administrator):
gpupdate /force
To ensure the changes apply to active RDP services, restart Terminal Services by running:
net stop termservice && net start termservice
Note: Restarting Terminal Services will disconnect all current RDP sessions. Make sure to plan ahead if others are connected to the server.
Testing Keep-Alive Effectiveness
After configuring keep-alive packets, it's important to test their functionality. Leave your RDP session idle for a period longer than your previous timeout duration. If the keep-alive packets are working, your session should remain connected.
For a more detailed check, use a network analysis tool like Wireshark to monitor RDP traffic on port 3389. Look for regular TCP keep-alive packets being sent at the interval you set. These packets are typically very small (under 100 bytes) and serve as a signal to maintain the connection.
If disconnections persist even after enabling keep-alive packets, the issue might lie within your network infrastructure. In such cases:
- Work with your network administrator to whitelist RDP traffic or adjust firewall timeout settings.
- Test your setup at different times of the day, as network performance can vary depending on traffic load or scheduled maintenance.
Properly setting up keep-alive packets can significantly improve connection stability, ensuring a RDP experience for critical tasks like trading.
Maintaining Stable Network Connectivity
Network instability can disrupt RDP sessions even when everything seems properly configured. Addressing connectivity issues early is key to ensuring uninterrupted performance, especially during critical trading activities.
Remote desktop
Your trading computer. In the cloud.
Connect and control your trading strategies from any device, anywhere in the world, through secure remote desktop, while execution remains on QuantVPS.
Choose your cloud trading computerFrom $29.99/mo · Windows or Linux
Testing RDP Port Reachability
To check if your RDP port is accessible, you can use Telnet. Open Command Prompt and run:
telnet your-server-ip 3389
If the connection succeeds, it means port 3389 is open. If it fails immediately, the port is likely blocked.
For a more detailed check, PowerShell's Test-NetConnection command is a great alternative:
Test-NetConnection -ComputerName your-server-ip -Port 3389 -InformationLevel Detailed
This command provides a deeper look at the connection attempt, including ping results, TCP connectivity, and route tracing. Focus on the "TcpTestSucceeded" field - it should display "True" if the port is accessible.
If port 3389 is blocked, consider switching to a non-standard port like 3390 or 4433. This can help bypass basic firewall restrictions and adds a small layer of security by making your RDP service less obvious.
Diagnosing Network Interruptions
Issues like packet loss and high latency can severely impact RDP performance. Even a minor packet loss of 2-3% can result in noticeable lag or disconnections - something traders can’t afford during time-sensitive operations.
To diagnose, use a continuous ping for 10–15 minutes:
ping -t your-server-ip
Follow this with a tracert command to identify where latency spikes occur:
tracert your-server-ip
Traceroute results display each step between your device and the server. If you notice high latency or timeouts at specific hops, it points to problematic segments. For example, if the issue is with your ISP (usually the first 2-3 hops), you’ll need to contact them. If the problem is further along the route, it might require assistance from your VPS provider.
Another useful test is adjusting the MTU (Maximum Transmission Unit) size. Start with a packet size of 1472 bytes and gradually lower it (e.g., to 1300 bytes) until pings succeed. Once you find the optimal size, configure your network adapter to use that MTU setting.
After verifying your network performance, the next step is securing your RDP service from external threats.
Protecting RDP Services from External Threats
Once your connection is stable, it’s crucial to shield your RDP service from external attacks. Brute-force attempts and denial-of-service (DoS) attacks can overwhelm your server, making it hard for legitimate users to connect.
Start with Windows Firewall to implement basic protections. Configure account lockout policies to temporarily lock accounts after five failed login attempts. This helps prevent automated attacks while still allowing legitimate users to regain access quickly.
For stronger security, use IP whitelisting. This ensures only connections from trusted IP addresses - such as your home, office, or mobile carrier - are allowed. If you’re using a dynamic IP address, consider setting up VPN-based access. This way, you can connect to a VPN first, then establish your RDP session through the encrypted VPN tunnel. The VPN provides a consistent IP address for whitelisting and secures your data.
Enable network-level authentication (NLA) for all RDP sessions. This feature requires users to authenticate before a full RDP session is established, reducing server load from failed login attempts. You can enable NLA through the Remote tab in the System Properties dialog.
Regularly check your Windows Event Logs for signs of attacks. Look for Event ID 4625 in the Security log - this indicates failed login attempts. If you notice repeated failures from the same IP address, it could signal a brute-force attack. On Windows Server, the account lockout policy above slows these attacks, and free tools such as IPBan, which runs on Windows, can block an IP address after repeated failed logins.
Lastly, monitor your bandwidth usage. Sudden spikes in traffic, especially on port 3389, may indicate an active attack. Many VPS providers offer tools to track bandwidth usage, making it easier to spot unusual activity and take action before it affects your trading sessions.
Best Practices for Traders Using RDP
If you're trading using Remote Desktop Protocol (RDP), keeping your connection stable is crucial. A single interruption could mean missing out on profits or, worse, incurring losses. Below, we examine practical tips for traders to ensure smooth RDP sessions. If you are setting up a new server, a full QuantVPS setup walkthrough covers connecting, installing platforms and managing the VPS.
Set Optimal Disconnect Settings
When stepping away from your trading desk, always choose to disconnect rather than signing out. Why? Disconnecting keeps your trading platforms - like MetaTrader, NinjaTrader, or TradeStation - running in the background. Signing out, on the other hand, shuts everything down, including active charts, strategies, and open orders.
To disconnect, simply close the RDP window or click the "X" button in the connection bar. If you're running automated strategies or overnight trades, enabling the auto-reconnect feature in your RDP client is a smart move. Most RDP clients, including the built-in Windows Remote Desktop Connection, have this setting available in their advanced options.
For fast access during high-volatility moments, consider using saved RDP files (.rdp files). Pre-configuring these files with your connection settings can save you precious seconds when every moment counts.
Lastly, make sure your VPS is equipped to handle multiple sessions without resource conflicts to keep everything running smoothly.
Managing Multi-Session Environments
Many traders use multiple RDP sessions to monitor different markets or accounts. While this can be effective, it also requires careful resource management to avoid disruptions.
- Avoid duplicate sessions: Running the same trading platform in multiple sessions can lead to data conflicts. Instead, dedicate each session to a specific market or account.
- Monitor resource usage: Keep an eye on your CPU and RAM usage. For example, platforms like NinjaTrader can use 2-4 GB of RAM per session, especially when running multiple charts. If you're on a VPS plan with 16 GB of RAM, limit yourself to about 3-4 resource-heavy sessions to maintain peak performance.
- Stagger logins: Logging into multiple sessions at the same time can overload your VPS. Space out your logins to prevent this.
- Use clear session names: Naming your RDP connections based on their purpose - like "Forex-EURUSD", "Futures-ES", or "Crypto-BTC" - helps you quickly identify and switch between sessions during fast-moving markets.
Order flow
Built for scalpers. Heatmaps on dedicated resources.
Order-flow heatmaps and DOM ladders run on dedicated CPU, memory and NVMe, so your charts keep responding during volatility.
See the dedicated hardwareFrom $29.99/mo · Windows or Linux
Selecting Balanced Timeout Policies
Timeout settings decide whether your platforms keep running when you step away. Limits that are too short can disconnect you during critical trades, or close your programs when a disconnected session expires.
- For active trading sessions, set the idle session limit to Never. An idle timeout only disconnects you, but reconnecting in the middle of a fast market costs time.
- For sessions running automated strategies, set the disconnected session limit to Never. When a disconnected session reaches its limit, Windows deletes it, which stops your Expert Advisors (EAs) or algorithmic trading systems.
- The same settings suit day trading and swing trading, because your platforms need to keep running in both. Protect the server with strong passwords and network-level authentication rather than short timeouts.
Before applying these settings, test them during off-market hours to avoid surprises during live trading. Also, consider critical trading periods like the London-New York forex overlap (8:00 AM - 12:00 PM EST) or U.S. equity market hours (9:30 AM - 4:00 PM EST). These are times of high activity, so your timeout settings should ensure uninterrupted access during these windows.
Conclusion: Key Steps for Maintaining a Stable RDP Session
To keep your RDP session stable and avoid disruptions during trading, there are three critical actions to focus on.
First, adjust your Windows Server policies to eliminate session timeouts. Set the idle, disconnected, and active session limits to "Enabled" with the time limit configured as "Never," and set "End session when time limits are reached" to "Disabled." After making these changes, apply them immediately by running the gpupdate /force command. This setup ensures your session stays active throughout trading hours.
Second, activate keep-alive packets to handle brief network interruptions without losing your session. Navigate to Remote Desktop Session Host > Connections and set the "Configure keep‑alive connection interval" to 5 minutes or less. This small tweak prevents minor network hiccups from disconnecting your RDP client, keeping your trading activities uninterrupted.
Third, check your network's reliability before the start of each trading week. Use the Test-NetConnection command to confirm that port 3389 on your VPS is reachable and that your connection is stable with consistent latency. This step helps ensure connectivity and minimizes unexpected issues during trading sessions.
With these configurations in place, your trading tools - like MetaTrader EAs, NinjaTrader strategies, and TradeStation charts - will run continuously, even during high-impact events such as the CPI release at 8:30 AM ET or an FOMC announcement at 2:00 PM ET. Test your system by letting idle sessions exceed the configured limits to confirm everything works as intended.
Checking your RDP session settings
After changing the session time limits and running gpupdate /force, disconnect and reconnect an hour later to confirm the session and your platforms are still running. When you step away, disconnect rather than sign out, because signing out closes every program. A Windows Server trading VPS leaves your platforms running after you disconnect.
FAQs
Why does my RDP session disconnect, and how can I prevent it?
RDP sessions can drop for various reasons, such as unstable internet connections, misconfigured RDP or Group Policy settings, outdated RDP client software, or even problems introduced by recent Windows updates. These interruptions can be especially problematic for activities like automated processes or high-frequency trading, where consistent connectivity is crucial.
To avoid these disruptions, start by ensuring your internet connection is steady and dependable. Make sure your RDP client is updated to the latest version to sidestep compatibility issues. Take a closer look at your Group Policy and RDP settings - adjusting session timeouts, for example, can help keep your connection active. Lastly, always apply the latest Windows updates to reduce the chances of bugs or conflicts. Tackling these areas can help you maintain a more reliable and uninterrupted RDP experience.
How do I keep my RDP session active and prevent disconnections?
To prevent your RDP session from disconnecting, you can enable keep-alive packets in your RDP client or server settings. On the server, the "Configure keep-alive connection interval" policy sets how often, in minutes, the server checks the session state; 1 to 5 minutes works well.
Another effective method is modifying the session timeout policies on your server through the Group Policy Editor. This adjustment ensures your session stays active, even during idle moments. These tweaks are particularly beneficial for maintaining uninterrupted trading on your VPS.
What are the best RDP timeout settings for day trading and swing trading?
For setting the right RDP timeout, it largely depends on your trading approach and how often you need access.
For day traders, uninterrupted access is a top priority. Set the idle, disconnected and active session limits to Never, and pair this with a keep-alive interval of 1 to 5 minutes to prevent unexpected disconnections during critical trading hours.
Swing traders can use the same settings. A disconnected session limit of Never keeps platforms and alerts running between check-ins. For security, rely on strong passwords and network-level authentication rather than short timeouts.









