# How many jails can one FreeBSD box handle?



## stewe (May 31, 2013)

Hi there,

Pretty silly question but never mind. I am asking, how many jails can one average FreeBSD box handle? Let's say I have e.g. 5 TB of disk space and I am going to give 1 GB at least per jail. So it is roughly speaking 5000 jails. Let's be more realistic and let's say I can create 4000 of them.

Let's say every jail will act as a private server for an ordinary user. It would be something as a server hosting / web hosting.

Then assume half of these servers will be used permanently so every time at least 2000 jails will run.

How much memory should I have in my server?
Regarding CPU, let's say I have some 8 cores / 2-3 GHz.

Would this scenario be possible?


----------



## stewe (Jun 1, 2013)

I have to obviously answer myself.

http://forums.freebsd.org/showthread.php?t=32613
http://ivoras.sharanet.org/blog/tree/2009-10-20.the-night-of-1000-jails.html

Thank you for the interest*.*


----------



## ta0kira (Jun 1, 2013)

The solution also depends on how the users access those jails. Do you plan to run an instance of sshd per jail? Do you plan to have a single point of ssh access where users can queue jobs that will be run in their jails? Do you plan to have one IP address per jail, with users using ssh from the local machine?

Another question is whether or not the users need root access. If not, there's no reason to give each of them a personal jail. You can use rctl to dictate per-user resource limits, and you can use `rctl -a user:*:`... to apply the same limit to each indidual user. No jail needed. As far as I know, the only way to impose jail limits is via rctl, so you'll need to use it anyway. Controlling bandwidth is another issue, which might actually require a separate IP address for each user.

Kevin Barry


----------



## gkontos (Jun 1, 2013)

stewe said:
			
		

> Let's say every jail will act as a private server for an ordinary user. It would be something as a server hosting / web hosting.



Very different things. Shared web hosting versus server hosting. 



			
				stewe said:
			
		

> Then assume half of these servers will be used permanently so every time at least 2000 jails will run.
> 
> How much memory should I have in my server?
> Regarding CPU, let's say I have some 8 cores / 2-3 GHz.
> ...



Assume that you have 2000 Apache instances. Assume that each instance will set max servers and clients to 512. Add mysql-server to the picture. 

And finally assume that from those 2000 servers a 10% will constantly run on a high volume.


----------

