LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 04-13-2013, 08:25 PM   #1
kktester
LQ Newbie
 
Registered: Jul 2012
Posts: 17

Rep: Reputation: Disabled
Custom debootstrap build live cd slow write speed on ssd


I have been building a live cd based on ubuntu 12.04 with kernel 3.2.0-38-generic ( usind debootstrap ) and everything runs fine, except I find when connecting to a NTFS drive writing to the drive is very slow. If I do the same test with the standard ubuntu live cd the write speed is far greater.
Just to note, both are run off a usb stick and the NTFS drive is my internal SSD drive.

The only thing I can think of is I am missing a package. I am explictly installing ntfs-3g. Is there anything else I should be including.

Please note, this seems to be a problem regardless of which desktop I try.Eg:
lubuntu-desktop or ubuntu-desktop packages.

The test I do is to copy a large file to ram rename it and then copy it to the ssd drive. My builds take 3 times as long to copy. Also my USB 3 drive seems to suffer the same way slow write speed ( althout this may be another issue ).

This is my full list of packages I install
discover laptop-detect os-prober casper lupin-casper linux-firmware linux-image-3.2.0-38-generic xorg ntfs-3g ubuntu-desktop

Thanks for any ideas you can share

Last edited by kktester; 04-13-2013 at 09:59 PM.
 
Old 04-15-2013, 03:11 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,252

Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
the definitive test is hdparm -tT /dev/disk

On internal disks, that's caused by the motherboard chipset driver being wrong. On USB disks, naturally, I would suspect the usb driver in the first instance. On your system, small disk cache in ram could also be an issue.
 
Old 04-16-2013, 06:53 AM   #3
kktester
LQ Newbie
 
Registered: Jul 2012
Posts: 17

Original Poster
Rep: Reputation: Disabled
Thanks for the reply. When I run the command all looks good... I think
sudo hdparm -tT /dev/sda

/dev/sda:
Timing cached reads: 13500 MB in 2.00 seconds = 6753.68 MB/sec
Timing buffered disk reads: 1450 MB in 3.00 seconds = 483.24 MB/sec

The problem is writting to the disk.

I am interested in your comments, can you provide more information how I can check/change the cache size.

As I said before the first copy I do to the drive is fast. After that though, the speed goes way down. I does not matter if I umount the drive it stays slow on writes.
 
Old 04-16-2013, 12:16 PM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,252

Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
I'm not the expert on this, but that's pointing to mount options. I stuck an SSD into this box, scratched for what options to use, and ended up this way for each partition:

Code:
/dev/sda6        /home            ext4        noatime,diratime,discard         1 2
It does need more regular checks than normal disks. No clue how to check cache size - google is your friend there.
 
Old 04-17-2013, 12:56 AM   #5
kktester
LQ Newbie
 
Registered: Jul 2012
Posts: 17

Original Poster
Rep: Reputation: Disabled
Hi

Thanks for the reply... I tried noatime,diratime,discard but when I checked with the mount command only noatime was set.
Maybe this is because my drive is NTFS, I dont know.

Here is the mount options for the drive after adding your suggestion
/dev/sda2 on /media/Windows7_OS type fuseblk (rw,nosuid,nodev,noatime,allow_other,blksize=4096) [Windows7_OS]
and if I auto mount without your options
/dev/sda2 on /media/Windows7_OS type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096) [Windows7_OS]

Anyway, the more I look at this the less I think its to do with settings and more to do with a missing package. If it was the cache or the mount settings I would expect to be able to reset it by umounting the drive. But the write speed just keeps getting slower.

I am in the process of checking each package and comparing it with the ubuntu live cd.

If you have any other suggestions please let me know
 
Old 04-17-2013, 04:14 AM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,252

Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
I'm thinking you may have a small disk cache in the scheme of things when you have a large file in ram. Try this command

time cp file > disk; time sync

Either way, a pc is full of bottlenecks. You are never going to be able to feed a disk at near 480MB/S. Where's it going to come from? A better test might be to use a fifo, (first in, first out). In your ram disk try something along these (untested) lines
prep in your ramdisk:
mkfifo test.fifo

The test:
time dd if=/dev/zero of=test.fifo & time dd if=test.fifo out=/ssd/somefile

I would expect that to achieve about 1/3 of your ram speed as reported by memtest, provided no bottlenecks exist. When you think that ram access times is of the form 6-1-1-1, you'll realise that the '6' is a significant bottleneck. Is the task getting 100% cpu time? How wide is your disk access? Many chips haven't the width in hardware they really require. This has the benefit that test.fifo stays small. Set size limits, and you should get all the statistics you want.
 
Old 04-19-2013, 11:57 AM   #7
kktester
LQ Newbie
 
Registered: Jul 2012
Posts: 17

Original Poster
Rep: Reputation: Disabled
I have been playing with Puppy linux to see how it compares with Ubuntu and I cannot repeat the problem when running puppy linux. I also found that I get the same write access slow rate using the standard ubuntu live cd ( it just takes a few copies to get the slow write speed ). Needless to say that when I run Windows 7 64 bit as the OS I have the same performace as Puppy linux.

For your info, I have a Thinkpad X220 with I7 sandbridge processor and 8GB of 1300 MHZ RAM. Also when I copy a 3.5GB file to ram it takes around 15Secs and about 30 secs to copy it back to disk. The second time, the read speed is the same but the write speed goes to 1:40 secs. Doing the same with Puppy linux seems to cause no delays in the write ( in both tests the CPU hardly shows any use ).

I have also tried umounting the ram disk I create for the file copy and remounting it but the performace stays slow.

So either I dont know what I am talking about or there seems to be a issue with Ubuntu 12.04 and writing to SSD drives.
 
Old 04-20-2013, 02:56 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,252

Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
Did the sync commands change your test results?
 
Old 04-20-2013, 07:19 PM   #9
kktester
LQ Newbie
 
Registered: Jul 2012
Posts: 17

Original Poster
Rep: Reputation: Disabled
No the sync showed the same timing as before. I am trying to figure out what the difference between puppy linux ( percise ) and ubuntu is and why puppy seems to handle ssd access better.
 
  


Reply

Tags
customized, live cd, performance, ssd


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Very slow Raid performance - Only write speed iSpaZZZ^ Linux - Server 10 11-07-2014 01:31 AM
Ultra slow write speed with custom linux "stacking" block device driver Agarwal6 Programming 4 09-02-2011 12:06 PM
LXer: Build Your Own Custom Ubuntu Live CD LXer Syndicated Linux News 0 11-07-2009 02:30 AM
AoE RAID5 slow build speed poonippi Linux - Software 1 07-23-2009 02:38 PM
Slow RAID write speed in RH9 Phaethar Linux - Hardware 0 12-09-2003 10:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 08:44 PM.

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