Apache instance

Hi ,

Maximum How many instances of apache can we run in
one box?

Depends on how much memory you have and the number of processes the user can create.

This is akin to asking "how many boxes can I transport on a boat".

It all depends on a lot of factors. What kind of boxes are they? How big are they? What kind of boat are you using to transport the boxes? There's also a question of where your limitations are. For instance, if the boxes are very light, volume is obviously going to be the limiting factor. If they are excessively heavy, then weight might be the issue.

In regards to your question, the same answer applies. What kind of Apache instances are they? If they are low-RAM but CPU heavy processes, then obviously CPU will be your limiting factor. If they eat up a lot of RAM, but little CPU, then RAM is your limit. The same thing goes for I/O.

It's also a question of your architecture. For instance, Apache2 with prefork has a hard limit of ~64k processes, so you can never go beyond that, not that you're likely to reach that figure in any reasonable scenario anyway. Threaded Apache2 doesn't have the same kind of limits, but have limits of their own.

It's also a matter of how you set up Apache. I've seen systems where the limiting factor was neither CPU nor RAM, but the fact that Apache had to spend all its time spawning new processes.

The simple answer to your question is the following, how much RAM does each process consume, and how much RAM do you have available?

For instance, if each process takes 50MB RAM and you have 2GB RAM, you can run 40 processes.

Now, again, this is NOT a simple question to answer, and the only way for you to reliably find out is to take a look at YOUR setup and do some calculation work.