Run FAH below certain CPU threshold

If you're new to FAH and need help getting started or you have very basic questions, start here.

Moderators: Site Moderators, FAHC Science Team

Post Reply
StoreyODST
Posts: 2
Joined: Thu Sep 17, 2020 10:40 pm

Run FAH below certain CPU threshold

Post by StoreyODST »

Hi there!

I'm part of a community which is paying for a relatively powerful virtual private server, and we're looking into ways to run the FAH client whenever it's idling/not in use to pitch in for the cause. However, this will depend on us being able to kick FAH off whenever CPU rises above a certain threshold so that it doesn't eat up our CPU when we use it for normal functions.

Does anyone know how to make it so that FAH only kicks in above a certain % CPU usage? We're running box-standard Windows 10 Pro which we access remotely, if it helps.

First post on this site, so thanks a ton for any help :D
JimboPalmer
Posts: 2522
Joined: Mon Feb 16, 2009 4:12 am
Location: Greenwood MS USA

Re: Run FAH below certain CPU threshold

Post by JimboPalmer »

Welcome to Folding@Home!

1) by default F@H is run at a very low CPU priority, so any other task will run instead.

2) one option is 'on idle' which only runs when the OS thinks it is idle. (and so the rules are different for every OS)

3) There are various scripts to start and stop F@H, but again they vary by OS.
Tsar of all the Rushers
I tried to remain childlike, all I achieved was childish.
A friend to those who want no friends
MeeLee
Posts: 1339
Joined: Tue Feb 19, 2019 10:16 pm

Re: Run FAH below certain CPU threshold

Post by MeeLee »

Another option is to manually pause the client, when you know you're going to do a lot of (CPU/GPU) work on the server, and unpause when done.
PantherX
Site Moderator
Posts: 6986
Joined: Wed Dec 23, 2009 9:33 am
Hardware configuration: V7.6.21 -> Multi-purpose 24/7
Windows 10 64-bit
CPU:2/3/4/6 -> Intel i7-6700K
GPU:1 -> Nvidia GTX 1080 Ti
§
Retired:
2x Nvidia GTX 1070
Nvidia GTX 675M
Nvidia GTX 660 Ti
Nvidia GTX 650 SC
Nvidia GTX 260 896 MB SOC
Nvidia 9600GT 1 GB OC
Nvidia 9500M GS
Nvidia 8800GTS 320 MB

Intel Core i7-860
Intel Core i7-3840QM
Intel i3-3240
Intel Core 2 Duo E8200
Intel Core 2 Duo E6550
Intel Core 2 Duo T8300
Intel Pentium E5500
Intel Pentium E5400
Location: Land Of The Long White Cloud
Contact:

Re: Run FAH below certain CPU threshold

Post by PantherX »

Welcome to the F@H Forum StoreyODST,

Can you please describe your physical hardware you have and how you're managing your virtualization?

For example, you can create a 8 CPU Ubuntu VM which runs at a lower priority in VMWare which means that if other VMs need CPU cycles, they get it.

You can also allocate minimum CPU Usage to production VMs and non for F@H VM in Hyper-V.

BTW, the preference for an Ubuntu VM is that there's lower overhead and no licensing costs associated so can be cheaper to run.
ETA:
Now ↞ Very Soon ↔ Soon ↔ Soon-ish ↔ Not Soon ↠ End Of Time

Welcome To The F@H Support Forum Ӂ Troubleshooting Bad WUs Ӂ Troubleshooting Server Connectivity Issues
StoreyODST
Posts: 2
Joined: Thu Sep 17, 2020 10:40 pm

Re: Run FAH below certain CPU threshold

Post by StoreyODST »

PantherX wrote:Welcome to the F@H Forum StoreyODST,

Can you please describe your physical hardware you have and how you're managing your virtualization?

For example, you can create a 8 CPU Ubuntu VM which runs at a lower priority in VMWare which means that if other VMs need CPU cycles, they get it.

You can also allocate minimum CPU Usage to production VMs and non for F@H VM in Hyper-V.

BTW, the preference for an Ubuntu VM is that there's lower overhead and no licensing costs associated so can be cheaper to run.
We don't own the physical hardware- we're paying for a VM hosted by a provider, which we use to run a game server for our community. We run the VM with on Windows 10 for ease of use, since some of the programs specific to our use aren't available on Linux. Since our players aren't on as often during the week, we'd like to dedicate some of our off-hour processing power to running FAH, but we're looking to find a way to have it turn automatically on and off when non-FAH CPU usage is above a certain threshold, i.e. when servers are in use.

We don't have access to HyperV, so our VM functions just like a normal Windows machine, albeit a bit faster in CPU/bandwidth. We usually access it via RDP, with backups available for the head admin.

Approximate specs are as follows:
- CPU: 1x vCPU w/ 4 vCores @ 4.0+ GHz (Shows up as an Intel Core i9 9900K in Task Manager))
- RAM: 10gb DDR4
- 150 GB SSD (Most of it already in use)
- No GPU
- 500 Mb/s unmetered bandwidth

Additionally, some other questions to ask:
1. Does anyone know if FAH's idle function only works when there's user input (such as from RDP), or does it turn off when other programs are in use?
2. Is there any way to 'limit' FAH CPU usage in Windows aside from modifying core count?
3. As a backup, any recommended mobile apps to control FAH? Do they work?

Thanks for the help!
ajm
Posts: 750
Joined: Sat Mar 21, 2020 5:22 am
Location: Lucerne, Switzerland

Re: Run FAH below certain CPU threshold

Post by ajm »

As JimboPalmer said above, if you only use the CPU, you don't have to do anything special: by default, FAH runs at the lowest priority and will let your VM do other CPU tasks as soon as they are launched.
As for a mobile app, if you already use RDP, why not use its mobile version?
https://docs.microsoft.com/en-us/window ... op-clients
Last edited by ajm on Sat Sep 19, 2020 5:22 pm, edited 1 time in total.
Joe_H
Site Admin
Posts: 7937
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: Run FAH below certain CPU threshold

Post by Joe_H »

1. The Idle function on Windows is based around user input and typically is when either the screen would be turned off due to inactivity or a screensaver would run.

The client normally runs at the lowest priority, so usually that is enough to get it out of CPU scheduling once a higher priority process becomes active. It is scriptable, the FAHClient process accepts connections using telnet over port 36330 on the local IP 127.0.0.1. So a script that monitors whether a particular program is active or not could be used to send a Pause or Resume command.

FAHControl can also be setup on a remote system to control the client.

3. The mobile apps I am familiar with mostly do monitoring, I don't know if any also allow control such as stopping and starting processing. FAH Mobile Monitor for iOS devices is one, he was working on porting to Android at one point.

You can also program your own, there is an API defined for communicating with the client - https://github.com/FoldingAtHome/fah-co ... Client-API.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
bruce
Posts: 20824
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: Run FAH below certain CPU threshold

Post by bruce »

The idea of suspending FAHClient/FAHCore_xx when other tasks are using resources is a challenging approach. Wouldn't it be easier to take advantage of priority settings that are built into the OS so that whenever resources are needed by other programs, FAH suspends itself and yields resources to the other activities? That's the sole purpose that priority settings were invented.
MeeLee
Posts: 1339
Joined: Tue Feb 19, 2019 10:16 pm

Re: Run FAH below certain CPU threshold

Post by MeeLee »

ajm wrote:As JimboPalmer said above, if you only use the CPU, you don't have to do anything special: by default, FAH runs at the lowest priority and will let your VM do other CPU tasks as soon as they are launched.
As for a mobile app, if you already use RDP, why not use its mobile version?
https://docs.microsoft.com/en-us/window ... op-clients
Not sure this still works when ran in a VM.
Usually, I would expect that the CPU would distribute resources to the VMs. Not to FAH.
FAH wouldn't see that there's something else using CPU cycles in a VM.

However, you could run FAH on all cores 100%, and set the VM priority to idle or low.
And set the VM hosting the game server as high.
The main issue with that, is that your server will be running 100% all the time. And that with a reset, reboot or power outage, Windows would reset the thread priorities upon booting up.
Post Reply