Is it possible to run a program e.g.
xz in the background so it wouldn't suck all the system's resources?
You can change the priority for running processes. The lower the nice value, the more resources are allocated to that task above others. Setting a higher positive value (I believe this is measured from -20 to +19) would allocate almost no resources to the task, and it will be processed only when there is nothing else to be done.
How To Limit Resources Using cgroups on CentOS 6
If you don't want your program to suck all the system resources then you can use cgroups (example of how to use cgroups in Centos 6) to limit the resources. You may also want to set higher nice value so that your cpu only process it when less task are present to execute.