Understanding Remote Query Timeout

  • Hi Experts,

      Could you please help me understand the effect of "Remote Query Timeout" settings.
    From TechNet I got to know that this value has no effect on queries received by the Database Engine.This value applies to an outgoing connection initiated by the Database Engine as a remote query.

      To understand better I have set Remote Query Timeout to 5 Sec on my test machine and exec the below query for linked server:

        waitfor delay '00:00:06'
        select * from [Linked Server].master.sys.sysaltfiles

     Ideally it should have timed out but it did get executed after 6 sec.
    Please let me know if I am testing it in a wrong way and what is the correct way to test it.

    Thanks and Regards,
    Dev

  • dev.tridib - Thursday, June 15, 2017 10:42 AM

    Hi Experts,

      Could you please help me understand the effect of "Remote Query Timeout" settings.
    From TechNet I got to know that this value has no effect on queries received by the Database Engine.This value applies to an outgoing connection initiated by the Database Engine as a remote query.

      To understand better I have set Remote Query Timeout to 5 Sec on my test machine and exec the below query for linked server:

        waitfor delay '00:00:06'
        select * from [Linked Server].master.sys.sysaltfiles

     Ideally it should have timed out but it did get executed after 6 sec.
    Please let me know if I am testing it in a wrong way and what is the correct way to test it.

    Thanks and Regards,
    Dev

    You waited for 6 seconds and then initiated a remote query so it wouldn't be testing anything with the linked server or the query timeout setting.
    If these are all test servers, you can open a local transaction against one of the tables on the instance that your linked server points to, leave it open, uncommitted so it blocks your query. Then on your other server try a query against that table through the linked server.

    Sue

  • Sue_H - Thursday, June 15, 2017 11:25 AM

    dev.tridib - Thursday, June 15, 2017 10:42 AM

    Hi Experts,

      Could you please help me understand the effect of "Remote Query Timeout" settings.
    From TechNet I got to know that this value has no effect on queries received by the Database Engine.This value applies to an outgoing connection initiated by the Database Engine as a remote query.

      To understand better I have set Remote Query Timeout to 5 Sec on my test machine and exec the below query for linked server:

        waitfor delay '00:00:06'
        select * from [Linked Server].master.sys.sysaltfiles

     Ideally it should have timed out but it did get executed after 6 sec.
    Please let me know if I am testing it in a wrong way and what is the correct way to test it.

    Thanks and Regards,
    Dev

    You waited for 6 seconds and then initiated a remote query so it wouldn't be testing anything with the linked server or the query timeout setting.
    If these are all test servers, you can open a local transaction against one of the tables on the instance that your linked server points to, leave it open, uncommitted so it blocks your query. Then on your other server try a query against that table through the linked server.

    Sue

    Thanks a lot for your help Sue. I am able to test it successfully.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply