[Bug 654764] Re: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive
** Changed in: ecryptfs-utils (Ubuntu) Status: Confirmed => Invalid -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/654764 Title: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive To manage notifications about this bug go to: https://bugs.launchpad.net/ecryptfs/+bug/654764/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 654764] Re: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive
I'm using eCryptfs on top of ext4 on a Crucial C300 256GB SDD. For the first couple of months, I had the ext4 filesystem mounted with option discard and I was very disappointed by the performance. Specifically, in KMail, jumping through unread messages, stored in my eCryptfs HOME, was accompanied by a very disruptive lag. Listing a directory on the command line (ls) the first time had a similar lag. SSDs are supposed to be fast, aren't they? I was resigned to accept this as the price I had to pay for encryption. A few weeks ago, triggered by another discussion, I mounted the ext4 fs without discard. The effect is extremely noticeable: there are no lags anymore, everything happens instantly. I gladly exchange this newfound speed for running fstrim every now and then. I haven't undertaken any measurements as I didn't need any more convincing. In particular, I can't say whether eCryptfs was at all implicated in the lags I observed. The bit of advice I have to offer is to try and mount the SSD without discard and see if the performance improves. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/654764 Title: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive To manage notifications about this bug go to: https://bugs.launchpad.net/ecryptfs/+bug/654764/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 654764] Re: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive
Using full-disk encryption with encrypted LVM suffers from no such speed issues. However I am not sure how an SSD will fare without TRIM being sent to it. I am determined to try that soon. :D -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/654764 Title: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive To manage notifications about this bug go to: https://bugs.launchpad.net/ecryptfs/+bug/654764/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 654764] Re: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive
Marking this as "fixed released" after the 2.6.39-rc5 kernel. It included a patch which included commit 57db4e8d73ef2b5e94a3f412108dff2576670a8a to convert eCryptfs to a writeback caching model. The performance boost isn't as big as I'd hoped because we still have to flush the dirty data upon closing the file. This involves encrypting the data and writing it to the lower filesystem. Due to the current eCryptfs architecture, there's simply not many more options to significantly increase the performance. Software encryption is expensive. ** Changed in: ecryptfs Status: Confirmed => Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/654764 Title: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 654764] Re: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive
Marking confirmed/medium in Ubuntu to match upstream. Note that this bug will be fixed in the kernel, rather than in the ecryptfs-utils userspace toolset, but we're tracking discussions here. I'll mark this fix-released when an Ubuntu kernel contains a fix. ** Changed in: ecryptfs-utils (Ubuntu) Status: New => Confirmed ** Changed in: ecryptfs-utils (Ubuntu) Importance: Undecided => Medium -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/654764 Title: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 654764] Re: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive
I've tested it on my new Dell E6410 and the difference is about 1/10 of performances between ecryptfs ext4 and regular ext4 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/654764 Title: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
Re: [Bug 654764] Re: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive
On Fri Jan 28, 2011 at 03:18:38AM -, Dustin Kirkland wrote: > time dd if=/dev/zero of=~/dummy bs=512 count=10240 There are a couple issues here: 1. eCryptfs currently implements a write-through cache. This means that reads are cached, but writes are not. There's currently someone investigating a switch to a proper write-back cache on files opened without the O_SYNC flag. This would result in writes being cached and, more importantly, write() returning before the page is encrypted. Some rough, initial tests show a very nice improvement. 2. bs=512 results in a 4 writes to a single page, meaning that single page is encrypted 4 times in a row and dd has to wait on the page encryption and writing 4096 bytes to the lower filesystem every time. This is why doing what I talked about in #1 has so much potential to increase performance. Encryption isn't free, but we should be a little smarter about when we do it. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/654764 Title: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
Re: [Bug 654764] Re: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive
Encryption ain't free. Here are three really rough tests on my side: To encrypted home: time dd if=/dev/zero of=~/dummy bs=512 count=10240 10240+0 records in 10240+0 records out 5242880 bytes (5.2 MB) copied, 0.456936 s, 11.5 MB/s real0m0.459s user0m0.010s sys 0m0.440s To my SSD, not encrypted: time dd if=/dev/zero of=/local/dummy bs=512 count=10240 10240+0 records in 10240+0 records out 5242880 bytes (5.2 MB) copied, 0.0222484 s, 236 MB/s real0m0.024s user0m0.000s sys 0m0.020s To shared memory: time dd if=/dev/zero of=/tmp/dummy bs=512 count=10240 10240+0 records in 10240+0 records out 5242880 bytes (5.2 MB) copied, 0.0177176 s, 296 MB/s real0m0.020s user0m0.000s sys 0m0.010s There is some encryption overhead, but also, the ecryptfs data is written synchronously to the disk, whereas these other tests are cached (as I understand it). -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/654764 Title: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 654764] Re: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive
I know this bug is about SSD performance. I'm adding my comments about performance on magnetic disks here rather than filing another bug, as the issue seems to be the same. I have encrypted my /home folder on a Maverick Meerkat Ubuntu (and later Xubuntu installation), fully updated. Root (/) and /home share the same hard drive partition. Disk performance is sometimes so slow that it interferes with my ability to use the machine. Disk performance on the /home folder is dramatically different from /tmp: $ time dd if=/dev/zero of=~/dummy bs=512 count=10240 2.4 MB.s real 0m2.217s user 0m0.028s sys 0m2.176s $ time dd if=/dev/zero of=/tmp/dummy bs=512 count=10240 42.6 MB.s real 0m0.152s user 0m0.012s sys 0m0.136s -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/654764 Title: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 654764] Re: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive
Hi I ran the same tests on a Lenovo T500 === encryptfs 100+0 records in 100+0 records out 102400 bytes (1.0 GB) copied, 58.1711 s, 17.6 MB/s real0m58.242s user0m0.150s sys 0m57.850s === non encryptfs 100+0 records in 100+0 records out 102400 bytes (1.0 GB) copied, 16.4165 s, 62.4 MB/s real0m16.463s user0m0.170s sys 0m5.740s === for comparison. -- writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive https://bugs.launchpad.net/bugs/654764 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 654764] Re: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive
You're right, tmpfs with ecryptfs is as slow as my SSD when it comes to writing... Hopefully it can be improved -- writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive https://bugs.launchpad.net/bugs/654764 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
Re: [Bug 654764] Re: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive
> Strange, I've always thought I'm limited by the disk performance... > Althought my tests seemed to be curbed at a certain level Try eCryptfs on tmpfs to test the theory. I see very similar numbers to eCryptfs on ext4 on an SSD. > I hoped it was just a bug, not a limitation. That's what I was getting at in comment #5, I think we're doing an extra page encrypt and writing to the lower file system on every buffered write. It ensures some cache consistency between the eCryptfs page cache and the lower page cache, but I'm not sure if that is actually helpful in the case of eCryptfs mounted on a local filesystem. -- writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive https://bugs.launchpad.net/bugs/654764 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 654764] Re: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive
Strange, I've always thought I'm limited by the disk performance...Althought my tests seemed to be curbed at a certain level, I hoped it was just a bug, not a limitation. Is there any documentation for eCryptfs regarding its read/write performance limits? Or it's just typical for encrypted filesystems? Thanks for looking into this issue. -- writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive https://bugs.launchpad.net/bugs/654764 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 654764] Re: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive
I've taken a cursory look at this and believe you're just hitting the performance limitations of eCryptfs. It is just much more apparent when using an SSD as compared to spinning media. However, I've spotted something that looks a little fishy in ecryptfs_write_end(). We're calling ecryptfs_encrypt_page(), which encrypts the page and writes it to the lower filesystem. But we're calling ecryptfs_encrypt_page() again in ecryptfs_writepage(). I need to do some more work to see if we can remove the call to ecryptfs_encrypt_page() in ecryptfs_write_end() and just let ecryptfs_writepage() handle it. If so, the early testing of removing this call improves performance greatly, but I'm not going to post numbers until I do a little more digging. ** Changed in: ecryptfs Importance: Undecided => Medium ** Changed in: ecryptfs Status: New => Confirmed ** Changed in: ecryptfs Assignee: (unassigned) => Tyler Hicks (tyhicks) ** Changed in: ecryptfs-utils (Ubuntu) Assignee: Tyler Hicks (tyhicks) => (unassigned) -- writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive https://bugs.launchpad.net/bugs/654764 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 654764] Re: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive
That may be the case, hopefully Tyler will comment on that. More speed tests of this drive can be found here: http://www.storagereview.com/ocz_vertex_2_review_120gb -- writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive https://bugs.launchpad.net/bugs/654764 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 654764] Re: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive
the ssd has a sandforce controller with buildin compression. Sequential speeds for random data are ~200MB/s read, ~130MB/s write. 4k random data write with one thread is ~55MB/s, ~115MB/s with 64 threads. It looks like the encryption transforms the 0-data stream in a more or less random data stream. -- writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive https://bugs.launchpad.net/bugs/654764 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 654764] Re: writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive
Hey Tyler, Can you take a look and comment on this? ** Also affects: ecryptfs Importance: Undecided Status: New ** Changed in: ecryptfs-utils (Ubuntu) Assignee: (unassigned) => Tyler Hicks (tyhicks) -- writing to ecryptfs partition on SSD drive is many times slower than writing to unencrypted partition on the same drive https://bugs.launchpad.net/bugs/654764 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs