Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to reuse tsdpool sessions #600

Open
YANGJUHEE521 opened this issue Jul 16, 2024 · 9 comments
Open

How to reuse tsdpool sessions #600

YANGJUHEE521 opened this issue Jul 16, 2024 · 9 comments

Comments

@YANGJUHEE521
Copy link

Hello, I would like to know how I can use tdspool. and i use freetds-common 1.3.6-1 version

I tested it.

First of all, msql confirmed that there is no session.
1

  1. I turned on tdspool.
    2

  2. Session from msql to tdspool.
    3

  3. I thought I would reuse the existing tdspool session if I went in using mypool in tsql, but I had an additional session.
    4
    5

It's a question.

  1. Why couldn't I reuse the session in my test?
  2. How to reuse tsdpool sessions
  3. Can tdspool be used by on and off processing?
  4. How to Log tdspool
@freddy77
Copy link
Contributor

freddy77 commented Jul 16, 2024

tdspool acts as a man-in-the-middle. So, TSQL (in your example) should connect to tdspool (so on port 25331 in your case) and tdspool will reuse connections.

You can specify log with -l option. Also you can use the TDSDUMP variable (usually very verbose for debugging).

@YANGJUHEE521
Copy link
Author

YANGJUHEE521 commented Jul 17, 2024

Thank you so much for your reply !!

@YANGJUHEE521
Copy link
Author

YANGJUHEE521 commented Jul 19, 2024

Hello, as you said, I tried connecting to tdspool, but it slows down in between, not always. Originally, if it didn't take 50ms to import 1 case of data from mssql, there is a case that sometimes takes 500ms. Why does it take 50ms to get 1 case of the same, and when does it take 500ms? How do I improve it?

In addition, using tds is fast, but as you said, using tdspool is sometimes slow.

@freddy77
Copy link
Contributor

Thanks for testing. I would bet on TCP_NODELAY setting (nagle algorithm).

@Gin-9990
Copy link

When I looked it up I saw that TCP_NODELAY setting deactivates nagle algorithm and I wanna know its pros&cons
and how to setting a TCP_NODELAY.

@freddy77
Copy link
Contributor

When I looked it up I saw that TCP_NODELAY setting deactivates nagle algorithm and I wanna know its pros&cons and how to setting a TCP_NODELAY.

The base idea of the algorithm is to reduce number of TCP packets. See https://en.wikipedia.org/wiki/Nagle%27s_algorithm. However the TDS protocol already group bytes into larger packets so all you get is an increase of delays and round trips.

@freddy77
Copy link
Contributor

@YANGJUHEE521 in master branch Nagle's algorithm is now turned off. Can you try it ?

@YANGJUHEE521
Copy link
Author

@freddy77
Sorry for the late reply. I can't use git because I'm not a test server, but I'm actually testing on a production server that doesn't have access to the internet. So I tried manually finding the part you modified and overwriting it on my server, but it doesn't seem to work. Should I do compile again with the file on the release side? How can I test it? Thank you.

@freddy77
Copy link
Contributor

Hi. Did you solve the issue?
Actually, did the patch helped?
Do you need more work from me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants