LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Blogs > caieng
User Name
Password

Notices


Rate this Entry

sharing the cpu

Posted 10-17-2011 at 08:57 AM by caieng

Today's post was supposed to be a comparison, using the internet radio station benchmark test, previously described on this forum, of two new distributions: Lubuntu and Xubuntu.

However, in running the tests during the past week, I discovered something unexpected.

Windows XP and Linux have very different methods of assigning weight to particular tasks.

At first, I had thought that XP was faster than Linux, as I have previously written here, but now, I am not so sure.

The execution times for the task described, i.e. recieving internet broadcasts of streaming audio, does suggest that despite ten years of development, compared with XP, Linux still lags, considerably. However, it turns out, that there is another factor, which I had failed to consider, previously.

It seems that at the conclusion of the testing, XP has only downloaded about 1/3 as much as Linux. Regular readers will recall, that this benchmark test is executed while the computer is concurrently downloading a very large file (Debian DVD #1 for 386).

Upon concluding the recording of the twelve durations measured successively, from onset of clicking the icon representing one of the 12 internet broadcast stations selected for this task, one notes that with XP the size of the downloaded Debian DVD is about 150 Megabytes, while, the size of the same download, under Linux, is about 500 Megabytes.

In other words, Linux assigns a greater percentage of cpu capability to the task of downloading, whereas XP grants an equal, or greater capability to the other task running concurrently: internet radio station reception.

Perhaps this distinction had already been obvious to everyone else, if so, sorry for wasting your time here, today. I was surprised to learn that XP remains so much faster than Linux, and I guess I know now, why that should be so.

Then, the question arises, is there a method available to change that ratio, so that Linux behaves more like XP, that is, can the user instruct Linux to place the download in more of a background mode, so that more cpu time is available to the more immediate task of internet radio reception?

Here are the times observed on the test machine: An Intel 1GHz cpu running on an 815 chip set motherboard (Intel) with half a gigabyte of SDRAM, FSB 133 MHz,S3 AGP graphics card, 2.3 GIPS, 1.3 GFLOPS, 0.5 GB/sec: (all OS are 32 bit, browsers tested were Opera, Chrome, SeaMonkey--times below, from SeaMonkey 2.4.1 or IceApe 2.0.11 only). Tests performed over three day period, at three different times for each distro.

OS............. 36 measurements(seconds)..download(Megabytes)

XP SPII ..................120...........................150

Lubuntu 11.10..........210...........................500

Xubuntu 11.10..........190...........................500

CrunchBang XFCE......210...........................500

I will be keen to learn, also, if any other forum members have noticed a similar, slight advantage in using Xubuntu, compared with Lubuntu, a rather counter-intuitive observation, since LXDE is supposed to be LIGHTER, than other distributions...Personally, I much prefer the desktop arrangement of LXDE, and dislike, intensely, the desktop arrangement of Xubuntu...Perhaps both are configurable, and I simply don't know how to change them, so that either one can look like the other.....
Posted in Uncategorized
Views 113512 Comments 13
« Prev     Main     Next »
Total Comments 13

Comments

  1. Old Comment
    I'm not an expert in this sort of thing by any means, but take a look at things such as:

    and (auto nice daemon)
    cpulimit

    and on /etc/sysctl.conf, these two settings specifically (albeit they'd apply to the behavior of the whole system, not task-specifically):

    vm.swappiness
    vm.vfs_cache_pressure


    But be careful with this sort of thing. I had the impression that maximizing for performance on swappiness and cache pressure had the effect of demanding much more CPU. Among other collateral effects of using less hard-disk swap of course. You can change these settings on the fly though, by echoing to the right place (you'll eventually find it via google, I don't remember right now).


    Besides that, I always have some quarrels with benchmarks in broad terms such as "linux versus windows". Not only some things may change considerably from distro to distro, but even within a single distro perhaps you could have significant effects caused by different partition formats or mounting options (like noatime on ext#). I'm not suggesting that linux would somehow manage to always be able to beat windows if we find the right settings though.
    Posted 10-21-2011 at 04:25 PM by the dsc the dsc is offline
  2. Old Comment
    And when what we're trying to measure has to do with the internet, I think it has the added complexity of the "natural" variation on internet speed. At very least, we need to run the same test many times to get some decent average numbers. I guess.

    By the way, there may be daemons similar to those I've mentioned that would restrict the band for specific internet applications. I think that something along these lines would be more right on the spot than trying to tune something related with the CPU demand for downloading.
    Posted 10-21-2011 at 04:29 PM by the dsc the dsc is offline
    Updated 10-21-2011 at 04:33 PM by the dsc
  3. Old Comment
    Thank you dsc. "run the test many times to get some decent average numbers."

    Yup, my test does that: Three days at different times of the day (morning, evening, afternoon) with 12 different measurements each trial.

    I think the results from a single session are dubious, but, when you look at the data repeated over and over and over again, things start to look convincing....

    Thanks for the suggestion on "and" and "cpulimit".

    regards,
    CAI ENG
    Posted 10-22-2011 at 04:02 PM by caieng caieng is offline
  4. Old Comment
    You're welcome. That's interesting, that difference in downloading speeds. I had heard about it once, something along the lines that windows has better performance when navigating on the web (and graphics in general), but linux was faster downloading. I was a bit surprised and somewhat skeptical, I though that downloads would be too much of a "low level" thing to have a difference, that it would depend much more (well, it probably still does) on the speed of the connection itself, rather than having anything to do with processing. Perhaps NTFS is to blame a bit? I know that FAT is faster, but I have no idea really, if that influences.

    And there are indeed daemons (or maybe not daemons) to manage bandwidth for different applications, "trickle" and "wondershaper".

    http://www.ubuntugeek.com/use-bandwi...ion-speed.html
    Posted 10-23-2011 at 06:39 PM by the dsc the dsc is offline
  5. Old Comment
    Thank you once more, dsc, however, this is not correct. It is not a desire to "limit the download speed", that I seek, as offered with that link to a Ubuntu web site (thanks for that!!)

    I seek to learn why the default, unadjusted, out of the box version of any Linux flavor, places much more cpu emphasis on the task of downloading, concurrently minimizing cpu activities for other tasks, including tasks related to use of the SAME internet reception capability, compared with Win XP SPII.

    Over the past three days, I have repeated my measurements with this computer, using CrunchBang, compared with a fresh installation of XP, and the results are just dramatic:

    Either CrunchBang or XP demands exactly the same amount of time, using the same browser for both, when NO OTHER TASK is running.

    The difference, quite amazing, really, is that when a task is imposed, and here, the task chosen demands use of another instance of the same browser (I used Chromium this weekend) to download from the Debian web site, the 4 GB DVD representing disk one of the 32 bit OS.

    With Windows XP, after the time needed to measure reception of all 12 radio stations, i.e. first of three trials over three days, the OS had downloaded only 100-200 Megabytes of the 4.3 GB disk. Crunchbang had downloaded 500-600 Megabytes, during the same process.

    XP with, or without the task of retrieving this large file, required, per 12 measurements, about 40 seconds of time. (total for three trials over three different days, is ~120 +/- 5 seconds.)

    CrunchBang, also required, for the same 36 measurements, performed immediately after or right before, the XP measurements, about 120 seconds, again, +/- five seconds...

    But, when adding the second task, i.e. download of the large file, Crunchbang required 400-500 seconds for the 36 measurements. In exchange for this greatly delayed reception of the radio signals, one procured much more of the downloaded disk, compared with XP.

    It is really bizarre, to my way of thinking, that the default setting for Linux, but not XP, would apportion so much of the cpu activity to the task of receiving the downloaded disk, (a sideline activity), mutilating the primary task, by requiring the user to wait, and wait, and wait, on changing the channel, to recieve the radio station of interest.

    To some degree, one observes a similar obtuseness about Linux, with regard to booting up, and shutting down.

    XP requires 9 seconds to terminate, upon signalling a desire to shut down. Linux requires anywhere from 10-30 seconds on this computer, depending on the version of Linux used.

    Booting up, is even more telling.
    XP needs 50 seconds.
    Linux anywhere from 60-90 seconds.

    I am sure there must be some method to speed things up, and also some easy method to instruct Linux to apportion cpu time more even handedly, but it is strange, I think, that the default setting of Linux is exactly the opposite of what I would have expected.... My thinking must be at variance with the norm, at least, among Linux users....

    CAI ENG
    Posted 10-24-2011 at 09:03 AM by caieng caieng is offline
  6. Old Comment
    Are your installations of XP and Linux on the same disk partition? (silly question, I know heh). There is a dramatic speed difference between "zones" on any given hard drive. SSD's not so much, but conventional drive, yes. The "tail" of a hard drive is typically much slower than the "head" of the drive. If you put WinXP first (on an earlier partition), it would have access to much faster portions of the hard drive and would be able to put *less* cpu time towards activities that take disk time, whereas Linux wouldn't have that edge.
    Posted 10-24-2011 at 10:08 AM by rocket357 rocket357 is offline
  7. Old Comment
    Hi Rocket357!

    Thanks for your question.

    No. No, they were not on the same partition.

    However, this study used four different hard drives, two SATA, and two IDE.

    All four partitions, on all four drives, were always PRIMARY, not extended, therefore, I doubt that the time measurements observed fluctuated as a consequence of the location of the operating system on a particular partition. I always used the same alignment for the partitions:

    1: XP (sometimes NTFS, sometimes FAT 32, made no difference in the times recorded) generally about 30 GB in size.
    2. FAT 32 (storage)
    3. SWAP small, double the size of the RAM, i.e. 1 GB.
    4. Linux Ext 4, depending on the drive, anywhere from 5-100 GB.

    Moreover, the huge differences that are observed here, have nothing to do with the hard drive, as can be seen by the repeated testing, and retesting, showing, over and over again, that WITHOUT concurrent downloading of the large 4 GB file from Debian, the times recorded to receive the 12 radio stations are IDENTICAL, whether one uses Linux or XP, and whether one uses IDE or SATA. It is not the geometry of the hard drive that explains these very distinctive time differences.

    The genuinely amazing observation here, is that there is a HUGE difference, easily measured, by anyone, without requirement for any special gear, or experience, or testing talent, or expertise, or equipment: possession of just an ordinary clock, and a desktop computer, and one can then observe an absolutely reproducible distinction between Linux, any flavor, any kernel, any distro, and XP. The distinction is reproducible, and easily observed, at least on a sufficiently slow computer, i.e. ~1GHz, 32 bit, with half a gigabyte of RAM.

    The distinction is remarkable, noteworthy, and enigmatic. I had no idea, a year ago, when I started this investigation, that there would emerge such a huge difference between the two operating systems. To me, the distinction is just simply counter-intuitive. Why should there exist such a huge disparity between XP, and Linux? Someone, somewhere, must have decided that downloading a single file was of such critical importance, under Linux, that this task should monopolize the cpu, compared with execution of other tasks, by a factor of nearly five to one.

    I wonder why XP has no difficulty handling, albeit more slowly, this secondary task, downloading a very large file, while concurrently receiving, WITH EQUAL alacrity (as if not downloading the same file), the reception of the radio station's signals? Someone, somewhere, determined that the task of downloading a large file, under XP, ought not monopolize the cpu time.... I wonder why? All I can write, today, is that, given the choice, any user, if ignorant of which OS he/she were using, would choose XP, upon hearing the radio stations so much faster under that OS, compared with Linux, while concurrently downloading the large file from Debian.

    CAI ENG
    Posted 10-24-2011 at 11:50 AM by caieng caieng is offline
  8. Old Comment
    If you always used that alignment, you've always put Linux at a hard drive speed disadvantage. I'm not saying that's the cause of your observation, I'm just saying that it's true that Linux will see slower hard drive times, especially for write-heavy workloads.

    It's an interesting observation, however. Do you have any kind of QoS turned on for Windows? (not sure if XP has QoS turned on by default in SP2). I have a stock WinXP machine at home that I can check tonight, and my daughter's Xubuntu machine might be available to do a few simple tests.
    Posted 10-24-2011 at 12:32 PM by rocket357 rocket357 is offline
  9. Old Comment
    Thanks, rocket 357.
    No, no QoS, whatever that may be. It is a plain vanilla installation, fresh, performed last week, with no extra software, for example, no antivirus precautions, and so on...

    It could well be that Linux, as you write, is at a significant speed disadvantage, compared with XP, because of the sector location of the OS.

    That, observation, if true, nevertheless has no bearing, in my opinion, on the significant finding presented here:

    namely, that without an additional task, (downloading the 32 bit DVD from Debian's web site), Linux and XP require THE SAME AMOUNT of time, to receive the twelve stations (where "same" is defined as +/- 5 seconds out of 120 seconds.)

    Of course, with a more modern cpu, and more memory, and so on, this distinction would blurr.

    But, with older hardware, it is an amazing discrepancy, once the user begins downloading the DVD from Debian.

    XP shoulders this extra burden without blinking an eye: the time needed to tune in the 12 stations remains the same, with or without, the burden of concurrently downloading the DVD.

    Linux, on the other hand, slows to a crawl, in order to bring home that DVD as quickly as possible, with a very discernible difference in the time needed to tune in the 12 radio stations. Whereas each station typically required 2-3, or perhaps 4 seconds to commence, upon clicking the icon, prior to invoking the download task, once the DVD download begins, that time changes dramatically to 8-10-12 seconds/station, under Linux, but remains the same, for XP.

    Concluding the 12 station time measurement, the amount of material received under XP, is only about 20% of that received by Linux.

    Quite remarkable, especially, when one considers that for almost twelve months, I wrongly concluded that xp was faster than Linux, when, in fact, xp is not faster; Linux simply has a more zealous attitude, than XP, towards finishing the secondary, downloading chore, as quickly as possible, thus monopolizing the cpu!!!! That the user should be inconvenienced, obliged to wait an additional ten seconds, to receive his/her radio station,(the primary task) is not Linux' problem!!!! haha...

    CAI ENG
    Posted 10-24-2011 at 01:51 PM by caieng caieng is offline
  10. Old Comment
    QoS is "Quality of Service", and there is a QoS Packet Scheduler built-in to Windows XP. It's turned off on my laptop at work, but that might have been my doing since it's daisy-chained behind my OpenBSD workstation (which serves as a firewall for the XP laptop).

    Control Panel -> Network Connections -> Right-Click your connection -> Properties -> Look for QoS Packet Scheduler in the list and see if it's checked on.
    Posted 10-24-2011 at 03:59 PM by rocket357 rocket357 is offline
  11. Old Comment
    I tested the QoS issue on my laptop at work.

    It's a 1.5 GHz Pentium M with 1 GB RAM. QoS on or off, didn't matter, as VLC started playing within 3-4 seconds for those radio stations. Interesting.

    During the test, I watched iftop on my OpenBSD workstation. The XP tests looked to give ~6x more bandwidth to the download than the radio station, so I doubt QoS on/off will show much difference on Linux (unless QoS off shows the bandwidth well outside that ratio? I dunno...I'll have to test).

    I'm really interested to see what's going on here. This machine is a bit more powerful than yours, so it may mask some bottlenecks, but I'm going to check anyways.
    Posted 10-26-2011 at 09:50 AM by rocket357 rocket357 is offline
  12. Old Comment
    Thanks for your comment, and your inquiry, both very welcome.

    CAI ENG
    Posted 10-26-2011 at 10:13 AM by caieng caieng is offline
  13. Old Comment
    I wasn't able to replicate the issue on this laptop. It went from ~3-4 seconds to perhaps 5 seconds at worst case.

    If you do figure out what's going on, let me know. =)
    Posted 10-26-2011 at 11:30 AM by rocket357 rocket357 is offline
 

  



All times are GMT -5. The time now is 10:55 AM.

Main Menu
Advertisement
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