Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6885537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:38:50+00:00 2026-05-27T05:38:50+00:00

Please, Linux kernel hackers, what is a reasonable buffer size for write(2) syscall to

  • 0

Please, Linux kernel hackers, what is a reasonable buffer size for write(2) syscall to sockets or files, performance-wise? It’s clear that it’s some pagesize multiple, but which one? Does it matter? What is “too small” and “too big”?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:38:50+00:00Added an answer on May 27, 2026 at 5:38 am

    depends on how big your delay to the peer is, let’s say you have a 100MBps connection, and a delay of 50ms, then you can calculate

    100MBps * 0.050 sec / 8 = 0.625MB = 625KB
    

    but the default window size in Linux 2.6 is around 110KB, which will limit your throught out to around 2.2MBps (110KB / 0.050)
    so, to fix that you can you setsockopt

    int ret, sock, buf_size;
    sock = socket(AF_INET, SOCK_STREAM, 0);
    buf_size = 625*1024;
    ret = setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char *)&buf_size, sizeof(buf_size));
    ret = setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char *)&buf_size, sizeof(buf_size));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the flow of control in linux kernel, found that control moves to IDT
Please explain from Linux, Windows perspectives? I am programming in C#, would these two
Please bear with me, I'm just learning C++. I'm trying to write my header
I have a Linux kernel module M1 which exports a symbol S1 . When
I am trying to understand Linux Kernel implementation of linked list and hash table.
I'm reading Understanding Linux Kernel. Paging for 64-bit Architectures As we have seen in
I will use the Linux NTFS driver as an example. The Linux kernel NTFS
I'm trying to figure out how to block a signal in Linux kernel 2.4
I am new to linux kernel programming. I wrote a simple kernel module and
I'm trying to understand the system call interface and implementation in the Linux kernel.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.