Date: Fri, 29 Mar 2024 02:11:55 -0400 (EDT) Message-ID: <1126852201.29846.1711692715430@lyrasis1-roc-mp1> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_29845_882829608.1711692715429" ------=_Part_29845_882829608.1711692715429 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
This page describes how to speed up execution of DSpace command-= line scripts (class launcher) using Nailgun by <= span>Martian Software, Inc.
The reason why even the simplest DSpace command-line scripts usuall= y take several seconds to run is because the Java class launcher has to cre= ate a new JVM instance every time it's run. Nailgun has a client/server arc= hitecture and implements a very lightweight JVM in the server part, which k= eeps running as a service and therefore doesn't have to be started up every= time. You then use the command line nailgun client (ng) to connect to it t= o launch a class, which is considerably faster than starting up the JVM.
Download and build the nailgun client and server (this assumes that = dspace is installed in /dspace, that you have gcc installed and that you ca= n run binaries from ~/bin):
git clo= ne git://github.com/martylamb/nailgun.git cd nailgun mvn clean install cp nailgun-server/target/nailgun-server-0.9.2-SNAPSHOT.jar /dspace/lib/ cp nailgun-server/target/nailgun-server-0.9.2-SNAPSHOT.jar /dspace/webapps/= xmlui/WEB-INF/lib/ cd nailgun-client gcc ng.c -o ng cp ng ~/bin # exit your shell and launch it again
Start the nailgun server and add DSpace to its classpath:
java -c= lasspath /dspace/lib/nailgun-server-0.9.2-SNAPSHOT.jar com.martiansoftware.= nailgun.NGServer & ng ng-cp /dspace/lib/*.jar /dspace/config ng ng-alias dspace org.dspace.app.launcher.ScriptLauncher
Run the client:
# inste= ad of this: /dspace/bin/dspace # use this: ng dspace # Example. Instead of=20 /dspace/bin/dspace update-discovery-index # use this ng dspace update-discovery-index
After you're finished running multiple invocations of the DSpace com= mand-line scripts, you can stop the Nailgun server:
ng ng-s= top