Deprecated: Creation of dynamic property Timber\Site::$pingback is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Site.php on line 180

Deprecated: Creation of dynamic property Timber\User::$name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/User.php on line 118

Deprecated: Creation of dynamic property Timber\Post::$os_meta is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$has_disclaimer is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_lock is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_last is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_category is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_blz_affiliation_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_content_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_speciali is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskw is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_metadesc is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_linkdex is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_content_score is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskeywords is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_keywordsynonyms is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_estimated-reading-time-minutes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_thumbnail_id is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$os_previous_publish_date is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$os_notification_id is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_indexnow_last_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_date_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$ping_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_password is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$to_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$pinged is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_content_filtered is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$guid is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$menu_order is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_mime_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_count is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$filter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71
Thermal throttling su Apple Silicon: come monitorare le prestazioni in tempo reale

Thermal throttling su Apple Silicon: come monitorare le prestazioni in tempo reale

MacThrottle è un’app per Mac che permette di osservare il thermal throttling dei chip Apple Silicon (M1–M4) in tempo reale senza privilegi di root. Utilizza notifiche Darwin e sensori SMC/IOKit per mostrare pressione termica, temperature e utilizzo delle risorse, fornendo grafici dettagliati e avvisi.

Negli ultimi anni, i Mac basati su SoC Apple Silicon hanno ridefinito il concetto di efficienza e prestazioni. Tuttavia, anche i chip M1, M2, M3 e M4 possono essere soggetti a thermal throttling, ossia a una riduzione automatica delle prestazioni per evitare il surriscaldamento. Uno sviluppatore indipendente ha affrontato il problema e sviluppato MacThrottle, un’app per monitorare in tempo reale lo stato termico dei Mac senza privilegi di root.

Il problema del thermal throttling sui Mac

Un dispositivo come il MacBook Air M2 ha prestazioni eccellenti, ma sotto carichi pesanti e con un monitor 4K a 120 Hz, non è infrequente notare rallentamenti improvvisi. L’assenza di ventole lo rende silenzioso, quindi l’attivazione del thermal throttling si percepisce solo osservando:

  • CPU al 100% di utilizzo.
  • Consumo energetico in calo (misurato in Watt)
  • Frequenza dei core performance che scende, nonostante l’utilizzo massimo.

Sono segnali spia dell’abilitazione del thermal throttling, meccanismo che protegge il chip dal surriscaldamento.

Grafico Mac thermal throttling

Metodi per rilevare lo stato termico

Apple fornisce diverse API per conoscere lo stato termico dei suoi dispositivi Mac:

  • ProcessInfo.thermalState: parte della Foundation API, restituisce uno stato tra nominal, fair, serious, critical. Tuttavia, la granularità è limitata: molti livelli di throttling risultano raggruppati nello stato fair, rendendo difficile capire quando la CPU stia realmente riducendo le prestazioni.
  • powermetrics: strumento da terminale, più preciso, ma richiede root. Restituisce livelli di pressione termica più dettagliati: nominal, moderate, heavy, trapping, sleeping. Sotto stress, ad esempio con stress-ng --cpu 0 -t 600, si vede chiaramente la progressione dei livelli termici.
  • notifyd e OSThermalNotification: lo sviluppatore di MacThrottle la definisce una scoperta cruciale. macOS pubblica le informazioni termiche tramite il sistema di notifiche Darwin, accessibile senza privilegi di root attraverso l’evento com.apple.system.thermalpressurelevel. I livelli corrispondono a quelli di powermetrics, consentendo un monitoraggio preciso senza script complessi o accesso amministrativo.

Cos’è e come funziona l’app MacThrottle

Il progetto MacThrottle nasce dalla necessità di capire cosa succede quando un Mac basato su chip Apple Silicon inizia a rallentare sotto carichi elevati. L’idea è semplice: fornire informazioni precise e in tempo reale sulla “pressione termica”, direttamente nella barra dei menu.

L’app è sviluppata come menu bar app in SwiftUI, garantendo un’interfaccia discreta ma sempre accessibile. Per ottenere i dati termici, inizialmente lo sviluppatore si era affidato a un helper con privilegi di root che eseguiva powermetrics in background e scriveva i risultati nella directory /tmp. Presto, però, ha scoperto che il sistema di notifiche Darwin fornisce lo stesso dato in modo diretto, preciso e senza bisogno di permessi elevati, semplificando notevolmente l’architettura.

MacThrottle include un grafico compatto che racconta la storia termica degli ultimi 10 minuti. I livelli termici sono codificati a colori: verde, giallo, arancione e rosso. Sul grafico si sovrappongono la temperatura di CPU e GPU e la percentuale di utilizzo delle ventole (quando presenti), con tooltip interattivi che permettono di esplorare i valori passati. Per garantire fluidità anche su display ad alta frequenza come 120 Hz, il rendering è opportunamente ottimizzato.

Il monitoraggio della temperatura combina due metodi complementari: l’accesso diretto ai sensori tramite SMC (System Management Controller), necessario per valori superiori ai 100°C, e un fallback tramite IOKit quando SMC non è disponibile. Ogni generazione di chip (M1, M2, M3, M4) ha chiavi differenti per CPU e GPU, che vengono gestite dinamicamente dal codice per garantire massima attendibilità su tutti i dispositivi.

MacThrottle supporta anche le notifiche macOS, avvisando l’utente in caso di stati critici o quando la temperatura torna “nei ranghi”.

In sintesi, MacThrottle dimostra che è possibile monitorare il thermal throttling di Apple Silicon in tempo reale senza compromessi sulla sicurezza e senza richiedere root. L’esperienza evidenzia due aspetti chiave: le API Apple ufficiali spesso semplificano i dati, ma un approccio creativo può restituire informazioni dettagliate; e anche i chip moderni, silenziosi e potenti, possono ridurre le prestazioni per protezione termica, rendendo strumenti di monitoraggio come MacThrottle indispensabili per chi vuole prestazioni ottimali e consapevolezza completa sul comportamento dell’hardware in uso.

Ti consigliamo anche

Link copiato negli appunti