This is a fun website, for a certain definition of fun: Medieval Demographics Made Easy.
Sites like that make me wonder how much I ought to worry about such things when writing my own speculative fiction. I guess it is important, for believability, to make sure the numbers roughly work out (so that it’s believable that everyone won’t starve, for example) – but the page itself encourages you to fudge the numbers however much you want to get the desired result.
I also wonder how much thought the greats of speculative fiction put into things like this. When he was drawing his maps, Tolkien must have thought about roughly how much land they’d need to support the populations of the different countries of Middle-Earth, but then again he rarely if ever gave exact population accounts, so he didn’t have to worry about it too much.
Or take Gene Wolfe; how did he decide how many cities there were inside The Whorl (c.f. Book of the Long Sun)? The only way I can see would be by calculating the surface area in the hollowed-out part of the asteroid, deciding how much cultivated land there would be, then using something like the page linked to (though presumably requiring more research) to find out how many cities there could be. (Incidentally, I also sometimes wonder how the city of Nessus, in the Book of the New Sun, fed itself, since it didn’t appear to grow its own food and it was so big that shipping the food in seemed impractical.)
Then I consider that most of the short stories I write take place in completely unbelievable worlds – in one of them there is no food, people live on light, and in another there is actually more land in the city itself than in the rural areas – and I stop worrying about it, at least until I write a story that set in a world whose rules are remotely similar to our own.