Forum archive
CPULIMIT and TKLBAM - An Experiment in Keeping Micro
Hi Folks!
I have just started to realize the devistating effect that TKLBAM can have on the performance of a Micro instance. It seems that, realistically, anyone wanting to have both uniform website performance and an hourly backup of their server must either move to a Small instance or use some sort of CPU limiter to reduce or eliminate the CPU spiking responsible for AWS CPU throttling.
I would like to experiment with setting up the CPULIMIT utility to accomplish practical throttling for the TKLBAM job, and invite anyone interesed in participating with the experiment by giving me feedback on how to do it. Maybe by the end of the experiment, we may have a bit of an instuction manual on how to practically set it up so TKL enthusasts can keep their micro instances as long as possible before needing to upgrade. Hopefully the last post in this thread can be a comprehensive CPULIMIT AND TKLBAM HOW TO.
To start, I think I can work on setting CPULIMIT up, but I have no idea what names of the process are that I would need to limit. Anyone know;
a) what processes TKLBAM itself uses?
b) is it possible to limit the MYSQLDUMP for the database portion? Would this be counterproductive because it would simply delay table unlocking?
c) Anyone know what part of TKLBAM is most CPU intensive? Is it the rsync or whatever it is that does the comparison to build the incementals that takes the most power? Or is it simply the TKLBAM compression that is the biggest consumer?
I'm starting off in the dark with my understanding of the true nature of TKLBAM, so any tips would be helpful.

I must admit that something similar crossed my mind too, although it never got any further than that...
A few bits and pieces of info which may be useful:
TKLBAM uses Duplicity as a backend so that may be worth further investigation. Although I suspect that the backup compression also loads up the CPU when running backups (and I assume that it uses tar). Whether tar is called by TKLBAM itself, or Duplicity I'm not sure. IIRC the devs released the sourcecode for TKLBAM so that may be worth investigation (if they have it should be on GitHub - otherwise you could download it from the TKL repo and pull the deb apart).
Top (will need to install - 'apt-get install top') is probably best to find out what is chewing CPU cycles. Run it while running a TKLBAM backup and see what is happening. Although from my quick reading, cpulimit at some point implemented the ability to limit a process and all it's child processes (ie if you limit TKLBAM it will also limit any other processes TKLBAM launches). But I'm not sure whether that is part of the version in the Debian repos? It looks like it's hosted on GitHub now though, so it would be easy to pull down the latest version.
Some time ago I discovered cpulimit daemon, which may also be useful?