Feature Suggestion: Limit CPU usage

I agree. The way I have to solve it for now for my Linux servers is to add cpu-flags to my Duplicacy Web Docker container. Not an ideal solution, but works quite well for me after a week of usage.

For my Windows and Mac machines I have yet found a way to limit the CPU usage in a proper way.

@saspus do you think this would help: Add a -max-list-rate option to backup to slow down the listing · gilbertchen/duplicacy@67a3103 · GitHub?

if listRateLimit > 0 {
			maxFiles := int(time.Now().Sub(startTime).Seconds() * float64(listRateLimit))
			if len(snapshot.Files) > maxFiles  {
				delay := float64(len(snapshot.Files) - maxFiles) / float64(listRateLimit)
				time.Sleep(time.Duration(delay * 1000.0) * time.Millisecond)
  • Should not this be a running average over fixed few seconds long window and not over ever-increasing one?
  • It may indeed have a side effect of somewhat accomplishing what we need, but the experience would not be smooth, because the delay is variable, control input coarse (on the order of seconds), and there is other variable cpu processing involved (like regex matching) that is different for different files. In other words this will not result in sustained use of say 10% cpu but instead would jump all over the place, including likely triggering turbo boost.
  • any solutions that attempts to guess and adjust code execution timing will be convoluted and I would argue that it’s not a job of a command line utility to moderate itself; there are other utilities available to do that. Why not add functionality similar to what cpulimit (PWM of SIGSTOP/SIGCOONT) does to duplicacy_web instead? This will avoid cluttering CLI engine code (users of which already have cpulimit available for them).

Pretty sure you’re a bot me ol’ chum. Quote what that link has to do with thread - other than the fact the word ‘Ping’ appears in the context of bumping the topic… :wink:

Yep, likely it was (I mean, likely a bot, but definitely spam). Looks like someone is testing various strategies to bypass discourses antispam. This approach (respond to old thread with keywords) seems to work more often than others, recently