Ubooquity scan slow ... how to improve

I don’t have any issue with DietPi or the setup of Ubooquity.
I decided to move it from my NAS to the RPI4 who is running DietPi
If the setup was easy, I discovered that the scan speed is slow ( but really slow like 1 comics per minutes)
Yes the data are stored on the NAS but it’s on the same network.

Anyone found how to improve the speed?
I found on that increasing the memory can help ( java.lang.OutOfMemoryError: Java heap space - Ubooquity - #4 by nikos73) but I don’t get how to change the value and find what is the current one …

I’m not sure if this is caused by the java heap space, but you can try and enlarge it.
How much RAM does you RPi 4 have?
To do this you have to edit the service itself. You can do this with dietpi-software, choose “ubooquity” there and then go to

Edit    : [/etc/systemd/system/ubooquity.service]   

There is a line:

#ExecStart=/usr/bin/java -Xmx754m -jar /mnt/dietpi_userdata/ubooquity/Ubooquity.jar --headless --remoteadmin --adminport 2038 --library>

Remove the # and change the 754m to something higher then now but fewer than your actual RAM size.
After this, add a line ExecStart= above the line you edited, it should look like:

ExecStart=
ExecStart=/usr/bin/java -Xmx2048m -jar /mnt/dietpi_userdata/ubooquity/Ubooquity.jar --headless --remoteadmin --adminport 2038 --library>

(in this example I use 2GB (2048MB) max heap size.)
Save this file with ctrl+o, enter/return, ctrl+x
When you are back in the service control menu, choose the first entry State and hit Enter two times to restart (first enter is for stop)

If you want to undo this change you can do this form CLI:

rm /etc/systemd/system/ubooquity.service.d/dietpi-services_edit.conf 
systemctl daemon-reload                                     
systemctl restart ubooquity 

Thanks for the detailed solution,
When I edited the file, I had:
#ExecStart=/usr/bin/java -Xmx384m -jar /mnt/dietpi_userdata/ubooquity/Ubooquity.jar --headless --remoteadmin --adminport 2038 --library

so I remove the # and set it to 754m … saved, stop,… and no restart it automatically failed …
if I put back the # … all is restarting correctly … not sure what is wrong…

Did you added an empty ExecStart= before the line you modified?

Yeea you need one empty ExecStart= and a second one with the actual parameters. Like

ExecStart=
ExecStart=/usr/bin/java -Xmx2048m -jar /mnt/dietpi_userdata/ubooquity/Ubooquity.jar --headless --remoteadmin --adminport 2038 --library>

of course not … and it was clear on your message …
I moved to 1024 to see if it will improve the situation

Thanks

Scan is a little bit faster but not as the same level of the NAS, reading is impossible … took almost a minute to read a page… I will give a try with a local USB storage to see if the CIFS share could be the issue or not…

yeah, running it on remote storage could be an issue. Would be quite interesting to see how it behave on local storage.