Supposed Ubuntu Speedups - Concurrency=shell, readahead profile

Wednesday, December 31, 2008

After seeing Lifehacker blog about a number of Ubuntu speedups, I decided to test some of them to see their actual effectiveness.

The test machine was a Lenovo T61 with a Core 2 Duo T7500 @ 2.2 ghz and 3GB RAM. All boot times are from the grub menu (started when I pressed enter to start the boot) to the appearance of the login screen. I started with a completely fresh installation of Ubuntu 8.10 which I updated and rebooted 3 times. The default settings are "concurrency=none" in /etc/init.d/rc, but I'm unsure of the default readahead settings. It's possible Ubuntu tries to create a profile after installation, but I have no proof of that, so I assume there is no profile.

The results:

  • No modifications (concurrency=none, no readahead profile) - 29.8 sec
  • Concurrency=shell, no readahead profile - 29.2 sec
  • Concurrency=shell, readahead profile - 28.7 sec
  • Concurrency=none, rebuilt readahead profile - 29.2 sec
Also keep in mind all timings are subject to human error. My conclusion is that there are no notable improvements from implementing these tweaks, even with a dual core processor.

Here is my full action log:
  • Install 8.10
  • Update
  • Restart x 2
  • Restart, timed boot - 30.0 sec
  • Restart, timed boot - 29.6 sec
  • Set concurrency=shell in /etc/init.d/rc
  • Restart, timed boot - 29.9 sec
  • Restart, timed boot - 29.1 sec
  • Restart, added "profile" to end of grub line
  • Timed boot for profile creation - 1 min, 27.7 sec (This is normal)
  • Restart, timed boot - 28.7 sec
  • Restart, timed boot - 27.9 sec
  • Restart, timed boot - 29.6 sec
  • Set concurrency=none in /etc/init.d/rc
  • Restart, added "profile" to end of grub line
  • Timed boot for profile creation - 1 min, 29.1 sec (This is normal)
  • Restart, timed boot - 29.3 sec
  • Restart, timed boot - 29.1 sec

Posted by Craig Younkins at 12:07 PM 3 comments  

Ubuntu boot times - CD vs USB flash drive

Saturday, November 1, 2008

New with Ubuntu 8.10 "Intrepid Ibex" is the ability to create a bootable USB flash drive with a persistent filesystem.


I compared the time to start from when I pressed enter for "Try Ubuntu" until the desktop had loaded with the panel, icons, and wallpaper. Here's what I found:

USB flash drive: 1:44
CD: 2:40

That's a pretty significant improvement in speed! Also, since there's no CD to spin up, anything requiring data off the drive occurs with much less lag. Of course, your results may vary. Transfer speeds on flash drives do vary. I found that my Cruzer Micro 2GB was much faster than a PNY Attache 1GB.

This is so great, one of my flash drives will probably be dedicated to it. :-)

Posted by Craig Younkins at 10:08 PM 1 comments  

Amazon S3 upload script

Thursday, October 9, 2008

I want to share with you a script I've been hacking on to quickly and easily upload files to Amazon's S3 service. upload_to_s3.py takes the name of the bucket as a parameter, and a list of files to upload from standard in. It is intended to run in the background, and communicates to the user by libnotify/pynotify. When it's done uploading, the clipboard is set with the url(s) to the file(s).

Please note that before using upload_to_s3.py, you must enter your S3 access key and secret access key in the script.

Example usage:

cd /directory/with/media/files/
find | grep -v ".svn" | python /path/to/update_s3.py
The script requires Amazon's S3 Library for REST in Python. As of version 2007-11-05, I had to follow user uuorld's suggestion to modify line 295:
"I found that changing the line
headers['Date'] = time.strftime("%a, %d %b %Y %X GMT", time.gmtime())
to
headers['Date'] = time.strftime("%a, %d %b %Y %H:%M:%S GMT", time.gmtime())
resolved some issues I was having with different locales using 24 or 12-hour clocks."
Big thanks go out to Adrian Holovaty for his script that I hacked on quite a bit. See his blog post here.

As always, please feel free to email me comments or suggestions about the code.

I'm using this script to incorporate right click uploading into Thunar. Here's how I'm doing it:














* Edit -> Configure Custom Action - > New

* Name: "Upload to S3 random"
* Command: `echo %f | python "/path/to/upload_to_s3.py" bucket` (You need to change the path and the bucket. Do not include the backticks.)
* Icon -> Action Icons -> gtk-go-up
* Appearance conditions -> All except directories

Unfortunately, I don't believe you can use a custom action to upload multiple files using this script because Thunar space delimits the paths. When your paths have spaces, you can no longer separate each file.

Enjoy!

UPDATE:
It seems S3 has become more strict about the headers required in file upload, so this script needs a minor patch to add the Content-Length header. In the conn.put call, add

'Content-Length': len(filedata)

to the data dictionary.

Posted by Craig Younkins at 6:34 PM 0 comments