The immune system is vital for the immediate survival of multicellular organisms by protecting them from the damaging effects of bacterial infections, viruses, and toxic molecules. It has been hypothesized that the immune system plays a pivotal role in determining longevity. We investigated the efficiency of the innate immune system in Drosophila carrying the longevity extending mutations puc (JNK signaling pathway, stress response) and chico (insulin signaling pathway), as well as animals subjected to dietary restriction (DR), which also extends lifespan. We found that puc heterozygous animals, as well as chico homozygous and heterozygous flies, have enhanced pathogen resistance. Surprisingly, diet manipulation did not reproducibly alter pathogen resistance, despite its significant effect on the expression of many immunity-related genes. Considering that chronic or frequent activation of the immune system results in reduced longevity, we postulate that the longevity extending potential of the above mutations may be partially obscured by parallel activation of the immune system. Such upregulation is not observed during DR, suggesting the presence of a mechanism that suppresses immune activity in diet-restricted animals.