Results 1 to 9 of 9

Thread: How does Ubuntu utilize quad-core?

  1. #1
    Join Date
    Jul 2012
    Beans
    48

    How does Ubuntu utilize quad-core?

    I'm running Precice 64-bit on Intel Core i5 750 on a Asus P755D motherboard.

    I'm wondering how Ubuntu utilizes my CPU. Reason for this is, that whenever I'm running something which requires a bit of calculating power, it seems that core 0 (or the first core, if you prefer it) takes all the load, whereas the other 3 stays pretty much idle (2-8 %).

    Is this normal? Also, I experience a bit of thrashing - which shouldn't occur, as I have 12GiB RAM installed, and a swap partition at 4GiB.

    Again, is this normal, and if it isn't, how to fix?
    All inputs are appreciated=)

    PS: Command TOP, and 1 pressed, returns all four cores.

  2. #2
    Join Date
    Jul 2007
    Location
    Poland
    Beans
    4,499
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How does Ubuntu utilize quad-core?

    if the program you run is singlethreaded then this is exactly what you see. CPU can't magically break up program code into pieces and give the pieces to different cores to execute everything faster.
    Either the program must be multithreaded (its inner architecture enables parallelization which can utilize other cores) or you need to run 4 cpu-heavy singlethreaded programs to tax all cores.
    if your question is answered, mark the thread as [SOLVED]. Thx.
    To post code or command output, use [code] tags.
    Check your bash script here // BashFAQ // BashPitfalls

  3. #3
    Join Date
    Jan 2007
    Beans
    6,542
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: How does Ubuntu utilize quad-core?

    Quote Originally Posted by Kols View Post
    Is this normal?
    Yup. There's still plenty of software that can't take advantage of multiple cores.

    The good news is that Linux itself can handle a ludicrous amount of cores, so even if you've got an application that is chewing up a single core, all the other background tasks of the OS will be getting sent to the other cores. So the process will finish a little bit quicker than it would on a single-core machine.

  4. #4
    Join Date
    Jan 2011
    Location
    San Diego, California
    Beans
    186
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How does Ubuntu utilize quad-core?

    Looks like they covered most of it.

    There is something called "indexing" that you need to disable that will stop most of the thrashing. I think there may have been a couple more things to disable, but that was the main one. I posted a thread here, and nobody had any idea what was going on lol. Took me forever to figure it out

    Now that is my #1 thing to do immediately after installing a new distro.

    And as for the page file, certain things are stored there by default, even if there is plenty of RAM free. I could never figure out how to disable this, unfortunately... though I KNOW it can be done, because some distros have page files disabled by default. It's my HDD space, and I want it
    "I'd group the Gnome 3s, the KDE4s, the Unitys and the win8s with the same tag "Attempted to fix problems that didn't exist by breaking stuff that worked". - vexorian
    On another note, it looks like I'm back to ATI.

  5. #5
    Join Date
    Feb 2009
    Location
    USA
    Beans
    3,187

    Re: How does Ubuntu utilize quad-core?

    Whether an app will use one or more cores depends on the app itself. If the app has been written for single-core, then that's all that it will use. If an app was written to utilize more cores, then the program will spawn several threads and Linux will distribute them among the cores.

    Linux powers more than 90% of the world's most powerful computer (check top500.org). Linux is unparalleled when it comes to using your CPU in the most efficient way regardless of how many cores you may have.

  6. #6
    Join Date
    Jul 2011
    Beans
    76

    Re: How does Ubuntu utilize quad-core?

    Does the number one supercomputer really have ~1.6 million processors in it? And here I was thinking I was spoiling linux by using what Passmark calls a "high-end" processor.

  7. #7
    Join Date
    Feb 2009
    Location
    USA
    Beans
    3,187

    Re: How does Ubuntu utilize quad-core?

    Quote Originally Posted by MutantJohn View Post
    Does the number one supercomputer really have ~1.6 million processors in it?
    Yes, it does.

    And here I was thinking I was spoiling linux by using what Passmark calls a "high-end" processor.
    They are thinking about high-end desktop computer. You can go to newegg now and buy CPUs with as much as 16 cores, you can easily build a server machine with 32-48 cores and Linux will handle it just fine.

  8. #8
    Join Date
    Jul 2012
    Location
    /tropics/islands/statia
    Beans
    275
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: How does Ubuntu utilize quad-core?

    Quote Originally Posted by Nixarter View Post
    Looks like they covered most of it.

    And as for the page file, certain things are stored there by default, even if there is plenty of RAM free. I could never figure out how to disable this, unfortunately... though I KNOW it can be done, because some distros have page files disabled by default. It's my HDD space, and I want it
    Swap Space on SSDs

    One can place a swap partition on an SSD. Note that most modern desktops with an excess of 2 Gigs of memory rarely use swap at all. The notable exception is systems which make use of the hibernate feature. The following is recommended tweak for SSDs using a swap partition that will reduce the "swappiness" of the system thus avoiding writes to swap:
    # echo 1 > /proc/sys/vm/swappiness Or one can simply modify /etc/sysctl.conf as recommended in the Maximizing Performance wiki article:
    vm.swappiness=1 vm.vfs_cache_pressure=50
    Found on https://wiki.archlinux.org/index.php/Solid_State_Drives
    when looking for my new system setup.

  9. #9
    Join Date
    Dec 2006
    Beans
    7,322

    Re: How does Ubuntu utilize quad-core?

    Quote Originally Posted by Kols View Post
    I'm wondering how Ubuntu utilizes my CPU. Reason for this is, that whenever I'm running something which requires a bit of calculating power, it seems that core 0 (or the first core, if you prefer it) takes all the load, whereas the other 3 stays pretty much idle (2-8 %).
    Try some video encoding with x264, a great example of multiple core use...
    You think that's air you're breathing now?

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •