LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-23-2004, 08:14 PM   #1
chiuyaa
LQ Newbie
 
Registered: Nov 2003
Posts: 4

Rep: Reputation: 0
fseek cross NFS is really slow


My program works very slow if the database is located in Sloaris NFS
server and run it on the Linux box,I tried RH 7,8 and ES3.0. But if I move
the database to local, it works fine. The Linux is 6X slower than Sloaris
or HP-UX in the same condition.
So I wrote a small program to test it and figured out the fseek seems the
bottleneck. And I also try to change the NFS wsize/rsize (from 1024 to 32768), but didnot help!
Any one faced the same issue? Or any suggestion? Thanks in advance!
Actually I'm not sure shall I put this issue here or at Programming Foums,
I will try it here first and seems to be the netowrk NFS issue?

*** Test program *****
#include <stdio.h>

main()
{
FILE *fo;
int ibuf[500],i,one;

one = 1;
memset(ibuf,0,500*sizeof(int));

printf("==> start creating a 500MB file\n");

fo = fopen("./datafile","wb");
for(i = 0 ; i < 10000 ; ++i) {
fwrite(ibuf,sizeof(int),500,fo);
}
fclose(fo);

printf("==> end of file creation\n\n");
printf("==> now starts modifying file\n");

fo = fopen("./datafile","r+b");

for(i = 0 ; i < 2000 ; ++i) {
fseek(fo,50*i,SEEK_SET);
fwrite(&one,sizeof(int),1,fo);
}

fclose(fo);

printf("==> end modifying file\n");
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NFS slow and not always there. Xaque208 Linux - Networking 6 01-09-2005 11:44 AM
NFS mount very slow Toxe Linux - Networking 5 10-25-2004 10:26 AM
fast encrypted NFS but slow regular NFS cazzazullu Linux - Networking 0 10-19-2004 10:08 AM
NFS - why so slow? mrjamin Linux - Networking 2 09-26-2004 08:15 AM
Cross Platform NFS performance marist89 Linux - Networking 0 03-31-2004 09:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration