While Africa has seen a rapid growth of commercial livestock enterprises with its food systems transformation, little is known about their viability. We explore the profitability of commercial poultry enterprises facing rising input costs and increasing energy needs due to the adoption of climate mitigating technologies in Nigeria. Using a cross-sectional dataset and a one-year weekly panel of farm inputs and prices, we employ a discrete time, discrete control and state space dynamic programming model disaggregated by farm size to determine the source of economies of scale among commercial poultry farms. In the presence of high feed costs and increased energy needs, the optimal decision for medium sized farms is to sell and exit the industry. However, it remains profitable for large farms to stay in the sector. The findings are robust to various alternative model assumptions and specifications. They indicate that broiler farms need larger stock sizes to withstand negative input price shocks and expand energy consumption in the face of volatile and hotter temperatures. The sensitivity of the poultry industry to the feed prices is a major threat to the growth and survival of farms and highlight the importance of developing risk management mechanisms to stabilize prices.