CPU Utilization of a multithreaded process

2,263

99% cpu usage means almost total utilization of single core.

if your system is totally loaded [ couple threads each hogging one cpu ] - you'll see 400% usage on quad core or 800% usage on two quad cores.

processes/threads are re-assigned between cpus - that's why you see 25% of utilisation on each of cores. but you can set affinity for them.. then they'll stick to selected processors/cores.

Share:
2,263

Related videos on Youtube

Richard
Author by

Richard

Updated on September 17, 2022

Comments

  • Richard
    Richard over 1 year

    I currently have a distributed cache using EHCache via RMI that works just fine. I was wondering if you can include persistence with the caches to create a distributed, persistent cache.

    Alongside this, if the cache was persistent, would it load from the file store, then bootstrap from the cache cluster? Basically, what I want is:

    • Cache starts
    • Cache loads persistent objects from the file store
    • Cache joins the distruted cluster and bootstraps as normal

    The usecase behind this is having 2 identical components running on independent machines, distributing the cache to avoid losing data in the event that one of the components fails. The persistence would guard against losing all data on the rare occasion that both components fail.

    Would moving to another distribution method (such as Terracotta) support this?

    • pQd
      pQd almost 15 years
      @Justin Bennett - if your program is multithreaded and all threads do some heavy processor linux scheduler will do the job and nicely load all cpus. you dont need to do anything. but that is rarely the case - quite often there are locks or program waits for input from network or iosubsystem.
  • Justin Bennett
    Justin Bennett almost 15 years
    How can I tell a process/thread to utilize more than one CPU? I want my multithreaded process to use at least 4 of the CPUs fully (so, 400% I guess). Is there a way I can give the process the ability to do this? Right now, it seems that the process is capped at 99.99%, even though it could certainly go beyond that if allowed to.
  • sehugg
    sehugg almost 14 years
    Also to support the use-case you have described, you would need a third component, the user store (or a Terracotta cluster). EHCache does not support key-value backups AFAIK, while something like Hazelcast or Cassandra does rely on peers to redundantly store keys.