Re: Does Tomcat scan static file directories on startup? If so, how does one prevent it?

2017-09-07 Thread Guang Chao
On Wed, Sep 6, 2017 at 4:11 AM, Meta Schemer  wrote:

> We're using Apache Tomcat/7.0.64 and have recently switched to using a
> cloud-based file system for our static assets (which consists of millions
> of files). The problem we now face is that the startup time for our app has
> now gone through the roof (many hours). File system snooping has revealed
> that Tomcat seems to be scanning the entire static assets directory at
> startup (which is exponentially slower on the cloud based file-system.)
>
> A work around that we have found is that we mount the static assets only
> after the server has started up. While this works for the moment, it is not
> an appropriate long-term solution for us.
>
> For now, this does not seem to stem from jar-scanning (i.e., turning off
> jar-scanning did not change this behavior.)
>
> So, the question is: is there a way to turn off this startup static
> file-scanning behavior?
>

Sorry if unrelated.  But what if you move the millions of static files from
the Java App, and serve it statically using httpd or nginx?



-- 
Guang 


Re: Does Tomcat scan static file directories on startup? If so, how does one prevent it?

2017-09-05 Thread Mark Thomas
On 05/09/2017 21:11, Meta Schemer wrote:
> We're using Apache Tomcat/7.0.64 and have recently switched to using a
> cloud-based file system for our static assets (which consists of millions
> of files). The problem we now face is that the startup time for our app has
> now gone through the roof (many hours). File system snooping has revealed
> that Tomcat seems to be scanning the entire static assets directory at
> startup (which is exponentially slower on the cloud based file-system.)
> 
> A work around that we have found is that we mount the static assets only
> after the server has started up. While this works for the moment, it is not
> an appropriate long-term solution for us.
> 
> For now, this does not seem to stem from jar-scanning (i.e., turning off
> jar-scanning did not change this behavior.)
> 
> So, the question is: is there a way to turn off this startup static
> file-scanning behavior?

Take a thread dump and figure out what is doing the scanning. Then you
stand a good chance of being able to disable it.

Mark


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Does Tomcat scan static file directories on startup? If so, how does one prevent it?

2017-09-05 Thread Meta Schemer
We're using Apache Tomcat/7.0.64 and have recently switched to using a
cloud-based file system for our static assets (which consists of millions
of files). The problem we now face is that the startup time for our app has
now gone through the roof (many hours). File system snooping has revealed
that Tomcat seems to be scanning the entire static assets directory at
startup (which is exponentially slower on the cloud based file-system.)

A work around that we have found is that we mount the static assets only
after the server has started up. While this works for the moment, it is not
an appropriate long-term solution for us.

For now, this does not seem to stem from jar-scanning (i.e., turning off
jar-scanning did not change this behavior.)

So, the question is: is there a way to turn off this startup static
file-scanning behavior?