You are not logged in.
Pages: 1
Topic closed
I have a DESKTOP machine that I'd like to be a little more responsive. In the Arch wiki there's a good explanation of how to fine tune the ondemand governor which seems to suit my needs perfectly. The performance governor is a bit too much. The manual commands;
echo -n 15 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo -n 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
work very well.
Now I tried to create a systemd service doing the above;
[Unit]
Description=CPU frequency ondemand tuning
[Service]
ExecStart=echo -n 15 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
ExecStart=echo -n 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
[Install]
WantedBy=multi-user.target
When trying to start it systemctl complains "job failed. Invalid argument". I've tried single qoutes after echo, but no success. Is this possible in a service file? Google has no answer unfortunately.
Offline
try this
ExecStart=/bin/bash -c 'echo 6500 > /sys/class/backlight/...'
But i didn't know i could use two ExecStart in a single .service file! Is it really possible?
Offline
That seems hot ...
Offline
Nope, no luck. Tried with two ExecStart= ... and with the two commands separated with ; which works in another service file. Error:
Loaded: error (Reason: Invalid argument)
Active: failed (Result: exit-code) since Wed, 13 Jun 2012 13:23:00 +0200; 3min 52s ago
Since I'm running only systemd units and will not use rc.local.service I really hope tuning the governor is possible from a native unit file.
Hey! One of your commands after the ExecStart= ... works! I'll try the syntax ...
Last edited by swanson (2012-06-13 11:35:05)
Offline
Put it in /etc/rc.local and call that in systemd. You can find a .service for rc.local on the wiki.
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Nope, no rc.local.servcie for me. This works;
[Unit]
Description=CPU frequency ondemand tuning
[Service]
ExecStart=/bin/bash -c 'echo -n 25 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold ; echo -n 19 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor'
[Install]
WantedBy=multi-user.target
Thanks for the help guys! Now I'll see what it does at boot ...
Last edited by swanson (2012-06-13 11:40:29)
Offline
So it is possible to run two commands in a single ExecStart line, wow! That's wonderful
Offline
Multiple ExecStart only works with Type=oneshot
Nevertheless, you should do this with tmpfiles instead: https://wiki.archlinux.org/index.php/Sy … rary_files
moderator edit. [ewaller] After this thread was closed, there had been a report that the above link is incorrect. The assertion is that that link should be https://wiki.archlinux.org/index.php/Sy … rary_files
Last edited by ewaller (2015-10-15 22:38:10)
Offline
Uhm, what's the difference?
I mean, why is it better to use tmpfiles instead of .service to echoing?
Last edited by nierro (2012-06-13 12:30:31)
Offline
Uhm, what's the difference?
I mean, why is it better to use tmpfiles instead of .service to echoing?
Because tmpfiles are meant exactly for this kind of stuff and should be much simpler / shorter.
service files may work as well, but they are not supposed to be used for writing values into files.
Offline
Ah ok. thanks!
Offline
After a cold boot I can report that the unit file above worked well. No added boot time. And my values are set. I'll look into the tmpfile way as well. Googling "systemd" +tune + governor plus other ways didn't give anything. And by the way, googling systemd without double qoutes just gives a lot of hits on "system". Useless.
(PS I tried two ExecStart but had Type=OneShot, not oneshot)
Offline
Checked the tmpfile link as recommended by 65kid and that seemed a bit less complicated. I'd recommend that instead of my service file.
Offline
Checked the tmpfile link as recommended by 65kid and that seemed a bit less complicated. I'd recommend that instead of my service file.
Hi Swanson,
How exactly did you manage to make this happen using tmpfile? I am a beginner and would love if you (or anyone else) have the time to describe the procedure. Regards.
Offline
Offline
Pages: 1
Topic closed