And how many spears should your soldiers carry to throw in volley?
Here’s a great answer from Eric Lowe: How far could an ancient Roman soldier throw his one or two spears and isn’t that a small amount of ammunition?
I can’t recall any primary sources discussing range, but modern experiment suggests around 20 meters.
As for whether or not that’s a small amount of ammunition, I think the other answers have missed an important point. As of this writing, I see answers discussing the fact that the number of pila in the air added up when you consider how many men were throwing them and pointing out that they were to be thrown as a precursor to charging. And that’s all true, and I agree with it, but it still amounts to each maniple being able to throw a pilum as a precursor to charging only two times per battle. The question as I read it is whether that’s too small a number.
The answer is no. It’s actually somewhat conservative.
And then a discussion about why.
Slightly related: How do you actually hold and use a sword: The Basics