I got a performance related problem that bothers me a lot.
we have two computer nodes(svr1 & svr2), and svr1 has mysql 4.1.20 installed as well as nfs, and svr2 can mount disk from svr2, so we can make it possible to share files between them...
the data files we'll deal with can often reach GB(or even TB) level, for this instance, we got a 4.17GB seismic data file , the job is to read data from it as input and output the data to the shared disk.
in order to improve the performance we use memory mapping instead of traditionally read/write sys calls.
if we run the program at svr1, the time consumed is merely around 8min, but things get different if we run the same program at svr2, the time consumed is 4hours more.
it supprised me a lot, the point is svr2 must use nfs to input/output data, I am wondering if the nfs is the bottleneck that makes so, and how to solve that.
code segment is as follows:
any one got clue please give me some suggestion
thanks a lot in advances
ben
Last edited by jim mcnamara; 03-31-2009 at 11:28 AM..
Reason: add code tags
The OS is rhel4, so the link you offered just hits it.
Quote:
Originally Posted by jim mcnamara
One note: why are you calling mmap() INSIDE a loop? Usually one call suffices.
The files we deal with are often too large to map it into address space at one time, so I just map a part of file at a time, and check if the data I need is in already mapped, if so, memcpy it, or I should remap it.
have I made myself clear, sorry about my poor english, do you have any better solution of this kind of problem?
Try NFS tuning first. You may also want to increase virtual memory on the client.
Also, if you can, get the sysadmin to turn off atime updates on your NFS mounted filesystem.
Why memcpy an mmap-ed block anywhere? This has little advantage over just read()-ing it, because memcpy forces it to page in the entire section anyway. Ideally, whatever function needs this data could use the mmap-ed blocks directly, which would have the advantage of paging in only the data it actually uses.
Hi,
I have a conflict.
I have 2 servers: the 1st creates an application logs and the 2nd is an empty server.
I want to export (read-only) from the 1st server by NFS the directory that contains the logs to the 2nd server.
Now, the question is:
If in the 2nd server i'm doing a lot of... (3 Replies)
I want to know whether this is possile or ever been tried out.
I want to obtain a chuck of memory using mmap()
I do it so :
n = mmap(0, 8000, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
And hold on to that memory, when a process requests for memory, some memory is... (2 Replies)
Descriptions:
Develop a program that uses mmap() to map a file to memory space. Prepare such a file by yourself and do the follows.
<LI class=MsoNormal>Display the content of the file after mapping; <LI class=MsoNormal>Output how many digits included in the file; <LI class=MsoNormal>Replace... (1 Reply)
Dear Experts,
i have a problem related to mmap(), when i run my program on sun for 64 bit which is throwing SIGBUS when it encounters mmap() function, what is the reason how to resolve this one, because it is working for 32 bit.
with regards,
vidya. (2 Replies)
Hi,
In our environment (HP-UX B.11.11) we mainly use NFS v3 resources as the storage solution for our application. It worked fine, however we have recently noticed big I/O performance degradation that affected the application.
Is there any command or utility that can help us measure I/O... (2 Replies)
Hi everyone,
The last two days I'm researching results of NFS operations on Linux, and I noticed some time difference when read and write.
cat /proc/version : Linux version 2.6.9-42.ELsmp (bhcompile@hs20-bc1-1.build.redhat.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-2)) #1 SMP Wed Jul 12... (1 Reply)
Hello. I'm writing some random access i/o software on Solaris 8 using mmap64 to memory map large files (my test file is ~25 GB).
The abbreviated code fragment is:
fd = open(cbuf,O_RDONLY|O_LARGEFILE);
struct stat statbuf;
fstat(fd,&statbuf);
off_t len =... (0 Replies)