The reproductive success of many insects is considered to be limited by two main factors: the availability of mature eggs to lay (termed egg limitation) and the time to locate suitable hosts (termed time limitation). High host density in the environment is likely to enhance oviposition opportunities, thereby selecting for higher investment in egg supply. In contrast, a shortage of food (e.g. sugar sources) is likely to increase the risk of time limitation, thereby selecting for higher allocation to initial energy reserves. To our knowledge, the combined effect of host and food availability on these optimal life‐history allocations has never been investigated. We thus modelled their simultaneous effects on a three‐dimensional trade‐off between initial investment in energy reserves, egg number and egg size, while focusing on insect parasitoids. The model was based on Monte Carlo simulations coupled with genetic algorithms, in order to identify the optimal life‐history traits of a single simulated parasitoid female in an environment in which both hosts and food are present in varying densities. Our results reproduced the simple predictions described above. However, some novel predictions were also obtained, especially when specific interactions between the different factors were examined and their effects on the three‐dimensional life‐history surface were considered. The work sheds light on long‐lasting debates regarding the relative importance of time versus egg limitation in determining insect life‐history traits and highlights the complexity of life‐history evolution, where several environmental factors act simultaneously on multiple traits.