Slowness in the first access to the newly hosted site

Asked

Viewed 87 times

0

good afternoon!

I’m starting to practice my studies with Web development and when hosting and climbing a JSF site with Spring and Hibernate, the first access is very slow. Once it accesses, the manipulation is very fast.

This delay also happens after some time passed and a new access is made.

I’m thinking it might be some Tomcat configuration problem in the hosting or some parameter I’m missing in setting the environment.

Any hints, please?

  1. Context.xml

    <Resource name="jdbc/baseDB" 
        auth="Container" 
        type="javax.sql.DataSource" 
        maxTotal="100" 
        maxIdle="30" 
        maxWaitMillis="10000"  
        validationQuery="SELECT 1" 
        validationInterval="30000" 
        username="root"
        password="root"
        driverClassName="com.mysql.jdbc.Driver"
        url="jdbc:mysql://localhost:3306/base?autoReconnect=true" />
    

Evaluating the Tomcat log I think the problem is the automatic container shutdown:

INFO  org.apache.catalina.core.StandardServer- A valid shutdown command was received via the shutdown port. Stopping the Server instance.

After about 20 minutes without accessing the site, falls the message above in the Log. Hence the next access is slow again.

1 answer

1

In First access your site must be starting Hibernate, when Hibernate starts it checks the persistence.xml, checks the connection to the database , checks the tables etc, so in the first access it is slow.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.