Homeostasis of primary and secondary metabolites