Writing to file delayed with Linux 2.6.10 & NFS - Embedded

This is a discussion on Writing to file delayed with Linux 2.6.10 & NFS - Embedded ; 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); ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Writing to file delayed with Linux 2.6.10 & NFS

  1. Writing to file delayed with Linux 2.6.10 & NFS

    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?

  2. Re: Writing to file delayed with Linux 2.6.10 & NFS

    In comp.arch.embedded Bill wrote:

    > 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.


    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 ?

    > 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?


    Could it be that your NFS server is exporting in async mode ?

    --
    :wq
    ^X^Cy^K^X^C^C^C^C

  3. Re: Writing to file delayed with Linux 2.6.10 & NFS

    On May 19, 11:18 am, Ico wrote:
    > In comp.arch.embedded Bill wrote:
    >
    > > 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.

    >
    > 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 ?
    >
    > > 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?

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


    I do tail -f on the log file and see that it takes about 35 seconds to
    be written to. I can see using tcpdump that the data does arrive at
    the server immediately.

    How do I check if my "NFS server is exporting in async mode?"

  4. Re: Writing to file delayed with Linux 2.6.10 & NFS

    Could it be, just
    sync

    solves the problem ?

    rds

  5. Re: Writing to file delayed with Linux 2.6.10 & NFS

    Bill wrote:

    > On May 19, 11:18 am, Ico wrote:
    >> In comp.arch.embedded Bill wrote:
    >>
    >> > 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.

    >>
    >> 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 ?
    >>
    >> > 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?

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

    >
    > I do tail -f on the log file and see that it takes about 35 seconds to
    > be written to. I can see using tcpdump that the data does arrive at
    > the server immediately.
    >
    > How do I check if my "NFS server is exporting in async mode?"


    $ cat /etc/exports
    /bla *(rw,sync,no_root_squash)
    /blub *(rw,async)

    JB

  6. Re: Writing to file delayed with Linux 2.6.10 & NFS

    In comp.arch.embedded Bill wrote:
    > On May 19, 11:18 am, Ico wrote:
    >> In comp.arch.embedded Bill wrote:
    >>
    >> > 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.

    >>
    >> 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 ?
    >>
    >> > 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?

    >>
    >> Could it be that your NFS server is exporting in async mode ?

    >
    > I do tail -f on the log file and see that it takes about 35 seconds to
    > be written to.


    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 ?

    > I can see using tcpdump that the data does arrive at the server
    > immediately.


    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.

    > How do I check if my "NFS server is exporting in async mode?"


    Check the /etc/exports file and the 'nfs' man page on your machine.

    --
    :wq
    ^X^Cy^K^X^C^C^C^C

  7. Re: Writing to file delayed with Linux 2.6.10 & NFS

    On May 19, 11:36 pm, Juergen Beisert wrote:
    > Bill wrote:
    > > On May 19, 11:18 am, Ico wrote:
    > >> In comp.arch.embedded Bill wrote:

    >
    > >> > 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.

    >
    > >> 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 ?

    >
    > >> > 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?

    >
    > >> Could it be that your NFS server is exporting in async mode ?

    >
    > >> --
    > >> :wq
    > >> ^X^Cy^K^X^C^C^C^C

    >
    > > I do tail -f on the log file and see that it takes about 35 seconds to
    > > be written to. I can see using tcpdump that the data does arrive at
    > > the server immediately.

    >
    > > How do I check if my "NFS server is exporting in async mode?"

    >
    > $ cat /etc/exports
    > /bla *(rw,sync,no_root_squash)
    > /blub *(rw,async)
    >
    > JB


    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

+ Reply to Thread