-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sytemd service file ? #103
Comments
What would you want a service file for this to do/provide? |
I am also curious considering systemd service files can already do this for what it manages. [Service]
CPUQuota=20% See also |
Sorry @Freso I am late. In the past, before systemd, we put the statement cpulimit in a special system file according to start it during system startup. With systemd now all is started with a systemd service file. I speak about a service file to start cpulimit. Please I am not a techie person about systemd so a ref to systemd doc is not for me. Thanks |
What I am saying is that when you write a systemd service file, in addition to A fuller example (although where I cut [Unit]
Description=R-66Y Limnoria instance (IRC bot)
[Service]
Type=simple
ExecStart=/home/limnoria/venv/bin/limnoria /home/limnoria/R-66Y/R-66Y.conf
User=limnoria
CPUQuota=30%
[Install]
WantedBy=multi-user.target |
@Mikaela thanks But the problem is a way complex for my case. An app FAH is started by systemd service file. FAH launches randomly others app named "FahCore_a8", "Fahcore_22". So we must launch a service file which detects that "Fahcore_a8" and "Fahcore_22" are running and limits their cpu consumption to 20 %. |
I think what you should do is [Service]
CPUQuota=20% and it should just work without having to even touch the actual service file (as this creates a drop-in file e.g. |
thanks I will try this as soon as I have some time. |
20% is not enough according Fahcore_a8 consumes 20 %. More With CPUQuota=200% FahCore_22 consumes only 5 % instead of 20 % ! My conf is :
I choose how many cores are used, but Fah decides how to dispatch them between Fahcore_a8 and Fahcore_22. |
I don't understand what is going on there, but I do have another idea (that actually includes
[Service]
# Empty ExecStart erases whatever ExecStart has been specified before
ExecStart=
# and do adjust the flags to be more suitable for you
ExecStart=/usr/bin/cpulimit --lazy --include-children --limit=30 /usr/bin/fahcore-or-whatever
My third idea would be creating a systemd oneshot service and a timer for running PS. Sorry for long response time, I seem to have went a couple of days without reading my email. |
No problem. The ExecStart of Fah-client service : ExecStart=/usr/local/bin/fah-client --config=/etc/fah-client/config.xml --log=/var/log/fah-client/log.txt --log-rotate-dir=/var/log/fah-client/ Are you sure the new ExecStart runs without any problem ? ExecStart=/usr/bin/cpulimit --lazy --include-children --limit=30 /usr/local/bin/fah-client --config=/etc/fah-client/config.xml --log=/var/log/fah-client/log.txt --log-rotate-dir=/var/log/fah-client/ |
I created a cpulimit service. [Unit] [Service] [Install] --include-children is not an option of cpulimit. This lead to an exit code when sarting cpulimit service. |
I discovered a big problem. openSUSE supplies a cpulimit package which is in fact Limitcpu 3.0 it is not the original cpulimit from here |
i keep my previous solution. a script cpulimit.sh cpulimit --exe FahCore_a7 --limit 50 & when it is needed
a service to launch the script [Unit] [Service] [Install] Anyway, thanks. |
Can you supply a systemd service file ?
Thanks
The text was updated successfully, but these errors were encountered: