At the age you're talking about, teacher:student ratio seems more important than student count. If the larger class you're looking at has a poorer ratio, I wouldn't choose that (absent other reasons for choosing).
Teacher to student ratio of 1:8 is a reasonable ratio at 3; at 2.5 I'd say it's even a little low. 2.5 year olds want - need - attention from adults, and it can be difficult in a larger class to get that attention. In my state (Illinois), 1:8 would be the maximum ratio allowed at 2.5; while you could have more than 8 kids in a class, you'd need more teachers.
Learning socialization is quite possible with a smaller group. Eight is plenty to have some diversity; you may want to find out how much diversity there actually is of course in both schools, of course.
My children (4 and 2.5) go to a morning preschool and afternoon daycare, and have both kinds of experiences. The morning preschool is large, 25 kids in the main class (Montessori style); the afternoon daycare is smaller, usually around 8 kids there. In the morning, while there are a lot of children there, my older child has only a couple of friends - most of the kids he doesn't really play with (when playing, of course they're doing work most of the day).
In the smaller setting, though, I find that he is more often interacting with all of the children - even the littler ones. I'm not sure why this is; whether a smaller group leads to it being easier to form relationships with all of them, perhaps because the larger group is overwhelming; or because a smaller group requires interacting with all of them from time to time; or something else. But it definitely leads to a more concrete social group rather than a bunch of small cliques or groups.
So - I would suggest that a class of 8 is fine, as far as learning socialization goes, and if it is the better school otherwise, particularly with teacher:student ratio, it would be a good choice.