Do you have a question? Post it now! No Registration Necessary
Subject
- Posted on
May 19, 2008, 5:44 pm

After porting our application from Linux 2.4.26 to Linux 2.6.10, I am
seeing it taking 35 seconds to write to a file when using NFS.
Here is the code I am using to write to the file:
fprintf(fileHandle, "%s\n", msg_p);
fflush(fileHandle);
If I put a printf statement right after this code, I see it
immediately on the screen.
When I run out of flash with Linux 2.6.10, there is no delay in
writing to the file. When using NFS with Linux 2.4.26, there is no
delay either.
Is there anything in 2.6.10 that causes a delay in writing to a file
with NFS?
seeing it taking 35 seconds to write to a file when using NFS.
Here is the code I am using to write to the file:
fprintf(fileHandle, "%s\n", msg_p);
fflush(fileHandle);
If I put a printf statement right after this code, I see it
immediately on the screen.
When I run out of flash with Linux 2.6.10, there is no delay in
writing to the file. When using NFS with Linux 2.4.26, there is no
delay either.
Is there anything in 2.6.10 that causes a delay in writing to a file
with NFS?

Re: Writing to file delayed with Linux 2.6.10 & NFS

How do you see this ? Does it take 35 seconds to perform the write, or
does it take 35 seconds to see the data arrive on the server ? Are you
verifying the new data on the NFS server or are you observing through
another mounted NFS client on the same export ?

Could it be that your NFS server is exporting in async mode ?
--
:wq
^X^Cy^K^X^C^C^C^C
:wq
^X^Cy^K^X^C^C^C^C

Re: Writing to file delayed with Linux 2.6.10 & NFS

It's
/tftpboot/fadsroot-prod6 *(rw,no_root_squash,no_all_squash)
I have tried changing this but nothing seems to help. Since we
started seeing this delay when switching from Linux 2.4 to 2.6, is it
possible that there is something in the kernel configuration that is
causing this? Here is my current Network File System configuration:
#
# Network File Systems
#
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
# CONFIG_NFS_V4=y
# CONFIG_NFS_DIRECTIO is not set
# CONFIG_NFSD is not set
CONFIG_ROOT_NFS=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
# CONFIG_EXPORTFS is not set
CONFIG_SUNRPC=y
# CONFIG_SUNRPC_GSS=y
# CONFIG_RPCSEC_GSS_KRB5=y
# CONFIG_RPCSEC_GSS_SPKM3 is not set
# CONFIG_SMB_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
CONFIG_FS_MBCACHE=y

Re: Writing to file delayed with Linux 2.6.10 & NFS

Yes, but where (on which machine) are you running the 'tail -f'? On the
file server, or on the client that is writing to the file ?

That's good, but the server can choose not to write the changes to disk
right away for performance purposes, i.e. running in asynchrone mode.

Check the /etc/exports file and the 'nfs' man page on your machine.
--
:wq
^X^Cy^K^X^C^C^C^C
:wq
^X^Cy^K^X^C^C^C^C
Site Timeline
- » Compact Flash interface with MPC8313E in True IDE mode
- — Next thread in » Embedded Linux
-
- » Qemu /dev/zero
- — Previous thread in » Embedded Linux
-
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux
-
- » White House In Danger Of Imminent Collapse, First Family Evicted
- — The site's Newest Thread. Posted in » Electronics Design
-
- » Using Bats To Burn Down the House
- — The site's Last Updated Thread. Posted in » Electronics Design
-