Giter VIP home page Giter VIP logo

Comments (18)

tripplet avatar tripplet commented on July 28, 2024

On a quad core system "limit 100" would limit the process to using one quarter of the available cpu power, (i.e one core)
But if the process is not build to use multiple cores it limits it's self for 100/400, so limit 100 has no effect.
All by design if I'm correct.

from cpulimit.

opsengine avatar opsengine commented on July 28, 2024

@tripplet That's right. A limit of 100 on single threaded program running on a quad core has no effect.

from cpulimit.

PhilD41 avatar PhilD41 commented on July 28, 2024

Thought I had found a solution to my processing headache. This issue makes cpulimit useless for me. I have a 8 core box and with 99 being the highest limit I can set, other than wide open, it effectively disables my application. Need a fix to correctly use ranges from 0 - 100 * #cores.

from cpulimit.

tripplet avatar tripplet commented on July 28, 2024

Why is 99 the highest limit you can set? Cpulimit allows me to set a maximum of 400 on my quadcore system.
"cpulimit -h" should show you your limit in the help text.

from cpulimit.

PhilD41 avatar PhilD41 commented on July 28, 2024

If I set it to 100% or anything above, it allows the process to max out all 8 cores. ~800% So, I have to either limit it to under 100% (of one core) or no limit at all. For the record, I have a AMD FX8120.

from cpulimit.

tripplet avatar tripplet commented on July 28, 2024

I'm not sure what program your are trying to limit, but for me it works fine, in combination with handbreak, for example with the limit set to 200.
There are a few things you should check, is there only one process or is the process spawning new subprocesses.
Are the cores really maxed out? Check with a processviewer like htop. And verify the system load is really 8 (=800%) (shellcommand: cat /proc/loadavg)
If that's not the case/working maybe you can assign the process to specific cores:
http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html

from cpulimit.

PhilD41 avatar PhilD41 commented on July 28, 2024

It is handbrake that I am using on Ubuntu 12.10. I was monitoring the process load for ghb and can see it drop / max with the command issue. I am not seeing a secondary process. I provided my CPU type thinking it may be an issue with the FX processors. I have also tried setting the affinity with taskset and it reports the change in affinity, but I see no change in the core usage. So this may be bitter than just cpulimit. I just find it odd that anything below 100% does work. Oh, and I have version 1.7 of cpulimit. I will keep messing with it. If you have other suggestions let me know. I would be willing to experiment.

Okay the taskset works as long as I restart the encoding task. It won't change it real-time, or if I pause it. If I stop it and restart then the affinity works correctly. Using cpulimit to 400 still allows ~800% (full) loading on the processor.

from cpulimit.

tripplet avatar tripplet commented on July 28, 2024

Very interesting behaviour, unfortunately I'm not sure why this is happening.

EDIT:
Have you tried to use nice levels to fix your problem, I personally use cpulimit just so the fans don't get to loud 😉

from cpulimit.

sevastos avatar sevastos commented on July 28, 2024

I have the same issue. Limiting the main process to 100 doesn't affect the total.

Htop shows the extra processes and I tried to cpulimit the subprocesses by targeting their PID but cpulimit can't find them.

I adjusted the nice levels but it doesn't help in my case since there are available cores with no load. My process only uses 3/8 cores at the same time.

from cpulimit.

 avatar commented on July 28, 2024

Confirmed, the same issue here: virtualized environment, 8 cores go 100% busy if limit is set to anything above 100.

from cpulimit.

opsengine avatar opsengine commented on July 28, 2024

@ThinkingPotato What environment? Are you using an EC2 instance? I guess it's just matter of fixing this function https://github.com/opsengine/cpulimit/blob/master/src/cpulimit.c#L142 to adapt to your environment.

from cpulimit.

 avatar commented on July 28, 2024

@opsengine We are using Xen-based VMs from Linode.

from cpulimit.

opsengine avatar opsengine commented on July 28, 2024

@ThinkingPotato Check the result of the function above. The correct result should be 8.

from cpulimit.

 avatar commented on July 28, 2024

@opsengine I guess there is no need to check the result of that function, it's 1 as

0 to %d (required)\n", 100*NCPU);

results in "0 to 100".

from cpulimit.

opsengine avatar opsengine commented on July 28, 2024

What's the output of the following commands?

$ getconf -a | grep NPROCESSORS
$ cat /proc/cpuinfo

from cpulimit.

 avatar commented on July 28, 2024

getconf:

_NPROCESSORS_CONF 8 _NPROCESSORS_ONLN 8

cpuinfo:

processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 45 model name : Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz stepping : 7 microcode : 0x70d cpu MHz : 2600.076 cache size : 20480 KB physical id : 0 siblings : 8 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 13 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl nonstop_tsc pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes hypervisor lahf_lm ida arat epb pln pts dtherm bogomips : 5200.15 clflush size : 64 cache_alignment : 64 address sizes : 46 bits physical, 48 bits virtual power management: processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 45 model name : Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz stepping : 7 microcode : 0x70d cpu MHz : 2600.076 cache size : 20480 KB physical id : 0 siblings : 8 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 13 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl nonstop_tsc pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes hypervisor lahf_lm ida arat epb pln pts dtherm bogomips : 5200.15 clflush size : 64 cache_alignment : 64 address sizes : 46 bits physical, 48 bits virtual power management: processor : 2 vendor_id : GenuineIntel cpu family : 6 model : 45 model name : Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz stepping : 7 microcode : 0x70d cpu MHz : 2600.076 cache size : 20480 KB physical id : 0 siblings : 8 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 13 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl nonstop_tsc pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes hypervisor lahf_lm ida arat epb pln pts dtherm bogomips : 5200.15 clflush size : 64 cache_alignment : 64 address sizes : 46 bits physical, 48 bits virtual power management: processor : 3 vendor_id : GenuineIntel cpu family : 6 model : 45 model name : Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz stepping : 7 microcode : 0x70d cpu MHz : 2600.076 cache size : 20480 KB physical id : 0 siblings : 8 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 13 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl nonstop_tsc pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes hypervisor lahf_lm ida arat epb pln pts dtherm bogomips : 5200.15 clflush size : 64 cache_alignment : 64 address sizes : 46 bits physical, 48 bits virtual power management: processor : 4 vendor_id : GenuineIntel cpu family : 6 model : 45 model name : Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz stepping : 7 microcode : 0x70d cpu MHz : 2600.076 cache size : 20480 KB physical id : 0 siblings : 8 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 13 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl nonstop_tsc pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes hypervisor lahf_lm ida arat epb pln pts dtherm bogomips : 5200.15 clflush size : 64 cache_alignment : 64 address sizes : 46 bits physical, 48 bits virtual power management: processor : 5 vendor_id : GenuineIntel cpu family : 6 model : 45 model name : Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz stepping : 7 microcode : 0x70d cpu MHz : 2600.076 cache size : 20480 KB physical id : 0 siblings : 8 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 13 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl nonstop_tsc pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes hypervisor lahf_lm ida arat epb pln pts dtherm bogomips : 5200.15 clflush size : 64 cache_alignment : 64 address sizes : 46 bits physical, 48 bits virtual power management: processor : 6 vendor_id : GenuineIntel cpu family : 6 model : 45 model name : Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz stepping : 7 microcode : 0x70d cpu MHz : 2600.076 cache size : 20480 KB physical id : 0 siblings : 8 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 13 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl nonstop_tsc pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes hypervisor lahf_lm ida arat epb pln pts dtherm bogomips : 5200.15 clflush size : 64 cache_alignment : 64 address sizes : 46 bits physical, 48 bits virtual power management: processor : 7 vendor_id : GenuineIntel cpu family : 6 model : 45 model name : Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz stepping : 7 microcode : 0x70d cpu MHz : 2600.076 cache size : 20480 KB physical id : 0 siblings : 8 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 13 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl nonstop_tsc pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes hypervisor lahf_lm ida arat epb pln pts dtherm bogomips : 5200.15 clflush size : 64 cache_alignment : 64 address sizes : 46 bits physical, 48 bits virtual power management:

from cpulimit.

opsengine avatar opsengine commented on July 28, 2024

Is the problem now solved for everyone?

from cpulimit.

hrobeers avatar hrobeers commented on July 28, 2024

Great, this works for me!
(I had the same issue with 1.7)

from cpulimit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.