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

  • Home
  • SEARCH
  • 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 6656111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:36:12+00:00 2026-05-26T01:36:12+00:00

I run the following C program between two machines with 10GibE; the program reports

  • 0

I run the following C program between two machines with 10GibE; the program reports 12Gib/s whereas nload reports a (more believable) 9.2Gib/s. Can anyone tell me what I’m doing wrong in the program?

.
.
#define BUFFSZ (4*1024)
char buffer[BUFFSZ];
.
.
  start = clock();

  while (1) {
    n = write(sockfd, buffer, BUFFSZ);
    if (n < 0)
       error("ERROR writing to socket");
    if (++blocks % (1024*1024) == 0)
    {
      blocks = 0;
      printf("32Gib at %6.2lf Gib/s\n", 32.0/(((double) (clock() - start)) / CLOCKS_PER_SEC));
      start = clock();
    }
  }

This is CentOs 6.0 on Linux 2.6.32; nload 0.7.3, gcc 4.4.4.

  • 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-26T01:36:13+00:00Added an answer on May 26, 2026 at 1:36 am

    Firstly, clock() returns an estimate of the CPU time used by the program, not the wall-clock time – so your calculation indicates that you are transferring 12GiB per second of CPU time used. Instead, use clock_gettime() with the clock ID CLOCK_MONOTONIC to measure wall-clock time.

    Secondly, after write() returns the data hasn’t necessarily been sent to the network yet – merely copied into the kernel buffers for sending. This will give you a higher reported transfer rate at the start of the connection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting a NullReferenceException when I run the following program. I think the
Hey everyone, I am trying to run the following program, but am getting a
I want to run the following command from a C program to read the
I get the following error when I run a java program: Exception in thread
I have the following layout for my test suite: TestSuite1.cmd: Run my program Check
Whenever I run any jython program in Eclipse, I got the following error in
When i am trying to run my program it is giving the following error
Trying to run my program in FreeBSD OS, I have the following results: $
Can not run following SQL from ant's sql task : BEGIN DBMS_AQADM.CREATE_QUEUE_TABLE( queue_table =>
I run the following command in Emacs unsuccessfully C-u How can you clear the

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.