High CPU usage and http error 500

After upgrading from 3.3.0.13 to 3.4.0.4, my website is particularly slow to access and is almost difficult to open when opening specific article detail pages. And occasionally this message appears: http error 500. After contacting the server hosting provider’s technicians, they told me the following reasons for the slow access. What can I do about it?

Query_time: 3.388929 Lock_time: 0.000003 Rows_sent: 22 Rows_examined: 1942746

use drpresso_ojs205;
SET timestamp=1702348013;
SELECT
o.submission_id,
MAX(s.context_id) AS journal_id,
MAX(i.date_published) AS i_pub,
MAX(p.date_published) AS s_pub,
COUNT(*) AS count
FROM
submissions s
JOIN publications p ON (p.publication_id = s.current_publication_id)
JOIN publication_settings ps ON (ps.publication_id = p.publication_id AND ps.setting_name=‘issueId’ AND ps.locale=‘’)
JOIN issues i ON (CAST(i.issue_id AS CHAR(20)) = ps.setting_value AND i.journal_id = s.context_id)
JOIN submission_search_objects o ON (s.submission_id = o.submission_id)
NATURAL JOIN submission_search_object_keywords o0 NATURAL JOIN submission_search_keyword_list k0
WHERE
s.status = 3 AND
i.published = 1 AND k0.keyword_text = ‘services’ AND i.journal_id = 6
GROUP BY o.submission_id
ORDER BY count DESC
LIMIT 500;

And the Server Information

|Setting Name|Setting Value|
|OS platform|Linux|
|PHP version|8.2.13|
|Apache version|LiteSpeed|
|Database driver|mysql|
|Database server version|8.0.35-cll-lve|

Hi @LucyDRP,

This query is caused by requests for search results in OJS. I’d suggest reviewing your access log for requests to the search endpoint, to see if there is a large amount of volume there e.g. coming from search engines. It might be possible to ask them to throttle their requests using a robots.txt file; see e.g.:

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

This topic was automatically closed after 10 days. New replies are no longer allowed.