high cpu usage

80 views
Skip to first unread message

Paul Warner

unread,
Dec 4, 2018, 5:02:37 AM12/4/18
to DSpace Community

We just solved a problem with our dspace tomcat instance running with very high cpu usage, swinging up to 100% and more every few seconds and then briefly down again. This occurred all day long and all night long, whether the server was performing any work or not. We are running tomcat 8 with java 8, and dspace 6.3.


This is really a tomcat problem, and I posted this in stackoverflow for the tomcat users.  But since we are dspace users too, and others might have this problem, I am posting it here as well, in the hopes of helping someone.  We did not find our solution in a web search.


We had used the configuration option in the tomcat/conf/Catalina/localhost directory, in which we pointed tomcat to another directory, other than its own webapps directory. The xml files in this directory look like this:


    <?xml version='1.0'?>
    <Context
    docBase="/opt/dspace/amaddev/dspace-6.3/webapps/jspui"
    reloadable="true"
    cachingAllowed="false"/>


And this worked, tomcat ran with the code in the dspace directories rather than its own webapps directory. However, we had this problem with continually spiking cpu usage.

To test, we removed the xml files from the conf/Catalina/localhost directory, and restarted tomcat. Suddenly we had a normal, well-behaved tomcat again. In order to point the tomcat to this other directory (where we compile our dspace code), we just used the Host entry in conf/server.xml, and changed the appBase setting to our dspace directory:


    <Host name="localhost"  appBase="/opt/dspace/amaddev/dspace-6.3/webapps"
        unpackWARs="true" autoDeploy="true">


This now accomplishes what we wanted with a very low cpu usage (below 1%) when the server is quiet.


Best,

Paul

Mark Wood

unread,
Dec 4, 2018, 10:56:14 AM12/4/18
to DSpace Community
Interesting.  We've used Contexts in the way you show, for years, in several separate instances, and not seen this behavior.

I note that Tomcat 8 doesn't define a Context attribute 'cachingAllowed' but I don't see why that would cause the reported behavior.
Reply all
Reply to author
Forward
0 new messages