OJS 2.4.8 | 3.X - OAI too slow

,

Hello,

I have a huge database. OAI requests takes too long time, 30-45 seconds.
Is there a fast way? Maybe a faster sql query or a index?

Regards,
Tarcisio Pereira.

Hi @Tarcisio_Pereira,

You’ve mentioned two versions of OJS – are you seeing performance problems in both? What version of OJS 3.x are you using?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

Yes, slow in both.
3.0.2.0.

I’m using 2.4.8 in my production server. I’m still testing 3.0.2, not production.
I will restore a 3.0.2 database dump in my server and test the speed with a real server. But it’s slow in my machine.

Regards,

Tarcisio Pereira.

Hi @Tarcisio_Pereira,

For OJS 3.0.2, you might consider trying a back-port of this change that’s already been merged into the master branch. It should considerably optimize the OAI queries.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi @asmecher

I’ve made a back-port of that change, I had a problem with PublishedArticleDAO but it’s already solved.
In 3.0.2 it’s taking 2 seconds. Amazing. Great job!
But, it’s possible do something for 2.4.8.0? It is very likely that I will still use 2.4.8 for a while.

Regards,
Tarcisio Pereira.

Hi @Tarcisio_Pereira,

That change requires the SQL UNION function, which isn’t available in all versions of e.g. MySQL that we support in OJS 2.x. I’d suggest keeping it as a local modification – but feel free to make it available for others who are interested if you think it’ll be useful!

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi @asmecher

I’ve made a back-port of that change in OJS 2.4.8.0. I had some problems with missing methods in some classes. I copied the method from OJS 3.0.2 classes.
After some name patterns problems like journal->context or article->submission I have no error in apache log. But it’s not working yet.

http://localhost/[OJS]/[JOURNAL_PATH]/oai?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai:localhost.revistas:article/13340 are resulting in:

This page contains the following errors:
error on line 1 at column 1: Document is empty
Below is a rendering of the page up to the first error.

A quick search tells me that I’m printing some no-xml-data as xml and the browser are unable to render. Something like this php - Getting Error "Below is a rendering of the page up to the first error." - Stack Overflow

Please, can you give me some light? I’ve made no changes in plugin/oaiMetadataFormats
If you can’t help me I’ll understand. The recommendation is upgrade to version 3.0.2 but my institution will still remain in 2.4.8.0 for a while.

Regards,
Tarcisio Pereira

Hi @Tarcisio_Pereira,

The OAI interface is an XML document with an XSL transformation that’s applied by the browser to turn it into a browsable XHTML interface. I suspect an error is getting jammed into your XML, or it’s otherwise gotten malformed, and the browser can’t parse it to apply the XSL. Try using “View Source” to see where it’s malformed.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi @asmecher

Thank you A LOT!
I found what was wrong, a forgotten var_dump.
Apparently it’s working now. I’ll finish testing…

Regards,
Tarcisio Pereira

Hi @Tarcisio_Pereira

could you make the patch for 2.4.8 available?

We will upgrade to OJS 3 in our biggest instance only next year and recently have had problems with huge OAI queries from the OJS 2 instance blocking the MySQL server.

Thanks and regards,

Nils Weiher

Hi @nweiher

We updated in june.
I have no longer the code that I modified.

But basically I copied the updated OAI and inserted the methods into their respective classes.
I changed the nomenclature to the old standard. For example: where was context_id I switched to journal_id, likewise switched from submissions_id to article_id.

Regards,
Tarcisio Pereira