You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Gerry Duhig <ge...@nectar.demon.co.uk> on 2001/11/13 19:02:52 UTC

cryptography - slow starting????

Hi!

I have successfully built a servlet that uses JCE to encrypt data and deployed it under JBoss Tomcat 2.4.1-3.2.2.

The very first access is VERY slow as the cryptography classes do some sort of initialisation. I don't know what.

Subsequent actions seem very quick. 

Is this to be expected? Can I speed it up? Can I get this initialisation to take place at start-up before a user accesses the servlet?

Gerry


Re: cryptography - slow starting????

Posted by Gerry Duhig <ge...@nectar.demon.co.uk>.
Brilliant - thank you!
----- Original Message -----
From: "Bo Xu" <bo...@cybershop.ca>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, November 13, 2001 8:23 PM
Subject: Re: cryptography - slow starting????


> ----- Original Message -----
> From: "Gerry Duhig" <ge...@nectar.demon.co.uk>
> To: "Tomcat Users List" <to...@jakarta.apache.org>; "David Wall"
> <dw...@Yozons.com>
> Sent: Tuesday, November 13, 2001 1:36 PM
> Subject: Re: cryptography - slow starting????
>
>
> > I guessed as much! How do I force it to happen at startup?
> >
> > Gerry
> >[...]
>
>
> you can put the initialization of cryptography classes in the init(...)
> method of YourServlet, and in the "Servlet-declarition" of
> YourServlet in webapps/yourapp0/WEB-INF/web.xml, you can
> add something like the following:
>         <load-on-startup>1</load-on-startup>
>
> it will ask the container to initialize that "Servlet-declarition" of
> YourServlet
> at the starting-period of container.
>
> you also can use "random seed" to seach in:
> http://www.mail-archive.com/tomcat-user@jakarta.apache.org/
>
>
> haha :-)
> Bo
> Nov.13, 2001
>
>
>
>
> > ----- Original Message -----
> > From: "David Wall" <dw...@Yozons.com>
> > To: "Tomcat Users List" <to...@jakarta.apache.org>
> > Sent: Tuesday, November 13, 2001 6:08 PM
> > Subject: Re: cryptography - slow starting????
> >
> >
> > > It's the SecureRandom initialization.  You could just force such an
> > > initialization at startup so that startup has a bit of a slowdown, but
> > then
> > > it runs fast the rest of the time.
> > >
> > > David
> > >
> > >
> > > ----- Original Message -----
> > > From: "Gerry Duhig" <ge...@nectar.demon.co.uk>
> > > To: <to...@jakarta.apache.org>
> > > Sent: Tuesday, November 13, 2001 10:02 AM
> > > Subject: cryptography - slow starting????
> > >
> > >
> > > Hi!
> > >
> > > I have successfully built a servlet that uses JCE to encrypt data and
> > > deployed it under JBoss Tomcat 2.4.1-3.2.2.
> > >
> > > The very first access is VERY slow as the cryptography classes do some
> > sort
> > > of initialisation. I don't know what.
> > >
> > > Subsequent actions seem very quick.
> > >
> > > Is this to be expected? Can I speed it up? Can I get this
initialisation
> > to
> > > take place at start-up before a user accesses the servlet?
> > >
> > > Gerry
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe:   <ma...@jakarta.apache.org>
> > > For additional commands: <ma...@jakarta.apache.org>
> > > Troubles with the list: <ma...@jakarta.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
> >
> >
>
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: cryptography - slow starting????

Posted by Bo Xu <bo...@cybershop.ca>.
----- Original Message -----
From: "Gerry Duhig" <ge...@nectar.demon.co.uk>
To: "Tomcat Users List" <to...@jakarta.apache.org>; "David Wall"
<dw...@Yozons.com>
Sent: Tuesday, November 13, 2001 1:36 PM
Subject: Re: cryptography - slow starting????


> I guessed as much! How do I force it to happen at startup?
>
> Gerry
>[...]


you can put the initialization of cryptography classes in the init(...)
method of YourServlet, and in the "Servlet-declarition" of
YourServlet in webapps/yourapp0/WEB-INF/web.xml, you can
add something like the following:
        <load-on-startup>1</load-on-startup>

it will ask the container to initialize that "Servlet-declarition" of
YourServlet
at the starting-period of container.

you also can use "random seed" to seach in:
http://www.mail-archive.com/tomcat-user@jakarta.apache.org/


haha :-)
Bo
Nov.13, 2001




> ----- Original Message -----
> From: "David Wall" <dw...@Yozons.com>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Tuesday, November 13, 2001 6:08 PM
> Subject: Re: cryptography - slow starting????
>
>
> > It's the SecureRandom initialization.  You could just force such an
> > initialization at startup so that startup has a bit of a slowdown, but
> then
> > it runs fast the rest of the time.
> >
> > David
> >
> >
> > ----- Original Message -----
> > From: "Gerry Duhig" <ge...@nectar.demon.co.uk>
> > To: <to...@jakarta.apache.org>
> > Sent: Tuesday, November 13, 2001 10:02 AM
> > Subject: cryptography - slow starting????
> >
> >
> > Hi!
> >
> > I have successfully built a servlet that uses JCE to encrypt data and
> > deployed it under JBoss Tomcat 2.4.1-3.2.2.
> >
> > The very first access is VERY slow as the cryptography classes do some
> sort
> > of initialisation. I don't know what.
> >
> > Subsequent actions seem very quick.
> >
> > Is this to be expected? Can I speed it up? Can I get this initialisation
> to
> > take place at start-up before a user accesses the servlet?
> >
> > Gerry
> >
> >
> >
> >
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: cryptography - slow starting????

Posted by Matt Egyhazy <mw...@virginia.edu>.
make an initialization servlet that gets loaded when your application starts
up and make it use whatever methods are needed to start the JCE.

matt
----- Original Message -----
From: "Gerry Duhig" <ge...@nectar.demon.co.uk>
To: "Tomcat Users List" <to...@jakarta.apache.org>; "David Wall"
<dw...@yozons.com>
Sent: Tuesday, November 13, 2001 1:36 PM
Subject: Re: cryptography - slow starting????


> I guessed as much! How do I force it to happen at startup?
>
> Gerry
>
> ----- Original Message -----
> From: "David Wall" <dw...@Yozons.com>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Tuesday, November 13, 2001 6:08 PM
> Subject: Re: cryptography - slow starting????
>
>
> > It's the SecureRandom initialization.  You could just force such an
> > initialization at startup so that startup has a bit of a slowdown, but
> then
> > it runs fast the rest of the time.
> >
> > David
> >
> >
> > ----- Original Message -----
> > From: "Gerry Duhig" <ge...@nectar.demon.co.uk>
> > To: <to...@jakarta.apache.org>
> > Sent: Tuesday, November 13, 2001 10:02 AM
> > Subject: cryptography - slow starting????
> >
> >
> > Hi!
> >
> > I have successfully built a servlet that uses JCE to encrypt data and
> > deployed it under JBoss Tomcat 2.4.1-3.2.2.
> >
> > The very first access is VERY slow as the cryptography classes do some
> sort
> > of initialisation. I don't know what.
> >
> > Subsequent actions seem very quick.
> >
> > Is this to be expected? Can I speed it up? Can I get this initialisation
> to
> > take place at start-up before a user accesses the servlet?
> >
> > Gerry
> >
> >
> >
> >
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: cryptography - slow starting????

Posted by Gerry Duhig <ge...@nectar.demon.co.uk>.
I guessed as much! How do I force it to happen at startup?

Gerry

----- Original Message -----
From: "David Wall" <dw...@Yozons.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, November 13, 2001 6:08 PM
Subject: Re: cryptography - slow starting????


> It's the SecureRandom initialization.  You could just force such an
> initialization at startup so that startup has a bit of a slowdown, but
then
> it runs fast the rest of the time.
>
> David
>
>
> ----- Original Message -----
> From: "Gerry Duhig" <ge...@nectar.demon.co.uk>
> To: <to...@jakarta.apache.org>
> Sent: Tuesday, November 13, 2001 10:02 AM
> Subject: cryptography - slow starting????
>
>
> Hi!
>
> I have successfully built a servlet that uses JCE to encrypt data and
> deployed it under JBoss Tomcat 2.4.1-3.2.2.
>
> The very first access is VERY slow as the cryptography classes do some
sort
> of initialisation. I don't know what.
>
> Subsequent actions seem very quick.
>
> Is this to be expected? Can I speed it up? Can I get this initialisation
to
> take place at start-up before a user accesses the servlet?
>
> Gerry
>
>
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: cryptography - slow starting????

Posted by David Wall <dw...@Yozons.com>.
It's the SecureRandom initialization.  You could just force such an
initialization at startup so that startup has a bit of a slowdown, but then
it runs fast the rest of the time.

David


----- Original Message -----
From: "Gerry Duhig" <ge...@nectar.demon.co.uk>
To: <to...@jakarta.apache.org>
Sent: Tuesday, November 13, 2001 10:02 AM
Subject: cryptography - slow starting????


Hi!

I have successfully built a servlet that uses JCE to encrypt data and
deployed it under JBoss Tomcat 2.4.1-3.2.2.

The very first access is VERY slow as the cryptography classes do some sort
of initialisation. I don't know what.

Subsequent actions seem very quick.

Is this to be expected? Can I speed it up? Can I get this initialisation to
take place at start-up before a user accesses the servlet?

Gerry




--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: cryptography - slow starting????

Posted by Martin van den Bemt <ma...@isallineed.org>.
It think that tomcat is slow on first use. It's a ranodimizer of some sort,
that get's initialized when first calling a servlet.

Mvgr,
Martin

> -----Original Message-----
> From: Gerry Duhig [mailto:gerryd@nectar.demon.co.uk]
> Sent: Tuesday, November 13, 2001 7:03 PM
> To: tomcat-user@jakarta.apache.org
> Subject: cryptography - slow starting????
>
>
> Hi!
>
> I have successfully built a servlet that uses JCE to encrypt data
> and deployed it under JBoss Tomcat 2.4.1-3.2.2.
>
> The very first access is VERY slow as the cryptography classes do
> some sort of initialisation. I don't know what.
>
> Subsequent actions seem very quick.
>
> Is this to be expected? Can I speed it up? Can I get this
> initialisation to take place at start-up before a user accesses
> the servlet?
>
> Gerry
>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>