Outils pour utilisateurs

Outils du site


issue63:labolinux

Ceci est une ancienne révision du document !


DRAFT

TWEET SCREEN FOLKS: Don’t worry, your half-finished project hasn’t been abandoned. Charles will return next month to finish off the Tweet Screen.

ÉCRAN DE TWEET : Ne vous inquiétez pas, votre projet à moitié terminé n'a pas été abandonné. Charles sera de retour le mois prochain pour terminer l'écran de tweet.

The basic idea for this little piece actually came from a real-world situation I found myself in this last school year. An increasing number of fellow teachers are buying netbooks to use in class and at home. Their rationale includes, above all, the ease of transportation of these lightweight computers, though lower prices compared to regular laptops certainly do no harm. However, their initial enthusiasm tends to diminish slightly over time because of the lower speeds netbooks offer - which is when they come to me for advice. The dialogue usually goes this way:

L'idée de base pour cet article vient en fait d'une situation du monde réel à laquelle j'ai été confronté cette dernière année scolaire. Un nombre croissant de collègues professeurs achètent des netbooks à utiliser en classe et à la maison. Leur raisonnement est fondé, par dessus tout, sur la facilité de transport de ces ordinateurs poids plume, bien que le prix plus bas comparé à un portable normal ne fait certainement pas de mal. Cependant, leur enthousiasme initial tend à diminuer légèrement au cours du temps à cause des performances plus faibles que les netbooks offrent - ce pour quoi ils viennent me demander conseil. La conversation se déroule habituellement ainsi :

Teacher: I'm very happy with this new computer, but is there some way we could get a tad more speed out of it? Me: Which operating system are you running? Teacher: (whatever) Me: Hmmm… that won't be easy. Care to try Linux instead? Teacher: Will I be able to continue using Office documents? Me: Why yeah, sure. No problems with virus, either. Teacher: Suits me!

Professeur : Je suis vraiment content de ce nouvel ordinateur, mais y a-t-il un moyen d'en obtenir un peu plus de vitesse ? Moi : Quel système d'exploitation utilisez-vous ?

Professeur : (quelconque)

Moi : Mmmm … Cela ne sera pas facile. Ca vous dit d'essayer Linux à la place ?

Professeur : Pourrai-je continuer à utiliser des documents Office ?

Moi : Oui, bien sûr. Pas de problèmes de virus non plus.

Professeur : Cela me convient !

As you can imagine, the end result of all this is a rising number of happy campers users. However, it has forced me to take some time to think out the choice of distribution to install on their machines. Being recent converts, they themselves usually had no preconceived preferences, but were happy to have me choose. Any version of Ubuntu seemed suitable - mostly for ease of installation and maintenance, though the availability of Catalan language translations was also a positive factor. But I think we can all agree not all *buntu distributions can get the same speed out of lightweight hardware.

Comme vous pouvez l'imaginer, le résultat final de tout ceci est une augmentation du nombre d'utilisateurs heureux. Cependant, cela m'a obligé à prendre le temps de réfléchir à la distribution à installer sur leur machine. En étant des convertis récents, ils n'avaient pas de préférences particulières, mais ils étaient heureux de me choisir. N'importe quelle version de Ubuntu semblait adaptée - principalement pour la facilité d'installation et de maintenance, quoique la disponibilité de la traduction en Catalan était aussi un point positif. Mais, je pense que nous serons tous d'accord, toutes les distributions *buntu n'auront pas les mêmes performances sur du matériel léger.

So I wanted to look at some hard data before coming out with a public recommendation – my professional reputation being at stake, so to speak. Evaluating available possibilities meant finding answers for the following questions, a process that I would like to share with you here: A. Is there really a difference in speed between the various desktop managers? Is this a real difference, as opposed to merely a perceived difference? B. What about the processor and motherboard? What influence do they really have on computer speeds? C. Notebook hard drives do not have a good reputation. Is it important to take this factor into account? Could it be worth the time and money to upgrade the hard drive?

Ainsi, je voulais regarder quelques paramètres matériels avant de venir avec proposition publique - ma réputation professionnelle était en danger pour ainsi dire. Evaluer les alternatives disponibles impliquait de trouver les réponses aux questions suivantes, un cheminement que j'aimerais partager avec vous ici : A. Existe-t-il une réelle différence de vitesse entre les différents gestionnaires de bureau ? Est-ce une réelle différence, ou une seulement une différence subjective ? B. Le processeur et la carte mère ? Quelle influence ont-ils réellement sur la rapidité de l'ordinateur ? C. Les disques durs de portable n'ont pas une bonne réputation. Est-ce important de tenir compte de ce facteur ? Cela vaut-il le temps et l'investissement de remplacer le disque dur ?

To reply to all these questions, I needed a basic experimental protocol that could compare different distributions and computers, but that at the same time represented real-world user experience. Just measuring pure CPU speed or hard drive I/O performance, as most benchmarks do, was not good enough. But, on the other hand, what different people do with their computers can vary quite a bit.

Pour répondre à toutes ces questions, j'avais besoin d'un protocole de test basique qui pourrait comparer différentes distributions et différents ordinateurs, mais qui en même temps représenterait une expérience utilisateur réelle. Une mesure de la vitesse CPU pure ou des performances en E/S du disque dur, comme la plupart des benchmarks font, n'était pas suffisamment bonne. Mais, d'un autre côté, ce que les utilisateurs font avec leur ordinateur est très variable.

This is why I chose to measure something we all do: boot-up the machine. That is to say, I measured in each case the wall-clock time between the moment the BIOS starts loading the kernel, up to the moment in which the user can use the mouse to navigate through menus and get some actual work done. Most of my “experimentation” has been done with an early Acer Aspire One 10“ (1GB RAM, Atom 1.6GHz CPU), though I made some comparisons with other hardware when needed. The equipment used for testing (previous page): a somewhat aging Acer Aspire, with (left to right) its own internal SATA-1 hard drive, a USB 2.0 pen-drive, and an 8GB class-10 SDHC card and its adapter. Though the article is aimed mostly at laptop users, specifically as regards getting the best user experience possible with netbooks and not-quite-bleeding-edge types of hardware, I hope it gives the reader some practical ideas that he or she can try out in other areas as well. Enjoy!

C'est pour cela que j'ai choisi de mesurer quelque chose que nous faisons tous : le démarrage de la machine. C'est à dire que j'ai mesuré dans chaque cas le temps entre le moment où le BIOS commence à charger le kernel et le moment où l'utilisateur peut utiliser la souris pour se déplacer dans les menus et faire quelque chose.

Le matériel utilisé pour les tests (page précédente) : un quelque peu agé Acer Aspire, avec (de gauche à droite) son propre disque dur interne SATA-1, une clé USB 2.0 et une carte SDHC 8GB classe 10 avec son adaptateur.

Bien que l'article soit destiné principalement aux utilisateurs de portables, plus spécifiquement en ce qui concerne la meilleure expérience utilisateur possible avec les netbooks et les types de matériels loins-d'être-avant-gardiste, j'espère qu'il donnera au lecteur une idée pratique qu'il ou elle peut essayer tout aussi bien dans un autre périmètre. Amusez-vous !

The Desktop Manager Though Ubuntu and its derivatives have a reputation of going easy on system resources, this may vary across versions. For example, Kubuntu users' practical experience is that to get a responsive system, you may need some relatively serious power under the hood, specifically in the graphics card department, otherwise you may need to deactivate some of the more funky desktop effects. This may be a show-stopper for the more impatient, who move on to other less beautiful but more speedy desktop managers – been there, done that. On the other hand, Lubuntu is often touted as a more streamlined desktop, suitable for older or less powerful hardware.

Le gestionnaire de bureau

Bien qu'Ubuntu et ses dérivés ont la réputation d'y aller doucement sur les resources système, cela peut varier selon les versions. Par exemple, l'expérience pratique des utilisateurs de Kubuntu montre que pour obtenir un système réactif, vous devez avoir de la puissance sous le capot, spécifiquement au poste carte graphique, sinon vous pourriez avoir besoin de désactiver les effets de bureaux les plus … Cela peut pour les plus impatients, qui passeraient à un autre gestionnaire du bureau moins beau mais plus rapide - j'ai déjà vu ça. D'un autre côté, Lubuntu est souvent présentée comme un bureau plus dépouillé, adapté au matériel plus ancien ou moins puissant.

TODO

The general perception I get – from reading around and my own experience – is that we could probably classify the better-known desktop managers in the following order (from slowest to fastest): 1. Kubuntu, with the KDE plasma desktop manager. 2. The Gnome 3 desktop manager. It is not, for the time being, installed by default by any of the *buntu distributions (though it is the main desktop for some versions of Linux Mint). 3. Ubuntu, with the new Unity manager. 4. Xubuntu, with XFCE 4. 5. Lubuntu, with LXDE, also a relative newcomer to the playground.

So, what truth is there in these user perceptions? I needed some hard data to base my decision on.

The first step was to perform a standard installation of Ubuntu 12.04 for i386, update it to the latest versions of all software packets, and then add the other various desktops:

sudo aptitude install kubuntu-desktop

It may be interesting to note that the finished system occupied just above 5GB, not that much more than the standard single desktop installation of 3GB.

I could then start measuring boot-up times. Perhaps it should be noted that these times are a combination of: - the time it takes the kernel (a vanilla 3.2.0) to load, load initrd, and switch roots; - the time is takes the init process to set up shop (go multiuser, load daemons, etc); - the time for the Xorg windowing system to detect graphics hardware and switch screen mode and resolution; - finally, the time needed for the desktop manager to load its own libraries and display the user's GUI environment.

The first three steps are identical in all cases, and add up to about 20-21 seconds on my test hardware. So differences in total boot times are due only to the actual window manager. Total boot times are shown below left.

As can be seen, the short answer is: yes, the choice of desktop manager is definitely important as regards speed. Basically, I obtained the same type of results as have many others, with Lubuntu and Xubuntu variants of Ubuntu giving rather good results, though with a slight edge for Lubuntu. The standard Unity desktop was a nice surprise, coming in third with a small 6s lag compared to Lubuntu. Gnome 3 still seems to need a bit of tweaking for performance, while KDE - with standard effects activated - is not a fast mover, needing 22s or 73% more time than Lubuntu to get to the same point of being able to do some actual work.

Please note that these differences are further accentuated on a memory-starved computer. I would not recommend less than 1 GB of RAM for either Gnome or KDE . Boot-up times can easily double with 512 MB of RAM, and the machine is not at all responsive during use. Things are perhaps not quite as dire for Lubuntu or Xubuntu, though the difference is still noticeable.

The Processor And Motherboard

It seemed reasonable not to give much importance to our CPU and motherboard, since we cannot easily change them on a laptop: we are in general stuck with whatever we have. However, since we do have some say in the matter when buying a new computer, let's take a quick look at the effect these elements can have on our speed.

I took the same internal SATA drive from the Aspire, and used it to boot a series of computers with increasingly powerful processors. The first two were laptops, and the last a desktop unit. Boot times are shown below right.

As could be expected, a faster CPU does seem to help boot faster. However, all other variables (hard drive and RAM) being equal, boot times are not that much faster between a single-core mobile Atom processor and the - in theory - more potent desktop dual-core. Based on pure CPU computing power, we should be looking at speed increases to the tune of 110% for the Centrino and 260% for the Dual-core, which is quite visibly not the case.

This is in fact an interesting development, since it gives us the idea that our boot process is limited more by the speed of our disk drive than by that of our CPU. Using the language of high-performance computing circles, we would say that our process is “I/O bound” (as opposed to “CPU-bound”). From this we can tell that it may be more interesting for netbook or mobile users to invest in hard drives, rather than in top-spec CPUs.

As a side-note, perhaps we should remind ourselves that we have just been measuring boot-up times. Our results may or may not be extensible to normal light computing (browsing the Internet, or working with office programs). But they cannot be taken as a valid benchmark for more CPU-intensive tasks such as scientific number-crunching or gaming – areas where CPU speed does make the difference.

The Boot Medium And Partition

Since we found that the CPU and motherboard are not that important for our purposes, our third and final step was to see what effects the physical drive could have. Since GNU/Linux is a modular operating system, it is in fact rather easy to boot from various media. Basically, if your BIOS can boot it, GNU/Linux can probably use it. For a bit of variety, I used: - the original internal hard drive, a SATA 1 unit; - an external 2.0 USB pendrive; - an SD memory card.

Before continuing, perhaps we need to examine further what these are capable of. The actual speed a hard drive is capable of giving us is a combination of bus speed (i.e. its connection with the motherboard), the signaling speed the drive and motherboard agree upon, and finally whatever speed the drive itself is physically capable of. Just to complicate things, this later number can vary. For example, flash-based drives are always way faster reading data than writing it to disk. This is inherent to the NAND or NOR flash chip technology they use.

This is why the 1.5 Gb/s (about 150 MB/s) transfer speed of the SATA hard disk is merely theoretical. This is a bus speed, that most current spinning-platter laptop hard disks are incapable of using up completely (solid state disk are another matter). All the more so in our case, when the Acer's motherboard and the hard drive agreed on using the ATA-8 signal protocol, or UDMA/100. This means we are down to, at most, 100 MB/s with this disk. As to physical speed, I have tested the disk at about 83 MB/s, which is not too bad for a 5400rpm unit.

On the other hand, the SD card uses the appropriate reader hardware, which is connected to the internal USB bus in a similar way to the keyboard and touchpad. But not all SD cards are equal in speed. This was a class-10 unit, guaranteed to give at least 10 MB/s in write speed. Since it has a theoretical USB 2.0 speed limit of about 60 MB/s, we can hypothesize that its read speed is about that figure. To all intents and purposes, this format is equivalent to the more classical USB 2.0 external pendrive. In fact, my USB pendrive has a slower write rating, so I concentrated on the SD and left the pendrive out of the equation.

To my mind, the internal hard drive and the SD card represent just about the respective best and worst physical speeds available for our test computer.

At the same time, I also wanted to know if using a primary hard drive partition (/dev/sda1) or an extended partition (/dev/sda5) had any effect at all. What I got is shown right.

The basic hierarchy between desktop managers seems to be respected in all cases. However, it is clear that using a faster drive will help all desktops boot faster. The gain in speed is not quite proportional to theoretical line speed, but it is there nonetheless. That being said, it is also clear that even using the slower SD card (or equivalent USB pen-drive), lightweight desktops such as LXDE can still boot within reasonable times.

What is more interesting is the difference in performance between primary and extended partitions on the internal hard drive. We can see that using an extended partition on the internal hard drive is not a Good Idea (TM), since boot speeds of the internal drive actually drop below those of the SD card. This came as a bit of a surprise, and (I think) can be explained only by the fact that the extended partition may require two seek operations each time a read is requested by the system: one to access the primary partition it is hosted in, and the second to actually access data. This is definitely something to bear in mind when we partition our drive.

OK, so if having a fast drive and a fast connection between drive and motherboard is good, what could be better? It seemed reasonable to try using two drives, on two different connections, at the same time. If both drives hold the same information at all times – a technique variously known as mirroring or RAID level1 – then we can hope to double our read speed. This should definitely help shorten our boot times.

Additional hard drive caddies are appearing for many laptops (they replace the CD/DVD combo), and most desktops have space to fit in an extra hard drive or three. But this is not an option for netbooks, so I had to get back to the desktop Dual-core machine for this step. I used a single internal 3.5” SATA-1 hard drive for one set of tests, and two identical drives with the root partitions configured as a software RAID-1 array for the second.

This is in fact a rather funky setup where you need: - a small non-RAID boot partition (let's say /dev/sda1) to contain the /boot directory for the GRUB boot-loader to read kernel and inirtd file from; - a larger RAID-1 partition that combines a physical partition from each hard drive (for example, /dev/sda2 and /dev/sdb1), that will be mounted as the filesystem root / directory.

If you are interested in this technique, it is probably something you should play with a bit on a not-so-important computer before setting up a production machine. Anyhow, I got the results shown below right.

As expected, we can now confirm that faster hard drives make for shorter boot times. This is even more noticeable for the more heavyweight desktop managers, that seem to need more disk activity to set up. System responsiveness is also nice and crisp during use, so this looks like an interesting path to follow on computers that can contain the extra hard drive we need to do RAID.

Conclusion

After making my poor old computers jump though these loops, I am beginning to get a clearer picture about what is really important to speed up *buntu desktop boot times. To sum it up:

A. Yes, the choice of desktop manager does make a difference. There is less of a gap between the ultra-lite LXDE and XFCE desktops and Unity than I expected, which go to show that Canonical's efforts in this sense have not been in vain. Unity is in fact not a bad choice for a lowly netbook, though if we really need more speed, Lubuntu or Xubuntu are the way to go.

B. The processor and motherboard are not quite as important for normal user experience. This is not to say we should skimp on either, but rather that the difference in price between an entry-range processor and a faster chip may not be noticeable if all we do is boot the computer, navigate on the Web and do presentations. Otherwise, things may be very different … and perhaps you could do some experimentation of your own before choosing your next laptop.

C. The key factor in speeding up boot times is simply the hard drive, or rather (and not so simply) the combination of hard drive, its bus connection to the motherboard, and partitioning.

My takeaway from all this is that it may be worthwhile to take a hard look at your hard drive (no pun intended!), and try to optimize its speed. Are we booting from a primary partition? Which version of SATA does the computer support: is it a SATA-1 at 1.5 Gb/s (about 150 MB/s), or a SATA-2 at 3 Gb/s (about 300 MB/s)? Try to find an internal hard drive that can really sustain this speed.

Internal spinning-platter hard drives may have difficulties in doing this. To take an example of a typical modern high-end laptop drive, the WD Scorpio Blue 1 TB (model number WD10JPVT ) has a 3 Gb/s interface, but manages to sustain only 144 MB/s transfer rate. This is much the same for most spinning-platter drives. On the other hand, SSD drives have higher effective transfer rates, but still cost a little more. Price differences are decreasing since spinning-platter hard drives went up over the last few months, however, and it might be possible to find a small (32 to 64 GB) SSD hard drive at a competitive price – though whether it is worthwhile to upgrade a lowly $200 netbook with an $80+ hard drive is a choice that may or may not work out for you.

For laptops with an optical drive, hard drive caddies that replace the CD/DVD with space for a second hard disk are becoming more common, with prices in the $40 - $60 range. So RAID-1 on your laptop may be a choice, especially if you already have a spare hard drive lying around.

Finally, USB 3 ports with their 5 Gb/s (about 500 MB/s) line speed are also becoming more common nowadays - even on netbooks - and allow an external hard drive to boot up a computer at practically the same speed as an internal drive. So it may be worthwhile to choose your next netbook with one of these, in the interests of future expansion.

To end on a more personal note, allow me to present my personal desktop. Using the perhaps ancient - but still beautiful to my eyes - FVWM Crystal desktop manager, it makes the Acer boot up at a fast-ish 26s (compare to LXDE at 30s). However, with its distinctly “geeky” feeling, it may not appeal to all tastes.

issue63/labolinux.1348862272.txt.gz · Dernière modification : 2012/09/28 21:57 de thierry43