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

Run FAH below certain CPU threshold

Postby StoreyODST » Thu Sep 17, 2020 11:45 pm

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
StoreyODST
 
Posts: 2
Joined: Thu Sep 17, 2020 11:40 pm

Re: Run FAH below certain CPU threshold

Postby JimboPalmer » Fri Sep 18, 2020 1:07 am

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
JimboPalmer
 
Posts: 2041
Joined: Mon Feb 16, 2009 5:12 am
Location: Greenwood MS USA

Re: Run FAH below certain CPU threshold

Postby MeeLee » Fri Sep 18, 2020 3:00 am

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.
MeeLee
 
Posts: 1096
Joined: Tue Feb 19, 2019 11:16 pm

Re: Run FAH below certain CPU threshold

Postby PantherX » Fri Sep 18, 2020 9:08 am

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
User avatar
PantherX
Site Moderator
 
Posts: 6765
Joined: Wed Dec 23, 2009 10:33 am
Location: Land Of The Long White Cloud

Re: Run FAH below certain CPU threshold

Postby StoreyODST » Sat Sep 19, 2020 5:58 pm

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!
StoreyODST
 
Posts: 2
Joined: Thu Sep 17, 2020 11:40 pm

Re: Run FAH below certain CPU threshold

Postby ajm » Sat Sep 19, 2020 6:13 pm

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 6:22 pm, edited 1 time in total.
ajm
 
Posts: 618
Joined: Sat Mar 21, 2020 6:22 am
Location: Lucerne, Switzerland

Re: Run FAH below certain CPU threshold

Postby Joe_H » Sat Sep 19, 2020 6:21 pm

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
Joe_H
Site Admin
 
Posts: 6608
Joined: Tue Apr 21, 2009 5:41 pm
Location: W. MA

Re: Run FAH below certain CPU threshold

Postby bruce » Sat Sep 19, 2020 7:17 pm

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.
bruce
 
Posts: 20009
Joined: Thu Nov 29, 2007 11:13 pm
Location: So. Cal.

Re: Run FAH below certain CPU threshold

Postby MeeLee » Sat Sep 19, 2020 7:52 pm

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.
MeeLee
 
Posts: 1096
Joined: Tue Feb 19, 2019 11:16 pm


Return to New Donors start here

Who is online

Users browsing this forum: No registered users and 3 guests

cron