[ 
https://jira.duraspace.org/browse/DS-1396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=26983#comment-26983
 ] 

Ian Boston commented on DS-1396:
--------------------------------

A webapp with this code as a context listener

public class SecureRandomContextListener implements ServletContextListener {

        @Override
        public void contextInitialized(ServletContextEvent sce) {
                System.err.println("Context Being initialsed, testing 
SecureRandom");
                // this should use /dev/urandom and not block
                long t = System.currentTimeMillis(); 
                SecureRandom sr = new SecureRandom();
                int i = sr.nextInt();
                long ttaken = System.currentTimeMillis()-t;
                System.err.println("Got first random "+i+" after "+ttaken+" 
ms");
                try {
                        t = System.currentTimeMillis();
                        // this will need seeding and may block
                        SecureRandom sr2 = SecureRandom.getInstance("SHA1PRNG");
                        i = sr2.nextInt();
                        ttaken = System.currentTimeMillis()-t;
                        System.err.println("Got PSHA1PRNG ran random "+i+" 
after "+ttaken+" ms");
                } catch (NoSuchAlgorithmException e) {
                        e.printStackTrace();
                }
                System.err.println("Context Initialsed");
        }

        @Override
        public void contextDestroyed(ServletContextEvent sce) {
                System.err.println("Context Being Destroyed");
        }

}


produces this output
INFO: Deploying web application directory /dspace3/webapps/test
Context Being initialsed, testing SecureRandom
Got first random 290438140 after 3 ms
Got PSHA1PRNG ran random -204657877 after 0 ms
Context Initialsed
23-Nov-2012 02:32:55 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-127.0.0.1-8080"]



However,

I have been able to reproduce pauses with another java based app on the box so 
this is not an issue with DSpace per se.

                
> Very slow startup on Linux Platforms
> ------------------------------------
>
>                 Key: DS-1396
>                 URL: https://jira.duraspace.org/browse/DS-1396
>             Project: DSpace
>          Issue Type: Bug
>    Affects Versions: 3.0
>         Environment: Linux version 2.6.32-38-server (buildd@allspice) (gcc 
> version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) ) 
> /usr/lib/jvm/java-6-sun/bin/java 
> -Djava.util.logging.config.file=/usr/local/tomcat7/conf/logging.properties 
> -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -Xms256m 
> -Xmx800m -XX:PermSize=256m -XX:NewSize=64m -server -XX:+UseConcMarkSweepGC 
> -Djava.net.preferIPv4Stack=true 
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 
> -Djava.endorsed.dirs=/usr/local/tomcat7/endorsed -classpath 
> /usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jar 
> -Dcatalina.base=/usr/local/tomcat7 -Dcatalina.home=/usr/local/tomcat7 
> -Djava.io.tmpdir=/tmp/tomcat7-tmp org.apache.catalina.startup.Bootstrap start
>            Reporter: Ian Boston
>            Priority: Critical
>
> I am experiencing extremely slow startup times for DS3-rc3 on Linux with the 
> stock sun JVM, and I have experienced total hangs 11:19-15:09 of the JVM with 
> perfect operation after the end of the period (no restart of any form was 
> required). By slow startup I mean just bringing up solr, xmlui and jspui can 
> take 60 minutes.
> I think this is due to /dev/ramdom on the OS not getting sufficient entropy, 
> probably caused by the Bouncy Castle crypto APIs or the new SecureRandom() in 
> Eperson.
> performing a 
> find / 
> as root appears to unstick the JVM on startup, pointing to an entropy issue 
> (find / will cause disk I/O not from cache generating low level device driver 
> entropy)
> Has anyone else seen these issues ?
> Is there a known fix (other than performing a find)
> I have already tried  -Djava.security.egd=file:/dev/./urandom 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Dspace-devel mailing list
Dspace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to