To understand the effect of cell morphology on chemotactic performance on planktonic bacteria, we tracked Escherichiacoli cells of different length as they swam in a microfluidic channel with a gradient of nutrients. We replicated the results with an IBM model. Experiments revealed that there is an optimal cell length for chemotaxis, and simulations showed how this optimum emerged from the interplay of a handful of motility parameters.