You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is overhead to have the Ruby be started up and executed within Java.
This is done for every request in which the Ruby delegate is used.
This may also open up an avenue for programming very specific use cases for TAMU in a delegate itself.
If we aren't using a custom delegate, then it may make sense to disable the Ruby Delegate and set the Java Delegate as a default to save time that is being incurred on every transform. (We are using a custom delegate.)
The delegate script is a file containing a delegate class written in Ruby. The class is instantiated per-request, early in the request cycle, and disposed of at the end of the request cycle. At various points in the request cycle, its methods are called by the application to obtain information needed to service the request.
Set delegate_script.enabled to false.
This appears to be the default, but the logs show otherwise.
(Try also looking into setting every lookup_strategy such as FilesystemSource.lookup_strategy.)
This can be replaced with a Java Delegate equivalent.
These URIs should be configurable via environment variables to be docker-compatible.
Example LOG showing Ruby Delegate usage:
16:09:17.200 [qtp1594199808-20] INFO me.i.l.c.r.i.v.ImageResource - Handling GET /iiif/2/eac40814-fa1c-357d-890d-767a0c325cb2/full/full/2/default.png
16:09:17.200 [qtp1594199808-20] DEBUG me.i.l.c.r.i.v.ImageResource - Base URI from assembled from base_uri key: https://api-dev.library.tamu.edu
16:09:17.200 [qtp1594199808-20] DEBUG me.i.l.c.d.DelegateProxyService - Instantiating a JRubyDelegateProxy
16:09:17.202 [qtp1594199808-20] DEBUG me.i.l.c.i.MetaIdentifier - [Raw path component: eac40814-fa1c-357d-890d-767a0c325cb2] -> [decoded: eac40814-fa1c-357d-890d-767a0c325cb2] -> [slashes substituted: eac40814-fa1c-357d-890d-767a0c325cb2]
16:09:17.202 [qtp1594199808-20] DEBUG me.i.l.c.i.Identifier - [Raw path component: eac40814-fa1c-357d-890d-767a0c325cb2] -> [decoded: eac40814-fa1c-357d-890d-767a0c325cb2] -> [slashes substituted: eac40814-fa1c-357d-890d-767a0c325cb2]
16:09:17.204 [qtp1594199808-20] DEBUG me.i.l.c.c.InfoService - getInfo(): retrieved from InfoCache: eac40814-fa1c-357d-890d-767a0c325cb2
16:09:17.205 [qtp1594199808-20] DEBUG me.i.l.c.c.FilesystemCache - newDerivativeImageInputStream(): hit: eac40814-fa1c-357d-890d-767a0c325cb2_1:1_rotate:2_encode:png_UNDEFINED_8_e95198c48292fa4c8fc0617e850c1f6d (/var/cache/cantaloupe/image/71/1a/df/711adff9f0b80a9ac454ae71a31275f2_d6a46df8c7b3d211956d108134f003ec.png)
16:09:17.205 [qtp1594199808-20] DEBUG me.i.l.c.r.i.v.ImageResource - Base URI from assembled from base_uri key: https://api-dev.library.tamu.edu
16:09:17.265 [qtp1594199808-20] DEBUG me.i.l.c.r.InputStreamRepresentation - Streamed from the cache without resolving in 60 msec
WARNING: I noticed that when I setup the environment variables for the Scripting Delegate in the Docker container, somehow the delegates.rb file got recreated. Whatever the configuration was got lost.
Note from the documentation:
Unlike the delegate script, a sample Java delegate is not bundled with the application.
Cantaloupe is running under Java.
There is overhead to have the Ruby be started up and executed within Java.
This is done for every request in which the Ruby delegate is used.
This may also open up an avenue for programming very specific use cases for TAMU in a delegate itself.
If we aren't using a custom delegate, then it may make sense to disable the Ruby Delegate and set the Java Delegate as a default to save time that is being incurred on every transform.(We are using a custom delegate.)Set
delegate_script.enabled
tofalse
.This appears to be the default, but the logs show otherwise.
(Try also looking into setting every
lookup_strategy
such asFilesystemSource.lookup_strategy
.)The delegate appears to be in use via:
This can be replaced with a Java Delegate equivalent.
These URIs should be configurable via environment variables to be docker-compatible.
Example LOG showing Ruby Delegate usage:
WARNING: I noticed that when I setup the environment variables for the Scripting Delegate in the Docker container, somehow the
delegates.rb
file got recreated. Whatever the configuration was got lost.Note from the documentation:
see: https://github.com/cantaloupe-project/sample-java-delegate
see: https://cantaloupe-project.github.io/manual/5.0/delegate-system.html
see: https://cantaloupe-project.github.io/manual/5.0/delegate-system.html#Java%20Delegate
see: https://cantaloupe-project.github.io/manual/5.0/delegate-system.html#Improving%20Efficiency
see: https://github.com/cantaloupe-project/cantaloupe/blob/3722b075f71eea4e2560e0c0fdc6ceb580db37ee/cantaloupe.properties.sample#L80
see: https://github.com/cantaloupe-project/cantaloupe/blob/develop/src/main/java/edu/illinois/library/cantaloupe/delegate/JRubyDelegateProxy.java
see: https://github.com/cantaloupe-project/cantaloupe/blob/develop/src/main/java/edu/illinois/library/cantaloupe/delegate/JavaDelegateProxy.java
see: https://github.com/cantaloupe-project/cantaloupe/blob/3722b075f71eea4e2560e0c0fdc6ceb580db37ee/src/main/java/edu/illinois/library/cantaloupe/source/LookupStrategy.java#L14
see: https://github.com/cantaloupe-project/cantaloupe/blob/3722b075f71eea4e2560e0c0fdc6ceb580db37ee/cantaloupe.properties.sample#L155
see: Improve Performance for Simultaneous Users and Average Response Time #3
The text was updated successfully, but these errors were encountered: