Change thermal defaults
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-win (push) Waiting to run
CodeQL / Analyze (push) Waiting to run

This commit is contained in:
Andrea Mazzoleni 2025-10-17 09:12:21 +02:00
parent e00342557e
commit 6c1421f5a0
7 changed files with 16 additions and 21 deletions

View file

@ -10,7 +10,7 @@ SnapRAID HISTORY
overheating.
- temp_sleep TIME_IN_MINUTES
Defines how long the disks remain in standby after a temperature limit
event. After this time, operations are resumed. Defaults to 15 minutes.
event. After this time, operations are resumed. Defaults to 5 minutes.
* Add a new "probe" command that shows the spinning status of all disks.
* Add a new -s, --spin-down-on-error option that spins down all disks
when a command ends with an error.

View file

@ -1193,9 +1193,9 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
exit(EXIT_FAILURE);
/* LCOV_EXCL_STOP */
}
if (time < 5 || time > 120) {
if (time < 3 || time > 120) {
/* LCOV_EXCL_START */
log_fatal("Invalid 'temp_sleep' temperature specification in '%s' at line %u. It must be between 5 and 120\n", path, line);
log_fatal("Invalid 'temp_sleep' temperature specification in '%s' at line %u. It must be between 3 and 120\n", path, line);
exit(EXIT_FAILURE);
/* LCOV_EXCL_STOP */
}

View file

@ -51,8 +51,8 @@ struct snapraid_thermal_params fit_thermal_model(const struct snapraid_thermal_p
model.t_ambient = t_ambient;
/* at least three points to have a result */
if (n_points < 3)
/* at least four points to have a result */
if (n_points < 4)
return model;
double last_temp = points[n_points - 1].temperature;
@ -220,7 +220,6 @@ void state_thermal(struct snapraid_state* state, time_t now)
struct snapraid_thermal* found;
devinfo_t* devinfo = i->data;
unsigned k;
unsigned count;
int temperature = smart_temp(devinfo);
if (temperature < 0)
@ -255,27 +254,23 @@ void state_thermal(struct snapraid_state* state, time_t now)
if (found->count + 1 >= THERMAL_MAX) /* keep one extra space at the end */
continue;
/* only monotone temperature */
if (found->count > 0 && found->data[found->count - 1].temperature > temperature)
/* only monotone increasing temperature */
if (found->count > 0 && found->data[found->count - 1].temperature >= temperature)
continue;
/* insert the new data point */
found->data[found->count].temperature = temperature;
found->data[found->count].time = now - state->thermal_first;
/* if it's a new temperature, store it, otherwise have it ovewritten the next time */
count = found->count + 1;
if (found->count == 0 || found->data[found->count - 1].temperature < temperature)
found->count = count;
++found->count;
/* log the new data */
log_tag("thermal:heat:%s:%" PRIu64 ":%u:", devinfo->name, devinfo->device, count);
for (k = 0; k < count; ++k)
log_tag("thermal:heat:%s:%" PRIu64 ":%u:", devinfo->name, devinfo->device, found->count);
for (k = 0; k < found->count; ++k)
log_tag("%s%d/%d", k > 0 ? "," : "", (int)found->data[k].temperature, (int)found->data[k].time);
log_tag("\n");
/* estimate parameters */
found->params = fit_thermal_model(found->data, count, state->thermal_ambient_temperature);
found->params = fit_thermal_model(found->data, found->count, state->thermal_ambient_temperature);
log_tag("thermal:params:%s:%" PRIu64 ":%g:%g:%g:%g:%g:%g\n", devinfo->name, devinfo->device,
found->params.k_heat, found->params.t_ambient, found->params.t_steady,
@ -309,7 +304,7 @@ void state_thermal_cooldown(struct snapraid_state* state)
unsigned sleep_time = state->thermal_cooldown_time;
if (sleep_time == 0)
sleep_time = 15 * 60; /* default sleep time */
sleep_time = 5 * 60; /* default sleep time */
if (sleep_time < 5 * 60)
sleep_time = 5 * 60; /* minimum sleep time */

View file

@ -26,7 +26,7 @@
/**
* Period of temperature measures
*/
#define THERMAL_PERIOD_SECONDS 60
#define THERMAL_PERIOD_SECONDS 30
/**
* Max number of temperature measures

View file

@ -1521,7 +1521,7 @@ To display the temperature of all disks, use the \-A or \-\-stats option.
.SS temp_sleep TIME_IN_MINUTES
Sets the standby time, in minutes, when the temperature limit is
reached. During this period, the disks remain spun down. The default
is 15 minutes.
is 5 minutes.
.SS pool DIR
Defines the pooling directory where the virtual view of the disk
array is created using the \[dq]pool\[dq] command.

View file

@ -1230,7 +1230,7 @@ Configuration
temp_sleep TIME_IN_MINUTES
Sets the standby time, in minutes, when the temperature limit is
reached. During this period, the disks remain spun down. The default
is 15 minutes.
is 5 minutes.
pool DIR
Defines the pooling directory where the virtual view of the disk

View file

@ -1316,7 +1316,7 @@ To display the temperature of all disks, use the -A or --stats option.
Sets the standby time, in minutes, when the temperature limit is
reached. During this period, the disks remain spun down. The default
is 15 minutes.
is 5 minutes.
7.13 pool DIR
-------------