10,000 Virtual Hosts in a Tomcat instance

2006-08-26 Thread KEGan

Hi,

I am quite a Tomcat newbie. I am building an web application that host about
10,000 websites (only single static HTML for each website). Each website is
reference using a subdomain i.e. website1.mycompany.com, 
website2.mycompany.com, and so on.

So I am planning to add these subdomain as virtual host into a Tomcat
instance (this will be done using JMX when Tomcat startup).

I am wondering if anyone has added 10,000 virtual hosts to Tomcat before,
and whether Tomcat can handle this.

Thank you in advance.


Re: 10,000 Virtual Hosts in a Tomcat instance

2006-08-26 Thread Edoardo Panfili

KEGan ha scritto:

Hi,

I am quite a Tomcat newbie. I am building an web application that host 
about

10,000 websites (only single static HTML for each website). Each website is
reference using a subdomain i.e. website1.mycompany.com, 
website2.mycompany.com, and so on.


a question: why do you want to use tomcat to serve static HTML, why 
Apache httpd isn't useful for you?


Edoardo

--
[EMAIL PROTECTED]
AIM: edoardopn
Jabber: [EMAIL PROTECTED]
tel:075 9142766

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 10,000 Virtual Hosts in a Tomcat instance

2006-08-26 Thread KEGan

Edoardo,

The websites can be added and edited dynamically by the corresponding
owners. I am buidling something like Blogger.com. Where users can edit their
websites and published it. The engine is built using Tapestry.

Currently, I am using a servlet filter to forward Http requests to the
corresponding directories based on the subdomain. I think using virtual
hosts in tomcat would be a cleaner solution.

The reason for using Tomcat is simply ease of use, and I can dynamically
configure Tomcat using JMX (e.g. to add subdomain). Also, I have read that
using Tomcat to serve static HTML isnt really any slower compare to Apache
HTTP Server.

I wanted to find out from the Tomcat user commnunity if anyone is using
Tomcat with a large amount of virtual hosts. If anyone has any experience on
this, I will greatly appreciate if you can shed some light.

Thanks.


On 8/26/06, Edoardo Panfili [EMAIL PROTECTED] wrote:


KEGan ha scritto:
 Hi,

 I am quite a Tomcat newbie. I am building an web application that host
 about
 10,000 websites (only single static HTML for each website). Each website
is
 reference using a subdomain i.e. website1.mycompany.com, 
 website2.mycompany.com, and so on.

a question: why do you want to use tomcat to serve static HTML, why
Apache httpd isn't useful for you?

Edoardo

--
[EMAIL PROTECTED]
AIM: edoardopn
Jabber: [EMAIL PROTECTED]
tel:075 9142766

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: 10,000 Virtual Hosts in a Tomcat instance

2006-08-26 Thread Mladen Turk

KEGan wrote:

Hi,

I am wondering if anyone has added 10,000 virtual hosts to Tomcat before,
and whether Tomcat can handle this.



There are no limits except memory available to the JVM.
The performance itself should depend only on
the file system, and I would suggest not to
put all 1 homes inside the same directory root.

Regards,
Mladen.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 10,000 Virtual Hosts in a Tomcat instance

2006-08-26 Thread Mladen Turk

Edoardo Panfili wrote:


a question: why do you want to use tomcat to serve static HTML, why 
Apache httpd isn't useful for you?




Having 1 homes makes no difference if you use
Tomcat or Httpd. In that case its more up to the OS
rather then web server itself.

Regards,
Mladen.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 10,000 Virtual Hosts in a Tomcat instance

2006-08-26 Thread Andrew Miehs

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

What is this supposed to become?

Do you want 10,000 domains on the tomcat? or do you want 10,000 webapps?

The JVM will die if you do this with 10,000 webapps

Andrew


On 26/08/2006, at 11:36 AM, Mladen Turk wrote:


KEGan wrote:

Hi,
I am wondering if anyone has added 10,000 virtual hosts to Tomcat  
before,

and whether Tomcat can handle this.



There are no limits except memory available to the JVM.
The performance itself should depend only on
the file system, and I would suggest not to
put all 1 homes inside the same directory root.


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFE8BevW126qUNSzvURAuUvAJ9imCr0QgPH9GtRWoP+Rn17cKrYgACfTmoy
HaoJLfqu8Y+gtR7sU1PAPCA=
=lN6F
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 10,000 Virtual Hosts in a Tomcat instance

2006-08-26 Thread Mladen Turk

Andrew Miehs wrote:

The JVM will die if you do this with 10,000 webapps



Why do you think it will die?
There are systems with 64-bit JVM's and terabytes of
memory.

Regards,
Mladen.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 10,000 Virtual Hosts in a Tomcat instance

2006-08-26 Thread Andrew Miehs

Ok - Theoretically it may work...

Who do you know that has a machine with Terabytes of memory? And is  
using it for web hosting?!


The JVM will spend all its time doing context switching and garbage  
collection...


Andrew


On 26/08/2006, at 11:49 AM, Mladen Turk wrote:


Andrew Miehs wrote:

The JVM will die if you do this with 10,000 webapps


Why do you think it will die?
There are systems with 64-bit JVM's and terabytes of
memory.



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 10,000 Virtual Hosts in a Tomcat instance

2006-08-26 Thread KEGan

Thanks Mladen for the valueable reply.

Andrew, on your question : it is 10,000 domains that serves 10,000 different
static HTML. One HTML for each domain.

How much memory does 1 webapp takes in Tomcat ? Would it be ok with 10,000
domains pointing to 10,000 webapps but each webapp serves only static HTML?



On 8/26/06, Andrew Miehs [EMAIL PROTECTED] wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

What is this supposed to become?

Do you want 10,000 domains on the tomcat? or do you want 10,000 webapps?

The JVM will die if you do this with 10,000 webapps

Andrew


On 26/08/2006, at 11:36 AM, Mladen Turk wrote:

 KEGan wrote:
 Hi,
 I am wondering if anyone has added 10,000 virtual hosts to Tomcat
 before,
 and whether Tomcat can handle this.


 There are no limits except memory available to the JVM.
 The performance itself should depend only on
 the file system, and I would suggest not to
 put all 1 homes inside the same directory root.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFE8BevW126qUNSzvURAuUvAJ9imCr0QgPH9GtRWoP+Rn17cKrYgACfTmoy
HaoJLfqu8Y+gtR7sU1PAPCA=
=lN6F
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: 10,000 Virtual Hosts in a Tomcat instance

2006-08-26 Thread Mladen Turk

Andrew Miehs wrote:

Ok - Theoretically it may work...

Who do you know that has a machine with Terabytes of memory? And is 
using it for web hosting?!


The JVM will spend all its time doing context switching and garbage 
collection...


Look, there was a time when I thought that 1MB or RAM was something
no one will ever need. Further more the box occupied entire room.
Of course it was back in 80's, but now (after couple of decades
being in the business), I always presume that there are no limits.

Regards,
Mladen.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 10,000 Virtual Hosts in a Tomcat instance

2006-08-26 Thread Andrew Miehs

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

If you are only delivering static content, then use Apache or Lighttpd

http://www.lighttpd.net/

This is NOT what tomcat is designed for

As for how much memory, no idea - but it cant be good

Andrew


On 26/08/2006, at 12:00 PM, KEGan wrote:


Thanks Mladen for the valueable reply.

Andrew, on your question : it is 10,000 domains that serves 10,000  
different

static HTML. One HTML for each domain.

How much memory does 1 webapp takes in Tomcat ? Would it be ok with  
10,000
domains pointing to 10,000 webapps but each webapp serves only  
static HTML?


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFE8B1vW126qUNSzvURAsa7AJ0ThoV+7mOGrdOMGhHBbJPtxv75OQCfUa4Z
R2X7ESQkd1h/vRuak0MdD4w=
=jIyr
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 10,000 Virtual Hosts in a Tomcat instance

2006-08-26 Thread Mladen Turk

Andrew Miehs wrote:


If you are only delivering static content, then use Apache or Lighttpd

http://www.lighttpd.net/

This is NOT what tomcat is designed for



In theory the threaded model should consume less memory
and less CPU cycles compared with prefork model.
Of course if your application is stable then you
should always prefer worker-mpm over the prefork-mpm.

Did you ever tried to hit the Httpd with 1 concurrent
connections? I did, and Tomcat uses less memory then
Apache httpd, and that's why it is 2 times faster then
httpd.

Regards,
Mladen.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 10,000 Virtual Hosts in a Tomcat instance

2006-08-26 Thread KEGan

I tried to use only Tomcat since the static content is dynamically
generated. Think blogging application.

However, users dont update the data that often, that's why I generate the
content and make it static for web access, as oppose to dynamically generate
the content each time it is requested. Using minimal CPU cycles.

Also, I tried to use ONLY Tomcat and do away with integration of Apache HTTP
+ Tomcat, or Lighthttpd + Tomcat, because its would be easier to maintain.

I will try to write some tests and see how much memory and such. Then post
back here. This may take a while.

Worse come to worst, I will keep only 1 webapp, then use servlet filter to
return different HTML depending on the httpServletRequest.getServerName().

~KEGan




On 8/26/06, Mladen Turk [EMAIL PROTECTED] wrote:


Andrew Miehs wrote:

 If you are only delivering static content, then use Apache or Lighttpd

 http://www.lighttpd.net/

 This is NOT what tomcat is designed for


In theory the threaded model should consume less memory
and less CPU cycles compared with prefork model.
Of course if your application is stable then you
should always prefer worker-mpm over the prefork-mpm.

Did you ever tried to hit the Httpd with 1 concurrent
connections? I did, and Tomcat uses less memory then
Apache httpd, and that's why it is 2 times faster then
httpd.

Regards,
Mladen.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: 10,000 Virtual Hosts in a Tomcat instance

2006-08-26 Thread Andrew Miehs

Dear Mladen,

Are we referring to 10,000 Virtual servers or 10,000 Connections?
And the answer is yes to 1 connections.

Yes I would use worker-mpm or better still an epoll based httpd  
daemon, like lighttpd or zeus.


Regards

Andrew


On 26/08/2006, at 12:18 PM, Mladen Turk wrote:


Andrew Miehs wrote:
If you are only delivering static content, then use Apache or  
Lighttpd

http://www.lighttpd.net/
This is NOT what tomcat is designed for



In theory the threaded model should consume less memory
and less CPU cycles compared with prefork model.
Of course if your application is stable then you
should always prefer worker-mpm over the prefork-mpm.

Did you ever tried to hit the Httpd with 1 concurrent
connections? I did, and Tomcat uses less memory then
Apache httpd, and that's why it is 2 times faster then
httpd.



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 10,000 Virtual Hosts in a Tomcat instance

2006-08-26 Thread KEGan

Referring to 10,000 virtual host in one tomcat instance.

On 8/26/06, Andrew Miehs [EMAIL PROTECTED] wrote:


Dear Mladen,

Are we referring to 10,000 Virtual servers or 10,000 Connections?
And the answer is yes to 1 connections.

Yes I would use worker-mpm or better still an epoll based httpd
daemon, like lighttpd or zeus.

Regards

Andrew


On 26/08/2006, at 12:18 PM, Mladen Turk wrote:

 Andrew Miehs wrote:
 If you are only delivering static content, then use Apache or
 Lighttpd
 http://www.lighttpd.net/
 This is NOT what tomcat is designed for


 In theory the threaded model should consume less memory
 and less CPU cycles compared with prefork model.
 Of course if your application is stable then you
 should always prefer worker-mpm over the prefork-mpm.

 Did you ever tried to hit the Httpd with 1 concurrent
 connections? I did, and Tomcat uses less memory then
 Apache httpd, and that's why it is 2 times faster then
 httpd.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: 10,000 Virtual Hosts in a Tomcat instance

2006-08-26 Thread Mladen Turk

Andrew Miehs wrote:


Are we referring to 10,000 Virtual servers or 10,000 Connections?
And the answer is yes to 1 connections.



It does not matter. 1 Virtual hosts in Apache
would require as much memory as 1 Hosts in Tomcat.
Once when you break the JVM latency, there is no much
difference between Java or any other 'optimized' program.

Regards,
Mladen.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 10,000 Virtual Hosts in a Tomcat instance

2006-08-26 Thread Andrew Miehs

Stupid question,

Why don't you implement the 'virtual' hosts inside the one 'webapp'?
And not create 10,000 web apps?

That the App itself deals with the virtual hosts (by reading the host  
header), and not tomcat?


Andrew

On 26/08/2006, at 12:30 PM, KEGan wrote:


I tried to use only Tomcat since the static content is dynamically
generated. Think blogging application.

However, users dont update the data that often, that's why I  
generate the
content and make it static for web access, as oppose to dynamically  
generate

the content each time it is requested. Using minimal CPU cycles.

Also, I tried to use ONLY Tomcat and do away with integration of  
Apache HTTP
+ Tomcat, or Lighthttpd + Tomcat, because its would be easier to  
maintain.





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]