Return-Path: Received: from mail.saout.de ([127.0.0.1]) by localhost (mail.saout.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iBXy5edCMd6F for ; Mon, 6 Feb 2012 23:28:25 +0100 (CET) Received: from nm3-vm0.bullet.mail.ird.yahoo.com (nm3-vm0.bullet.mail.ird.yahoo.com [77.238.189.213]) by mail.saout.de (Postfix) with SMTP for ; Mon, 6 Feb 2012 23:28:24 +0100 (CET) Message-ID: <1328567304.90926.YahooMailNeo@web29602.mail.ird.yahoo.com> Date: Mon, 6 Feb 2012 22:28:24 +0000 (GMT) From: Mickael MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Subject: [dm-crypt] Poor performances with nfs and Kernel 3.x Reply-To: Mickael List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "dm-crypt@saout.de" Hello,=0AI'm writing about poor performances accessing a dm-crypt/LUKS part= ition using nfs.=0A=0AI was running a fileserver Ubuntu_Server_11.04 (Kerne= l 2.6.38-13#52) with no problem.=0ABut after an upgrade to Ubuntu_Server_11= .10 (Kernel 3.0.0-15#26) reading and writing a crypted partition with nfs i= s very slow.=0A=0AI've made different tests with a 2GB file to show the dif= ference when the server is running a 2.6 or 3.0 kernel.=0AAll others parame= ters are always the same.=0A=0AFirst, a test using nfs to access a crypted = partition (dm-crypt/LUKS/ext4) on the server:=0A*Svr Kernel 3.0.0-15#26=A0 = : NFS (R/W) =3D 30 MB/s / 33 MB/s=A0=A0 <-------- The problem is here !=0A*= Svr Kernel 2.6.38-13#52 : NFS (R/W) =3D 81 MB/s / 53 MB/s=0A=0AAs you can s= ee, with the Kernel 3.0, performances are very bad. The flow is always cons= tant at ~30MB; there's clearly a limitation=0A=0AFor comparison, the same t= est, but this time, using nfs to read and write a non-crypted partition (ex= t4) (same HD of the crypted partition):=0A*Svr Kernel 3.0.0-15#26=A0 : NFS = (R/W) =3D 92 MB/s / 77 MB/s=0A*Svr Kernel 2.6.38-13#52 : NFS (R/W) =3D 111 = MB/s / 74 MB/s=0AUsing nfs without dm_crypt, performances are good with the= 2 Kernels=0A=0AIs dm_crypt module the problem ?=0AFollowing, a test withou= t nfs, copying the 2GB file using a 2nd HD on the server from/to the crypte= d partition:=0A*Svr Kernel 3.0.0-15#26=A0 : cp (from/to) the crypted partit= ion =3D 64 MB/s / 57 MB/s=0A*Svr Kernel 2.6.38-13#52 : cp (from/to) the cry= pted partition =3D 61 MB/s / 60 MB/s=0AUsing dm_crypt without nfs, there's = no difference between the 2 Kernels=0A=0AApparently, there is a bad interac= tion between nfs and dm_crypt only with a 3.0 Kernel ?=0AWhat king of chang= e has been made in the Kernel 3.x branch ?=0ADo you think that the dm_crypt= module is involved ? Or perhaps it's a mapper/buffer problem ?=0Anfs seems= to work correctly: no paquets are lost during transfers (I'm using default= parameters, except for exportfs: async option instead of sync)=0AUnfortuna= tely, I'm just an user and my knowledge is limited, especially with dm_cryp= t and device_mapper.=0APerhaps you can help me with this part ?=0A=0AFeel f= ree to ask more informations / tests.=0A=0ARegards,=0AMickael=0A=0A=0ANote:= =0A- I've build other servers with a debian Wheezy (Kernel 3.1.0-1) and a F= edora 16 (Kernel 3.2.1-3).=0ABoth obtained the same results.=0A=0A- Followi= ng, hardware/software informations about my system:=0A=0A* Kernel version (= from /proc/version):=0ALinux version 3.0.0-15-server (buildd@crested) (gcc = version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) ) #26-Ubuntu SMP Fri Jan 20 19= :07:39 UTC 2012=0A=0A=0A* Environment (Server)=0ACPU AMD Athlon64 3500+ (1c= ore)=0A1GB RAM=0Amobo Asus A8N nForce4=0Aeth 1GB nForce4=0AHD WD 2To Green = (sata_nv)=0A=0A=0A:~$ cryptsetup luksDump /dev/sda1=0AVersion:=A0=A0=A0=A0= =A0=A0 =A0=A0=A0 1=0ACipher name:=A0=A0 =A0=A0=A0 aes=0ACipher mode:=A0=A0 = =A0=A0=A0 cbc-essiv:sha256=0AHash spec:=A0=A0=A0=A0 =A0=A0=A0 sha1=0APayloa= d offset:=A0=A0=A0 2056=0AMK bits:=A0=A0=A0=A0=A0=A0 =A0=A0=A0 256=0A=0A=0A= :~$ mkfs.ext4 /dev/mapper/crypted -m 0.2=0A=0A=0A:~$ exportfs -v=0A/mnt/cry= pted=A0=A0=A0=A0 =A0=A0=A0 192.168.0.1(rw,async,wdelay,no_root_squash,no_su= btree_check)=0A=0A=0A:~$ cat /proc/mount (server)=0A/dev/mapper/crypted /mn= t/crypted ext4 rw,relatime,user_xattr,acl,barrier=3D1,data=3Dordered 0 0=0A= =0A:~$ cat /proc/mount (client)=0Anfsd /proc/fs/nfsd nfsd rw,relatime 0 0= =0A192.168.0.10:/mnt/crypted/ /mnt/crypted nfs4 rw,relatime,vers=3D4,rsize= =3D131072,wsize=3D131072,namlen=3D255,hard,proto=3Dtcp,port=3D0,timeo=3D600= ,retrans=3D2,sec=3Dsys,clientaddr=3D192.168.0.1,minorversion=3D0,local_lock= =3Dnone,addr=3D192.168.0.10 0 0=0A=0A=0A:~$ nfsiostat (after reading and wr= iting a 2GB file)=0A192.168.0.10:/mnt/crypted/ mounted on /mnt/crypted:=0A= =A0=A0 op/s=A0=A0=A0 =A0=A0=A0 rpc bklog=0A1432.16 =A0=A0=A0 =A0=A0 0.88=0A= read:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ops/s=A0=A0=A0 =A0=A0=A0 =A0=A0 k= B/s=A0=A0=A0 =A0=A0=A0 =A0 kB/op=A0=A0=A0 =A0=A0=A0 retrans=A0=A0=A0 =A0=A0= =A0 avg RTT (ms)=A0=A0=A0 avg exe (ms)=0A=A0=A0=A0 =A0=A0=A0 =A032.037 =A0= =A0=A0 4108.500 =A0=A0=A0 128.242=A0=A0=A0=A0=A0=A0=A0 0 (0.0%) =A0=A0=A0 = =A066.974 =A0=A0=A0 =A094.895=0Awrite:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ops= /s=A0=A0=A0 =A0=A0=A0 =A0=A0 kB/s=A0=A0=A0 =A0=A0=A0 =A0 kB/op=A0=A0=A0 =A0= =A0=A0 retrans=A0=A0=A0 =A0=A0=A0 avg RTT (ms)=A0=A0=A0 avg exe (ms)=0A=A0= =A0=A0 =A0=A0=A0 =A047.713 =A0=A0=A0 4116.645 =A0=A0=A0 =A086.280=A0=A0=A0= =A0=A0=A0=A0 0 (0.0%) =A0=A0=A0 =A027.833 =A0=A0=A0 1814.244=0A=0A192.168.0= .10:/mnt/sda2/ mounted on /mnt/sda2:=A0 (sda2 -> ext4 not crypted partition= )=0A=A0=A0 op/s=A0=A0=A0 =A0=A0=A0 rpc bklog=0A9417.74 =A0=A0=A0 =A0=A0 5.3= 7=0Aread:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ops/s=A0=A0=A0 =A0=A0=A0 =A0= =A0 kB/s=A0=A0=A0 =A0=A0=A0 =A0 kB/op=A0=A0=A0 =A0=A0=A0 retrans=A0=A0=A0 = =A0=A0=A0 avg RTT (ms)=A0=A0=A0 avg exe (ms)=0A=A0=A0=A0 =A0=A0=A0 199.295 = =A0=A0=A0 25502.509 =A0=A0=A0 127.964=A0=A0=A0=A0=A0=A0=A0 0 (0.0%) =A0=A0= =A0 =A016.920 =A0=A0=A0 =A022.618=0Awrite:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= ops/s=A0=A0=A0 =A0=A0=A0 =A0=A0 kB/s=A0=A0=A0 =A0=A0=A0 =A0 kB/op=A0=A0=A0= =A0=A0=A0 retrans=A0=A0=A0 =A0=A0=A0 avg RTT (ms)=A0=A0=A0 avg exe (ms)=0A= =A0=A0=A0 =A0=A0=A0 329.141 =A0=A0=A0 25555.419 =A0=A0=A0 =A077.643=A0=A0= =A0=A0=A0=A0=A0 0 (0.0%) =A0=A0=A0 =A0 3.888 =A0=A0=A0 507.813=0A=0A=0A:~$ = cat /proc/fs/nfsd=0Aexport_features:=A0=A0=A0 0x17e3f 0xf=0Aexports:=A0=A0= =A0 /mnt/crypted=A0=A0=A0 192.168.0.1(rw,no_root_squash,async,wdelay,no_sub= tree_check)=0Amax_block_size:=A0=A0=A0 131072=0Anfsv4gracetime:=A0=A0=A0 90= =0Anfsv4leasetime:=A0=A0=A0 =A0=A0=A0 90=0Anfsv4recoverydir:=A0=A0=A0 /var/= lib/nfs/v4recovery=0Apool_stats:=A0=A0=A0 0 350070842 335513464 11979013 24= =0Apool_threads:=A0=A0=A0 8=0Aportlist:=A0=A0=A0 udp/tcp=3D2049=0Asupported= _krb5_enctypes:=A0=A0=A0 18,17,16,23,3,1,2=0Athreads:=A0=A0=A0 8=0Aversions= :=A0=A0=A0 +2 +3 +4 +4.1=0A=0A=0A:~$ cat /sys/kernel/slab/dm_crypt_io/=0Aal= iases : [0]=0Aalign : [8]=0Aalloc_calls : []=0Acache_dma : [0]=0Acpu_slabs = : [1 N0=3D1]=0Actor : []=0Adestroy_by_rcu : [0]=0Afree_calls : []=0Ahwcache= _align : [0]=0Amin_partial : [7]=0Aobjects : [26 N0=3D26]=0Aobject_size : [= 152]=0Aobjects_partial : [0]=0Aobjs_per_slab : [26]=0Aorder : [0]=0Apartial= : [0]=0Apoison : [0]=0Areclaim_account : [0]=0Ared_zone : [0]=0Aremote_nod= e_defrag_ratio : [100]=0Areserved : [0]=0Asanity_checks : [0]=0Ashrink : []= =0Aslabs : [1 N0=3D1]=0Aslab_size : [152]=0Astore_user : [0]=0Atotal_object= s : [26 N0=3D26]=0Atrace : [0]=0Avalidate : []