You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Ilja S." <il...@frontdesk.ee> on 2007/06/15 13:04:42 UTC

APR with tomcat - long boot

Hi
Startup time of tomcat became very slow after installing APR.
Tomcat version is 5.5.23
APR 1.2.7
Ubuntu, kernel 2.6.20
Logs says INFO: Server startup in 192631 ms
Which is more 3 minutes! Is that normal?

-- 
*************************************
Best Regards
Ilja


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


Re: APR with tomcat - long boot

Posted by Mladen Turk <ml...@gmail.com>.
Markus Schönhaber wrote:
> Ilja S. wrote:
> 
> If you want to speed things up, you may move the mouse like crazy while
> Tomcat is starting, hack on the keyboard like even crazier or compile
> APR with
> --with-devrandom=/dev/urandom
> as an option to configure.
>

Or one can simply create a $HOME/.rnd file by himself
with 'openssl rand -out $HOME/.rnd 2048'

If you don't like the .rnd as file name you can set
the RANDFILE environment variable pointing to some
other random data file.

Regards,
Mladen.

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


Re: APR with tomcat - long boot

Posted by Markus Schönhaber <ma...@schoenhaber.de>.
Ilja S. wrote:

> I don't know exactly what random source is used by APR, it was compiled 
> with only one switch " --with-apr". Is this possible to find out?

What you compiled (configured) using --with-apr is propably not APR but
rather the Tomcat Native Library (libtcnative-1.so) which uses the APR
installation you pointed the configure script to with the above switch.
What I was talking about is the configuration of the configure script
for APR itself.

> I use tomcat with apache 2.2x and mod_jk.
> The only connectors I have in server xml is:
> ------------------------
>  <Connector
>         port="8080"
>         redirectPort="8443"
>         minSpareThreads="25"
>         connectionTimeout="20000"
>         maxSpareThreads="75"
>         maxThreads="150">
>     </Connector>
> 
>     <Connector
>         port="8009"
>         redirectPort="8443"
>         protocol="AJP/1.3">
>     </Connector>
> ------------------------------
> The ssl is configured on one virtual host in apache.
> 
> I'm a little bit confused about connectors anyway.
> My understanding is that if page request is on port 8080, then "http" 
> connector (first in config above) comes in play and page is served by 
> tomcat directly.
> If request is on port 80 and we have configured this virtual host with 
> JkMount directives then page is somehow passed by mod_jk to AJP 
> connector (I think in workers.properties file we say that it should be 
> AJP). Is that right?

Yes.

> Also I wonder do I need to enable APR at all if tomcat is running with 
> apache and mod_jk?

Tomcat works fine without APR. Therefore the is no *necessity* to use
APR if you want to use Tomcat. APR is simply supposed to improve
performance (moreover with APR you can use OpenSSL certificates with
Tomcat's HTTPS Connector instead of the Java keystore).

Anyway: since you've not configured an HTTPS Connector in Tomcat, I
don't really have an explanation for the slow startup.

Regards
   mks




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


Re: APR with tomcat - long boot

Posted by "Ilja S." <il...@frontdesk.ee>.
Hi
Thanks for reply!
I don't know exactly what random source is used by APR, it was compiled 
with only one switch " --with-apr". Is this possible to find out?
I use tomcat with apache 2.2x and mod_jk.
The only connectors I have in server xml is:
------------------------
  <Connector
         port="8080"
         redirectPort="8443"
         minSpareThreads="25"
         connectionTimeout="20000"
         maxSpareThreads="75"
         maxThreads="150">
     </Connector>

     <Connector
         port="8009"
         redirectPort="8443"
         protocol="AJP/1.3">
     </Connector>
------------------------------
The ssl is configured on one virtual host in apache.

I'm a little bit confused about connectors anyway.
My understanding is that if page request is on port 8080, then "http" 
connector (first in config above) comes in play and page is served by 
tomcat directly.
If request is on port 80 and we have configured this virtual host with 
JkMount directives then page is somehow passed by mod_jk to AJP 
connector (I think in workers.properties file we say that it should be 
AJP). Is that right?
Also I wonder do I need to enable APR at all if tomcat is running with 
apache and mod_jk?
Clarification would be very appreciated!
Thanks in advance..

*************************************
Best Regards
Ilja


Markus Schönhaber wrote:
> Ilja S. wrote:
> 
>> Startup time of tomcat became very slow after installing APR.
>> Tomcat version is 5.5.23
>> APR 1.2.7
>> Ubuntu, kernel 2.6.20
>> Logs says INFO: Server startup in 192631 ms
>> Which is more 3 minutes! Is that normal?
> 
> This may be normal if you have configured a HTTPS connector and your APR
> uses /dev/random as random source. /dev/random will block if there's not
> enough entropy available.
> If you want to speed things up, you may move the mouse like crazy while
> Tomcat is starting, hack on the keyboard like even crazier or compile
> APR with
> --with-devrandom=/dev/urandom
> as an option to configure.
> 
> Regards
>   mks
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 


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


Re: APR with tomcat - long boot

Posted by Markus Schönhaber <ma...@schoenhaber.de>.
Ilja S. wrote:

> Startup time of tomcat became very slow after installing APR.
> Tomcat version is 5.5.23
> APR 1.2.7
> Ubuntu, kernel 2.6.20
> Logs says INFO: Server startup in 192631 ms
> Which is more 3 minutes! Is that normal?

This may be normal if you have configured a HTTPS connector and your APR
uses /dev/random as random source. /dev/random will block if there's not
enough entropy available.
If you want to speed things up, you may move the mouse like crazy while
Tomcat is starting, hack on the keyboard like even crazier or compile
APR with
--with-devrandom=/dev/urandom
as an option to configure.

Regards
  mks


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