VPN times out when waiting for SQL queries
-
- Posts: 2
- Joined: Wed Jul 13, 2016 2:59 am
VPN times out when waiting for SQL queries
Hello,
We are having an issue where any SQL queries we issue to a SQL server inside our SoftEther VPN work when less than 40 seconds, but 40+ seconds will result in the following message: "A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The semaphore timeout period has expired.)"
This works:
WAITFOR DELAY '00:00:39';SELECT 1;
This does not:
WAITFOR DELAY '00:00:40';SELECT 1;
Basically any query that takes longer than 39 seconds will cancel and return an error. Running the query on another server inside the VPN against the SQL server succeeds as well as if we open a port to allow a straight connection to the database from the internet so the issue definitely seems localized to the VPN. The VPN server is running on Windows Server 2012 R2 if that makes any difference. Is there some timeout setting we can adjust or something else to look for?
We are having an issue where any SQL queries we issue to a SQL server inside our SoftEther VPN work when less than 40 seconds, but 40+ seconds will result in the following message: "A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The semaphore timeout period has expired.)"
This works:
WAITFOR DELAY '00:00:39';SELECT 1;
This does not:
WAITFOR DELAY '00:00:40';SELECT 1;
Basically any query that takes longer than 39 seconds will cancel and return an error. Running the query on another server inside the VPN against the SQL server succeeds as well as if we open a port to allow a straight connection to the database from the internet so the issue definitely seems localized to the VPN. The VPN server is running on Windows Server 2012 R2 if that makes any difference. Is there some timeout setting we can adjust or something else to look for?
-
- Posts: 2458
- Joined: Mon Feb 24, 2014 11:03 am
Re: VPN times out when waiting for SQL queries
Are there any router or firewall or SecureNAT or localbridge between the SQL client and the SQL server?
-
- Posts: 2
- Joined: Tue Mar 07, 2017 1:53 am
Re: VPN times out when waiting for SQL queries
I am also experiencing this issue - I'm connecting from a windows 10 machine to softether running on win 2016.
SecureNat is enabled. What other information can I provide that would help diagnose this issue?
SecureNat is enabled. What other information can I provide that would help diagnose this issue?
-
- Posts: 2458
- Joined: Mon Feb 24, 2014 11:03 am
Re: VPN times out when waiting for SQL queries
Could you try that the SQL Server PC connect to the virtual hub and client queries with virtual IP address?
-
- Posts: 2
- Joined: Tue Mar 07, 2017 1:53 am
Re: VPN times out when waiting for SQL queries
What?
I have no idea what you're asking me to do - the SQL Server is in the same network as the VPN server, and the clients are connecting to the VPN server and acquiring an IP from the secure nat service.
I have no idea what you're asking me to do - the SQL Server is in the same network as the VPN server, and the clients are connecting to the VPN server and acquiring an IP from the secure nat service.
-
- Posts: 2
- Joined: Wed Jul 13, 2016 2:59 am
Re: VPN times out when waiting for SQL queries
thisjun wrote:
> Could you try that the SQL Server PC connect to the virtual hub and client
> queries with virtual IP address?
This works for me. The internal network is 10.0.0.0/24; the VPN server has an IP of 10.0.0.1 and the SQL server is 10.0.0.3. The SecureNAT on the VPN is set to 192.168.1.0/24 with the server at 192.168.1.1 and the VPN clients are issued DHCP from 192.168.1.100-192.168.1.200. When a client connects to the VPN and queries the SQL server against 10.0.0.3, it "works" except it times out for queries over 40 seconds. If I connect the SQL server to the VPN as a client and then connect to 192.168.1.101 (the DHCP address the SQL server received) from another VPN client, then I can run queries for minutes and it works perfectly fine.
So is there some setting related to SecureNAT that needs adjustment to allow connections to the normal 10.0.0.3 address to not time out when running for 40+ seconds? I really don't want to have to loop the SQL server back into it's own network and have a separate IP that VPN clients need to use instead of the normal address.
> Could you try that the SQL Server PC connect to the virtual hub and client
> queries with virtual IP address?
This works for me. The internal network is 10.0.0.0/24; the VPN server has an IP of 10.0.0.1 and the SQL server is 10.0.0.3. The SecureNAT on the VPN is set to 192.168.1.0/24 with the server at 192.168.1.1 and the VPN clients are issued DHCP from 192.168.1.100-192.168.1.200. When a client connects to the VPN and queries the SQL server against 10.0.0.3, it "works" except it times out for queries over 40 seconds. If I connect the SQL server to the VPN as a client and then connect to 192.168.1.101 (the DHCP address the SQL server received) from another VPN client, then I can run queries for minutes and it works perfectly fine.
So is there some setting related to SecureNAT that needs adjustment to allow connections to the normal 10.0.0.3 address to not time out when running for 40+ seconds? I really don't want to have to loop the SQL server back into it's own network and have a separate IP that VPN clients need to use instead of the normal address.
-
- Posts: 3
- Joined: Wed Oct 03, 2018 7:15 pm
Re: VPN times out when waiting for SQL queries
Hi all,
Has anyone found a (better) solution to the timeout issue when running SQL queries that are longer than 40 seconds? We've hit the same roadblock making SoftEther unusable for our SQL devs. I'm hoping there's something we can adjust to get it working because other than this, SoftEther has been excellent.
Thanks,
Trevor
Has anyone found a (better) solution to the timeout issue when running SQL queries that are longer than 40 seconds? We've hit the same roadblock making SoftEther unusable for our SQL devs. I'm hoping there's something we can adjust to get it working because other than this, SoftEther has been excellent.
Thanks,
Trevor
-
- Posts: 1
- Joined: Fri Nov 09, 2018 1:29 am
Re: VPN times out when waiting for SQL queries
I found this solution, you can see more here
Code: Select all
reddit.com/r/networking/comments/6hc4qm/slow_sql_queries_over_vpn/
-
- Posts: 3
- Joined: Wed Oct 03, 2018 7:15 pm
Re: VPN times out when waiting for SQL queries
Did any of the solutions in the reddit thread work fo you? Nothing has worked for me so we had to go with another solution.
If there's a fix I'd like to go back to SoftEther.
If there's a fix I'd like to go back to SoftEther.
-
- Posts: 2458
- Joined: Mon Feb 24, 2014 11:03 am
Re: VPN times out when waiting for SQL queries
SecureNAT has the bug about finishing TCP conection.
Please try updating to latest version.
Please try updating to latest version.
-
- Posts: 3
- Joined: Wed Oct 03, 2018 7:15 pm
Re: VPN times out when waiting for SQL queries
Hi thisjun,
I updated the server and client to version 4.28 Build 9669 and still get the timeout at 40 seconds. I was hopeful this latest version would work
WAITFOR DELAY '00:00:45';SELECT 1;
I updated the server and client to version 4.28 Build 9669 and still get the timeout at 40 seconds. I was hopeful this latest version would work
WAITFOR DELAY '00:00:45';SELECT 1;
-
- Posts: 2
- Joined: Thu Jul 18, 2019 10:21 am
Re: VPN times out when waiting for SQL queries
en...I think it's hub GroupPolicy Time-out Period policy,but it's only maxtime 60s,
when i used SecureNAT the tcp timeout is 1800s
so,you can try change GroupPolicy Time-out Period = 60
if you wants most maybe change and compile src
when i used SecureNAT the tcp timeout is 1800s
so,you can try change GroupPolicy Time-out Period = 60
if you wants most maybe change and compile src