[pptp-server] Maximum number of users

Neale Banks neale at lowendale.com.au
Mon Apr 15 00:35:37 CDT 2002


On 13 Apr 2002, Torge Szczepanek wrote:

> Take a look at the kernel source at net/core/dev.c
> 
> There is a line:
> 
> If you need over 100 please also fix the algorithm...
> 
> In the for loop below that comment change the number 100 to 2048.
> 
> for (i = 0; i < 100; i++) {
> 
> to
> 
> for (i = 0; i < 2048; i++) {
> 
> Also increase the number of Unix PTYs to 2048. Otherwise you are stuck
> with 256 users because of the limited number of Unix-PTYs.
> 
> Recompile your kernel and start with your new kernel.
> 
> You now have a maximum of 2048 users. ;-)

True, but you forgot the "please also fix the algorithm" bit.

I wonder if anyone has ever estimated the hit of this function in
allocating a name for say the 2001th ppp device (noting that if you're
doing that, you've possibly got a significant proportion of those 2000 ppp
devices doing encryption and/or compression - a non-trivial load of
itself)?

I sometimes also wonder how many of these questions would be headed off at
the pass if the kernle had a patch like this applied:

--- linux-2.2.21-rc3-orig/net/core/dev.c	Fri Apr  5 22:38:30 2002
+++ linux-2.2.21-rc3-ntb/net/core/dev.c	Mon Apr 15 14:46:13 2002
@@ -318,6 +318,8 @@
 		if(dev_get(dev->name)==NULL)
 			return i;
 	}
+	printk(KERN_DEBUG "dev_alloc_name: unable to allocate name for %s dev.\n", name);
+	printk(KERN_DEBUG "dev_alloc_name: please fix linux/net/core/dev.c\n",);
 	return -ENFILE;	/* Over 100 of the things .. bail out! */
 }

Of course, a patch to fix the underlying deficiency would be far superior
to this mere diagnostic print.

Regards,
Neale.  




More information about the pptp-server mailing list