Most Popular Articles Plugin | Developing a caching feature

Hello,

I use this plugin and I’m trying to use cache, like in ALM, but I don’t know how to use this feature.
I know alm plugin uses cache, I looked inside the code and it’s not that complicated, I guess.
Is there some guide ou how to use the OJS cache feature?

Best regards,
Tarcisio Pereira

Hi @Tarcisio_Pereira,

What is your goal? Are you experiencing slow performance with that plugin?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

Yeah! I have a huge traffic in my installation. Huge I/O.
Sometimes just 10-15 connections, sometimes 100-130 connections.

When I enabled this plugin, my DB goes almost down.
Because of that I’m studing how to use the OJS cache like ALM does.

Regards,
Tarcisio Pereira.

Hi @Tarcisio_Pereira,

Looks like that’s using the metrics framework to fetch articles, so I’ll tag @beghelli in case he can write up a quick summary.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you.
I will wait for it.

Tarcisio Pereira.

Hi @Tarcisio_Pereira,

Before trying the cache, can you try adding a new index into the metric table? I think it should speed up things quite a bit. We didn’t included that by default, but you can add an index using the metric_type, context_id and assoc_type columns into the metrics table.

You can do that using this query:

CREATE INDEX metrics_metric_type_context_id_assoc_type ON metrics (metric_type, context_id, assoc_type);

I will add this index creation into the xml metrics table description, so next release will already have it.

If you create this index and the plugin is still not working good, then we can think about using cache. Just let me know.

Thanks,
Bruno

Bruno,

I did it, I’m waiting some feedback from users.

Grateful.