Dietary restriction (DR) and rapamycin both increase lifespan across a number of taxa. Despite this positive effect on lifespan and other aspects of health, reductions in some physiological functions have been reported for DR, and rapamycin has been used as an immunosuppressant. Perhaps surprisingly, both interventions have been suggested to improve immune function and delay immunosenescence. The immune system is complex and consists of many components. Therefore, arguably, the most holistic measurement of immune function is survival from an acute pathogenic infection. We reanalysed published post-infection short-term survival data of mice (n = 1223 from 23 studies comprising 46 effect sizes involving DR (n = 17) and rapamycin treatment (n = 29) and analysed these results using meta-analysis. Rapamycin treatment significantly increased post infection survival rate (lnHR = − 0.72; CI = − 1.17, -0.28; p = 0.0015). In contrast, DR reduced post-infection survival (lnHR = 0.80; CI = 0.08, 1.52; p = 0.03). Importantly, the overall effect size of rapamycin treatment was significantly lower (p < 0.001) than the estimate from DR studies, suggesting opposite effects on immune function. Our results show that immunomodulation caused by rapamycin treatment is beneficial to the survival from acute infection. For DR, our results are based on a smaller number of studies, but do warrant caution as they indicate possible immune costs of DR. Our quantitative synthesis suggests that the geroprotective effects of rapamycin extend to the immune system and warrants further clinical trials of rapamycin to boost immunity in humans.