Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #256992

Re: how to limit a CPU temperature?

From David Christensen <dpchrist@holgerdanske.com>
Newsgroups linux.debian.user
Subject Re: how to limit a CPU temperature?
Date 2023-04-10 04:20 +0200
Message-ID <GiPip-Z9V-1@gated-at.bofh.it> (permalink)
References <GihA5-E2o-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 4/8/23 07:17, songbird wrote:
>    i have a program that has changed it's behavior to suddenly
> become a CPU hog (while doing something simple like uploading
> files for my website).  probably a bug, but it got me to
> wondering how i could limit the CPU temperature to a range
> well below the maximum that kicks in by the CPU itself.
> 
>    i have an intel processor and it has the MAX which does
> prevent it from going higher (100C), but i'd like to keep it
> at 70C or lower.
> 
>    i've been trying to find anything that will let me set this
> but no luck yet in my searches.
> 
>    thanks!  :)
> 
> 
>    songbird


I previous posted some Perl one-liners to load one processor core for 
thermal testing:

https://lists.debian.org/debian-user/2021/08/msg01346.html


Here is an updated Perl script that will exercise all cores to a given 
percentage for a given duration:

2023-04-09 19:06:43 dpchrist@taz ~
$ cat /usr/local/bin/exercise-cpu
#!/usr/bin/env perl
# $Id: exercise-cpu,v 1.1 2023/04/10 02:05:22 dpchrist Exp $
# by David Paul Christensen dpchrist@holgerdanske.com
# Public Domain
#
# Exercise central processing unit

use threads;
use strict;
use warnings;

use File::Basename;
use Time::HiRes qw( sleep time );

die sprintf "Usage: %s PERCENT DURATION\n", basename($0)
     unless @ARGV == 2;

my  $a	= 0.01 * shift;		# periodic exercise duration
my  $b	= 1 - $a;		# periodic sleep duration

$_	= qx/lscpu/;		# Debian GNU/Linux
my ($c)	= /CPU.s.:\s+(\d+)/;	# number of virtual cores

my  $e	= time + shift;		# time to end

my @thr;			# threads

push @thr, async {
     while (time < $e) {
	my $d = time + $a / 10;
	1 while time < $d;
	sleep $b/10;
     }
} for 1..$c;

$_->join for @thr;

2023-04-09 19:06:49 dpchrist@taz ~
$ exercise-cpu 50 10


David

Back to linux.debian.user | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

how to limit a CPU temperature? songbird <songbird@anthive.com> - 2023-04-08 16:20 +0200
  Re: how to limit a CPU temperature? songbird <songbird@anthive.com> - 2023-04-08 16:30 +0200
    Re: how to limit a CPU temperature? "tv.debian" <tv.debian@googlemail.com> - 2023-04-08 16:50 +0200
      Re: how to limit a CPU temperature? songbird <songbird@anthive.com> - 2023-04-08 18:00 +0200
        Re: how to limit a CPU temperature? "Andrew M.A. Cater" <amacater@einval.com> - 2023-04-08 18:20 +0200
          Re: how to limit a CPU temperature? songbird <songbird@anthive.com> - 2023-04-08 20:40 +0200
    Re: how to limit a CPU temperature? "Jeremy Nicoll" <jn.ml.dbi.73@letterboxes.org> - 2023-04-08 17:00 +0200
      Re: how to limit a CPU temperature? davidson <davidson@freevolt.org> - 2023-04-08 17:20 +0200
        Re: how to limit a CPU temperature? songbird <songbird@anthive.com> - 2023-04-08 17:50 +0200
      Re: how to limit a CPU temperature? songbird <songbird@anthive.com> - 2023-04-08 18:10 +0200
        Re: how to limit a CPU temperature? Vincent Lefevre <vincent@vinc17.net> - 2023-04-13 16:30 +0200
    Re: how to limit a CPU temperature? songbird <songbird@anthive.com> - 2023-04-11 02:20 +0200
      Re: how to limit a CPU temperature? Max Nikulin <manikulin@gmail.com> - 2023-04-11 03:30 +0200
  Re: how to limit a CPU temperature? tom@myposts.ovh - 2023-04-08 16:30 +0200
    Re: how to limit a CPU temperature? songbird <songbird@anthive.com> - 2023-04-08 18:10 +0200
  Re: how to limit a CPU temperature? Emanuel Berg <incal@dataswamp.org> - 2023-04-08 17:20 +0200
    Re: how to limit a CPU temperature? songbird <songbird@anthive.com> - 2023-04-08 18:00 +0200
      Re: how to limit a CPU temperature? "Jeremy Nicoll" <jn.ml.dbi.73@letterboxes.org> - 2023-04-08 18:10 +0200
      [OFFTOPIC] Re: how to limit a CPU temperature? Stefan Monnier <monnier@iro.umontreal.ca> - 2023-04-08 19:00 +0200
        Re: [OFFTOPIC] Re: how to limit a CPU temperature? Emanuel Berg <incal@dataswamp.org> - 2023-04-08 19:20 +0200
          the front (was: " Re: [OFFTOPIC] Re: how to limit a CPU temperature?") Emanuel Berg <incal@dataswamp.org> - 2023-04-08 19:30 +0200
            Re: the front (was: " Re: [OFFTOPIC] Re: how to limit a CPU temperature?") Jeffrey Walton <noloader@gmail.com> - 2023-04-08 20:00 +0200
              Re: the front (was: " Re: [OFFTOPIC] Re: how to limit a CPU temperature?") Emanuel Berg <incal@dataswamp.org> - 2023-04-08 20:10 +0200
        Re: [OFFTOPIC] Re: how to limit a CPU temperature? Jeremy Ardley <jeremy@ardley.org> - 2023-04-09 01:00 +0200
  Re: how to limit a CPU temperature? Tixy <tixy@yxit.co.uk> - 2023-04-08 22:10 +0200
  Re: how to limit a CPU temperature? Ash Joubert <ash@transient.nz> - 2023-04-09 02:30 +0200
  Re: how to limit a CPU temperature? David Christensen <dpchrist@holgerdanske.com> - 2023-04-09 03:10 +0200
    Re: how to limit a CPU temperature? Mark Allums <maa@allums.com> - 2023-04-09 05:20 +0200
      Re: how to limit a CPU temperature? David Christensen <dpchrist@holgerdanske.com> - 2023-04-10 01:50 +0200
  Re: how to limit a CPU temperature? Darac Marjal <mailinglist@darac.org.uk> - 2023-04-09 14:30 +0200
    Re: how to limit a CPU temperature? Emanuel Berg <incal@dataswamp.org> - 2023-04-09 14:40 +0200
  Re: how to limit a CPU temperature? David Christensen <dpchrist@holgerdanske.com> - 2023-04-10 04:20 +0200

csiph-web