Regulatory architecture determines optimal regulation of gene expression in metabolic pathways