Are my pots too small?

I plant small cacti in 2 to 3 inches pots and big cacti in 4 to 5 inches pots. They are mostly terracotta pots. I used small pots because my shelf is small. I wonder if that affect the grow of the plants