practical limit on the number of UIDs
Nadav Har'El
nyh at math.technion.ac.il
Wed Jun 29 14:02:25 IDT 2011
On Wed, Jun 29, 2011, Shachar Shemesh wrote about "Re: practical limit on the number of UIDs":
> When you reach so many users, the problems relating to questions such as
> "how long does it take nss to parse /etc/passwd" start to be dwarfed by
> the human cost of maintaining a megaline text file. If for that reason
> alone, you will need to switch to a DB back end.
I don't know what scenario Muli had in mind, but I can imagine one:
There's a generation-old debate on whether the file system is enough for
keeping data, big or small, (this is clearly "the Unix way") or whether
things like separate database software are needed.
Now, imagine that you are hosting, say, a blog site with a million users, and
are one of the big believers of the capabilities of the Unix filesystem.
Certainly, you say to yourself, you can keep each blog post as a separate
file and you don't need a database. But to help maintain fool-proof security,
you'd want each of the site's users to have his own uid, and his blog posts
are writable only to him, so that other users couldn't edit his posts even
if there was a bug in your web UI. So, can this be done - can you have a
million different UIDs?
I'd guess there should be no reason why not - the kernel nevers sees a list
of uids anyway (as far as I know), and just sees a 32-bit integer uid.
By the way, if you don't intend these users to use the "ordinary" login
programs (like ssh), there's no reason to actually list them in /etc/passwd:
Nothing prevents you from working with numeric user ids, and if you want
to convert your site's login names into numeric user ids, you'd most likely
use some sort of hash table - or even a file system directory ;-) - and not
a stupid linear file like /etc/passwd.
--
Nadav Har'El | Wednesday, Jun 29 2011, 27 Sivan 5771
nyh at math.technion.ac.il |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |Always remember you're unique, just like
http://nadav.harel.org.il |everyone else.
More information about the Linux-il
mailing list