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

Add TCP_NODELAY option to improve performance for large response queries #749

Merged
merged 1 commit into from
May 26, 2024

Commits on May 25, 2024

  1. Add TCP_NODELAY option to improve performance for large response queries

    This commit adds the TCP_NODELAY option to the socket configuration in
    `configure_socket` function. Without this option, we observed significant
    performance issues when executing SELECT queries with large responses.
    
    Before the fix:
    postgres=> SELECT repeat('a', 1); SELECT repeat('a', 8153);
    Time: 1.368 ms
    Time: 41.364 ms
    
    After the fix:
    postgres=> SELECT repeat('a', 1); SELECT repeat('a', 8153);
    Time: 1.332 ms
    Time: 1.528 ms
    
    By setting TCP_NODELAY, we eliminate the Nagle's algorithm delay, which
    results in a substantial improvement in response times for large queries.
    
    This problem was discussed in postgresml#616.
    zsand committed May 25, 2024
    Configuration menu
    Copy the full SHA
    45f565d View commit details
    Browse the repository at this point in the history