The short answer to your question : changing to 32-bit version of Ubuntu should not make any difference in performance, because Ubuntu overall (32 or 64 bit) is perhaps one of the most resource-demanding Linux distros; it's just build that way, but there are methods to improve its performance.
My Experience
I'm also running 64 bit version of Ubuntu 14.04 on a laptop with 6GB of RAM and single-core CPU, and on average I've got 2 GB to 3.3 GB of RAM usage (which I regularly check with htop
and free -h
commands), and that's with either Cinnamon or Unity desktops, and with various tune-ups on the software side done. Is there anything special I do? Nope; in a typical everyday session I have just couple firefox tabs and terminal open - that's all. On another laptop (2 GB RAM, two-core CPU) I have Linux Mint 17 (Qiana),also 64-bit ; and it also uses up 2 GB of RAM on average, plus swap memory ( which is kind of "borrowed" from hard-drive space, and hard drive isn't that fast). As you may know, Linux Mint is derived from Ubuntu and "under the hood" they're not that different. So you can see that Ubuntu's memory usage is quite large. I'm going to share with you what I've learned so far and what I've done so far to tune the performance.
The Hardware Side of the Issue
The best improvement to any computer and any OS is in the hardware - more RAM, better CPU, and switching to a solid-state drive(ssd) are always good ways to improve performance. You might not realize it, but everything you do on a computer is read-write operation, whether it's in RAM or your drive, and with read/write operations speed solid state drives win a lot. Plus considering that their price is going down now, its a worthwhile investment. I've experimented with a chromebook (which as you may know has 16 GB SSD in the cheapest version). The speed was quite decent, considering that I was using 32 bit version of the OS and on a such crammed-down hard-drive, and nope, that wasn't Ubuntu in crouton, that was an install to the ssd itself.
Well known performance boosters
Many of these are found everywhere online, in fact I've first learned them form howtogeek.com article.
- Remove unnecessary start-up applications. First , show all hidden applications. To do that type in terminal
sudo sed -i ‘s/NoDisplay=true/NoDisplay=false/g’ /etc/xdg/autostart/*.desktop
. Now,type in dash Startup and open Startup Applications app. No printer or scanner ? Get rid of those on startup. No bluetooth ? Get rid of that,too. Chat can be disabled safely. I keep Files disabled,too (I use different file manager anyway). Don't need Onboard (on-screen keyboard) ? Well, you get the idea . . . .
- Disable services with BootUp-Manager (
sudo apt-get install bum
). Becareful though - it's a serious tool, not a toy.
- If you go to Windows only rarely, and want to boot into Ubuntu first thing in the morning, you want to change
GRUB_TIMEOUT
line in /etc/default/grub
file to be GRUB_TIMEOUT=0
- Change how aggressively Ubuntu sends stuff into swap (borrowed) memory, by changing swappiness value. Simply add
vm.swappiness = 5
line to /etc/sysctl.conf
file.
- Try using lighter desktop, like LXDE or XFCE.
Tune the Graphics
The big improvement to your experience with Ubuntu will come from tuning down the graphic effects. Many people suggest switching to lighter desktop environment, like Enlightenment , LXDE , or XFCE (and by the way, instructions for installing them you can find at What kinds of desktop environments and shells are available?) . But if you like the default desktop environment, you may want to download CompizConfig Settings Manager (available through Software Center or by typing in terminal sudo apt-get install compizconfig-settings-manager
). Once you got it, uncheck "copy to texture", choose fast texture filter under OpenGL, and uncheck all effects. See the screenshots of my ccsm configuration bellow. Try experimenting with the settings, of course, but remember that this is a serious tool - you can break something with it, so use caution. IMHO, this is the best tool you can use to improve your experience with Ubuntu's default Unity desktop environment if your RAM or graphics card isn't that great.
Tweak the /etc/fstab file
Remember I've mentioned that everything is a read-write operation as far as a computer is concerned ? Linux updates information about when a file was accessed, even if a file was accessed only for reading; that means the system makes an unnecessary write to disk. What if you'd want to minimize unnecessary writes ? Sounds like a reasonable thing, especially in SSD - the less writes, the longer it lives.
To do that, add noatime,reatime
words to your /etc/fstab
file, in the line with configuration for your hard drive. Example is bellow (Note that in SSD drive, only noatime
is needed,for more info read Arch Wiki):
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda5 during installation
UUID=blahblahblahblah-blablah / ext4 relatime,noatime,errors=remount-ro 0 1
There's another hack to /etc/fstab
file that I understand somewhat less, but in a nut shell is supposed to improve shared memory (and improving memory is a good thing, always). I've found it on CyberCiti blog. Basically, you'd add a line none /dev/shm tmpfs defaults,size=5G 0 0
and execute mount -o remount /dev/shm
. Now , 5G is perhaps too much. On average my shared memory doesn't rise beyond 1M , so I'd say make it 1G or 500M.
Remove some unnecessary init scripts
Ubuntu at boot runs a set of scripts, that start services like network manager or bluetooth. This whole idea of init scripts may be a bit technica, but in a nutshell there's /etc/init
and bunch of /etc/rc*.d
folders, where * is a number. Almost all the time, ubuntu session uses stuff in '/etc/init' and /etc/rc2.d
folders.
You might not want to start some services/scripts at all. For instance, bluetooth, or brltty, which is an accessibility feature for visually impaired. What I did is to comment out the start on
command in /etc/init/bluetooth.conf
like so
# bluez - bluetooth daemon
description "bluetooth daemon"
# start on started dbus
stop on stopping dbus
env UART_CONF=/etc/bluetooth/uart
env RFCOMM_CONF=/etc/bluetooth/rfcomm.conf
With brltty.conf, I believe i completely removed any traces of that program and the config file. How about scanner script (S20saned) in /etc/rc2.d/
? Well, you can rename it by using mv /etc/rc2.d/S20saned /etc/rc2.d/K20saned
.
In fact, that's the same thing that can be done through BootUp-Manager or Startup applications, only in command line.
Limit number of processes for a user
I've actually learned this off CyberCiti's article on "fork bomb".
Basic idea is to prevent a user from running to many processes, thus limiting the amount of memory a session eats-up.
Simply edit /etc/security/limits.conf
file as such
someuser hard nproc 500
The article doesn't say what number would be reasonable, so its up to you to figure this out.
Other small ideas
- tweak configurations and appearance with Unity Tweak Tool
- Use dconf and gconf editors to alter system settings.
- Removing unnecessary apps to free up disk space (self explanatory, right ?)
- Try switching to HTML 5 rather than flash. On my laptop, in full screen youtube is painfully glitchy. Sure, my graphics card ain't that good, but hey, it works with HTML 5 so much much better, lag is much rare-er.
- Clean cache regularly; Use BleachBit to clean everything up.
- Get laptop enough air-flow by raising it, or using higher battery, or cooling stands (pretty cheap on amazon). Basically, avoid overheating
- Get faster network adapter
- avoid gaphically demanding apps. These days I'm writing much stuff in
nano
command line text editor - rarely go to OpenOffice.
- check if your laptop is detecting all CPU cores, by using
lscpu
commands, and reading line Core(s) per socket
. If it gives something other than what you supposed to have, you have a problem. There are patches for that, amd-microcode
and for intel-microcode
- read logs from
/var/log
folder, specifically dmesg
and syslog
.
- try different desktop manager, like
gdm
- investigate running services with 'initctl list'
- investigate which processes take lost of memory by using
htop
, ps aux
, and top
.
Conclusion
I've tried listing some of the tweaks I've done with my Ubuntu, but as I tend to do, I probably forgot something and might return to add details. Let me know if any of this is too technical and I'll try to explain in more simple terms. To other users - please let me know if I should add something or edit something. Cheerios!