2.6.26.3 kernel - progressive slowdown over NFS
Subsystems (4)
Hi,
We have a simple python program which keeps running a C loop to lstat NFS mounted directories. We are seeing some weird behavior w.r.t. the run-time of this program on 2.6.26.3 kernel vs 2.6.24 kernel.
The run-time of the following code increases over time on the 2.6.26.3 kernel, whereas remains flat (as expected) on the 2.6.24 kernel. [See attached graphs - B1.jpg and B2.jpg] Once the 2.6.26.3 machine gets into this state, we need to restart the box to get back to reasonable run-times. Is this a known issue ?
Setup :
Machine A (2.6.26) : exports NFS directory - /a/baz contains 10,000 directories bar0 ... bar9999
/a/baz *(rw,sync,no_root_squash,no_all_squash,subtree_check)
Machine B1 (2.6.26.3) : mounts NFS dir RO from A - graph B1.jpg
10.x.x.x:/a/baz on /baz type nfs (ro,vers=3,rsize=4096,wsize=4096,namlen=255,hard,nointr,nolock,proto=udp,timeo=11,retrans=2,sec=sys,mountproto=udp,addr=10.x.x.x)
Machine B2 (2.6.24) : mounts NFS dir RO from A - graph B2.jpg
10.x.x.x:/a/baz on /baz type nfs (ro,vers=3,rsize=4096,wsize=4096,hard,nointr,nolock,proto=udp,timeo=11,retrans=2,sec=sys,addr=10.x.x.x)
Repro :
B1 and B2, run the following python program :
{{{
#!/usr/bin/env python
import os
import sys
import time
while True:
t1 = time.time()
rv = os.system("/a.out 10000 >& /dev/null") # lstat the 10000
directories mounted via NFS
t2 = time.time()
print >> sys.stderr, "%.3f" % (t2 - t1), rv
}}}where a.out is the following C code :
{{{
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
int main(int argc, char **argv)
{
int i, n = atoi(argv[1]);
char filename[64];
struct stat statbuf;
for (i = 0; i < n; i++) {
sprintf(filename, "/baz/bar%d", i);
lstat(filename, &statbuf);
} printf("done\n");
return 0;
}
}}}
Attachments :
B1.jpg and B2.jpg - runtimes on the 2 client machines - X-axis : iteration number
Y-axis : run-time
Config files : - for the machines B1, B2 and A
b1.2.6.26.3.config
b2.2.6.24.config
a.2.6.26.config
- P
Resending. Any pointers to other lists or more specific information which might be required ?
Thanks,
-P
PS : Please cc me on the response.
Quoted 85 lines · Priyank Patel
Hi,
We have a simple python program which keeps running a C loop to lstat NFS mounted directories. We are seeing some weird behavior w.r.t. the run-time of this program on 2.6.26.3 kernel vs 2.6.24 kernel.
The run-time of the following code increases over time on the 2.6.26.3 kernel, whereas remains flat (as expected) on the 2.6.24 kernel. [See attached graphs - B1.jpg and B2.jpg] Once the 2.6.26.3 machine gets into this state, we need to restart the box to get back to reasonable run-times. Is this a known issue ?
Setup :
Machine A (2.6.26) : exports NFS directory - /a/baz contains 10,000 directories bar0 ... bar9999
/a/baz *(rw,sync,no_root_squash,no_all_squash,subtree_check)Machine B1 (2.6.26.3) : mounts NFS dir RO from A - graph B1.jpg
10.x.x.x:/a/baz on /baz type nfs (ro,vers=3,rsize=4096,wsize=4096,namlen=255,hard,nointr,nolock,proto=udp,timeo=11,retrans=2,sec=sys,mountproto=udp,addr=10.x.x.x)Machine B2 (2.6.24) : mounts NFS dir RO from A - graph B2.jpg
10.x.x.x:/a/baz on /baz type nfs (ro,vers=3,rsize=4096,wsize=4096,hard,nointr,nolock,proto=udp,timeo=11,retrans=2,sec=sys,addr=10.x.x.x)Repro :
B1 and B2, run the following python program :
{{{
#!/usr/bin/env pythonimport os
import sys
import timewhile True:
t1 = time.time() rv = os.system("/a.out 10000 >& /dev/null") # lstat the 10000directories mounted via NFS
t2 =time.time()
print >> sys.stderr, "%.3f" % (t2 - t1), rv
}}}where a.out is the following C code :
{{{
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>int
main(int argc, char **argv)
{
int i, n =atoi(argv[1]);
char filename[64];
struct stat statbuf;for (i = 0; i < n; i++) { sprintf(filename, "/baz/bar%d", i); lstat(filename, &statbuf); }
printf("done\n");
return 0;
}
}}}Attachments :
B1.jpg and B2.jpg - runtimes on the 2 client machines - X-axis : iteration number
Y-axis : run-timeConfig files : - for the machines B1, B2 and A
b1.2.6.26.3.config
b2.2.6.24.config
a.2.6.26.config- P
Quoted 6 lines · Priyank Patel
We have a simple python program which keeps running a C loop to lstat NFS mounted directories. We are seeing some weird behavior w.r.t. the run-time of this program on 2.6.26.3 kernel vs 2.6.24 kernel.
The run-time of the following code increases over time on the 2.6.26.3 kernel, whereas remains flat (as expected) on the 2.6.24 kernel.
I'm seeing a similar effect, and ran a benchmark pre and post reboot:
$ strace -T /usr/sbin/bonnie++ -d . -s 0 -f -n 1 >/tmp/bonnie-r44237-netslow 2>&1 ...reboot... $ strace -T /usr/sbin/bonnie++ -d . -s 0 -f -n 1 >/tmp/bonnie-r44237-netfast 2>&1
Graphs of the operations are avaliable:
http://davidf.woaf.net/nfsfail-2.6.26/
In particular http://davidf.woaf.net/nfsfail-2.6.26/r44237-stat.pdf
r44237-* was a machine with a 28 day uptime and r44088-* is an identical machine with 14 day uptime.
The graphs show times as recorded by strace for each syscall (points), a cumulative frequency plot is also drawn on the same graph (lines). yellow-orange points/lines are before the reboot, purple afterwards.
The machines are part of a cluster with a r/o nfsroot and common debian stock kernel:
Linux r44088 2.6.26-1-amd64 #1 SMP Sat Aug 2 11:15:08 GMT 2008 x86_64 GNU/Linux
Other nfs filesystems are also mounted; all nfs mounts are nfsv3 over udp.
Has this issue been identified or resolved in 2.6.27?
Extra logs can be provided if required.
..david
[ adding netdev, linux-nfs to cc: -- rbl ]
Hi,
We have a simple python program which keeps running a C loop to lstat NFS mounted directories. We are seeing some weird behavior w.r.t. the run-time of this program on 2.6.26.3 kernel vs 2.6.24 kernel.
The run-time of the following code increases over time on the 2.6.26.3 kernel, whereas remains flat (as expected) on the 2.6.24 kernel. [See attached graphs - B1.jpg and B2.jpg] Once the 2.6.26.3 machine gets into this state, we need to restart the box to get back to reasonable run-times. Is this a known issue ?
Setup :
Machine A (2.6.26) : exports NFS directory - /a/baz contains 10,000 directories bar0 ... bar9999
/a/baz *(rw,sync,no_root_squash,no_all_squash,subtree_check)
Machine B1 (2.6.26.3) : mounts NFS dir RO from A - graph B1.jpg
10.x.x.x:/a/baz on /baz type nfs (ro,vers=3,rsize=4096,wsize=4096,namlen=255,hard,nointr,nolock,proto=udp,timeo=11,retrans=2,sec=sys,mountproto=udp,addr=10.x.x.x)
Machine B2 (2.6.24) : mounts NFS dir RO from A - graph B2.jpg
10.x.x.x:/a/baz on /baz type nfs (ro,vers=3,rsize=4096,wsize=4096,hard,nointr,nolock,proto=udp,timeo=11,retrans=2,sec=sys,addr=10.x.x.x)
Repro :
B1 and B2, run the following python program :
{{{
#!/usr/bin/env python
import os
import sys
import time
while True:
t1 = time.time()
rv = os.system("/a.out 10000 >& /dev/null") # lstat the 10000
directories mounted via NFS
t2 = time.time()
print >> sys.stderr, "%.3f" % (t2 - t1), rv
}}}
where a.out is the following C code :
{{{
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
int main(int argc, char **argv)
{
int i, n = atoi(argv[1]);
char filename[64];
struct stat statbuf;
for (i = 0; i < n; i++) {
sprintf(filename, "/baz/bar%d", i);
lstat(filename, &statbuf);
} printf("done\n");
return 0;
}
}}}
Attachments :
B1.jpg and B2.jpg - runtimes on the 2 client machines - X-axis : iteration number
Y-axis : run-time
Config files : - for the machines B1, B2 and A
b1.2.6.26.3.config
b2.2.6.24.config
a.2.6.26.config
- P
Quoted 9 lines · Ray Lee
[ adding netdev, linux-nfs to cc: -- rbl ]
Hi,
We have a simple python program which keeps running a C loop to lstat NFS mounted directories. We are seeing some weird behavior w.r.t. the run-time of this program on 2.6.26.3 kernel vs 2.6.24 kernel.
Quoted 5 lines
The run-time of the following code increases over time on the 2.6.26.3 kernel, whereas remains flat (as expected) on the 2.6.24 kernel. [See attached graphs - B1.jpg and B2.jpg] Once the 2.6.26.3 machine gets into this state, we need to restart the box to get back to reasonable run-times. Is this a known issue ?
Could you try applying the following patch?
Trond
PS: note that your 2.6.26 config file has _very_ different memory models and kernel debugging options enabled compared to your 2.6.24 kernel. That may also affect performance.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
[ sigh, adding back original reporter. Oops. -- rbl ]
Priyank Patel, please see Trond's response below and try out the suggested patch linked below.
Quoted 26 lines · Trond Myklebust
Quoted 9 lines · Ray Lee
[ adding netdev, linux-nfs to cc: -- rbl ]
Hi,
We have a simple python program which keeps running a C loop to lstat NFS mounted directories. We are seeing some weird behavior w.r.t. the run-time of this program on 2.6.26.3 kernel vs 2.6.24 kernel.
Quoted 5 lines
The run-time of the following code increases over time on the 2.6.26.3 kernel, whereas remains flat (as expected) on the 2.6.24 kernel. [See attached graphs - B1.jpg and B2.jpg] Once the 2.6.26.3 machine gets into this state, we need to restart the box to get back to reasonable run-times. Is this a known issue ?
Could you try applying the following patch?
Trond
PS: note that your 2.6.26 config file has _very_ different memory models and kernel debugging options enabled compared to your 2.6.24 kernel. That may also affect performance.
Quoted 6 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
(cc's restored)
Please always do reply-to-all when working with kernel people. It's important.
Thanks.
Quoted 30 lines · On Tue, 9 Dec 2008 16:31:32 +0000 (UTC) David Flynn…
Quoted 6 lines · Priyank Patel
We have a simple python program which keeps running a C loop to lstat NFS mounted directories. We are seeing some weird behavior w.r.t. the run-time of this program on 2.6.26.3 kernel vs 2.6.24 kernel.
The run-time of the following code increases over time on the 2.6.26.3 kernel, whereas remains flat (as expected) on the 2.6.24 kernel.
I'm seeing a similar effect, and ran a benchmark pre and post reboot:
$ strace -T /usr/sbin/bonnie++ -d . -s 0 -f -n 1 >/tmp/bonnie-r44237-netslow 2>&1 ...reboot... $ strace -T /usr/sbin/bonnie++ -d . -s 0 -f -n 1 >/tmp/bonnie-r44237-netfast 2>&1Graphs of the operations are avaliable:
http://davidf.woaf.net/nfsfail-2.6.26/In particular http://davidf.woaf.net/nfsfail-2.6.26/r44237-stat.pdf
r44237-* was a machine with a 28 day uptime and r44088-* is an identical machine with 14 day uptime.
The graphs show times as recorded by strace for each syscall (points), a cumulative frequency plot is also drawn on the same graph (lines). yellow-orange points/lines are before the reboot, purple afterwards.
The machines are part of a cluster with a r/o nfsroot and common debian stock kernel:
Linux r44088 2.6.26-1-amd64 #1 SMP Sat Aug 2 11:15:08 GMT 2008x86_64GNU/Linux
Quoted 7 lines
Other nfs filesystems are also mounted; all nfs mounts are nfsv3 over udp.
Has this issue been identified or resolved in 2.6.27?
Extra logs can be provided if required.
..david
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html