Hello,
We’ve been having a recurring database performance issue with batch deletion of descriptions and we’d like to get some advice on this.
As of now, we have 91,530 rows in the
information_object table and it takes about 6 minutes for executing delete-description
command which deletes a description with its 362 child descriptions (details are in the Issue #2). The AtoM version we tested is 2.5.1 and the following issues were existing from the previous versions.
Issue
#1:
Deleting description using UI (archivists use this) gets a timeout error when
the parent description has many child descriptions. I can’t specify what number
of child descriptions would/wouldn’t cause this issue because that can vary
depending on server. (Current our test database server has 4 CPUs with 16G memory. Other
database servers we tested had 8 CPUs with 16G memory or cluster database with
more capacity.)
Increasing
max_execution_limit to a certain big number (https://groups.google.com/d/msg/ica-atom-users/cwiPXeOjYYo/gfQ8AgDzAQAJ)
may prevent this problem but I’m hesitant to make this change because it could
cause a performance risk on our production infrastructure. Instead,
can `Delete` description create a job (if it has over certain number of child
descriptions) and show the job ID similarly to Import workflow instead of
waiting HTTPS response?
Issue #2:
Deleting a `Series` record which has 362 child descriptions took about 6 minutes on a single dedicated server for AtoM when I ran delete-description command on our test server. It was updating LFT and RGT columns of information_object table every time an information_object was deleted. Both UPDATE queries updated over 40,000 rows per time (multiply 362). Same test on our cluster database ran even slower and connections were piling up. As a result, all sites which used the same cluster database server got 503 error.
We think that the core problem might be that the deletion process takes so long to complete, taking almost six minutes. Could you explain to us why there are so many intensive database queries and commands executed by the deletion request … particularly these two update queries:
-----
UPDATE information_object
SET information_object.LFT = information_object.LFT
- '2'
WHERE information_object.LFT >= '100631'
UPDATE information_object
SET information_object.RGT =
information_object.RGT - '2'
WHERE information_object.RGT >= '100631'
-----
Execute time for delete-description command:
-----
$ time sudo php symfony tools:delete-description writing-6 -B
>> delete-description [08:43:55 AM] Deleting description "Writing" (slug: writing-6, +361 descendants)
>> delete-description [08:49:39 AM] Finished: 362 descriptions deleted.
real 5m44.575s
user 0m1.660s
sys 0m0.632s
-----
ANALYZE TABLE looked fine and most of the LFT and RGT rows were indexed.
-----
MariaDB [atomDiscArch]> ANALYZE TABLE information_object;
+---------------------------------+---------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+---------------------------------+---------+----------+----------+
| atomDiscArch.information_object | analyze | status | OK |
+---------------------------------+---------+----------+----------+
1 row in set (0.03 sec)
-----
Record counts for information_object.LFT >= '100631' and information_object.RGT >= '100631' before running the above delete-description command:
-----
MariaDB [atomDiscArch]> SELECT count(*) FROM information_object WHERE information_object.LFT >= '100631';
+----------+
| count(*) |
+----------+
| 41121 |
+----------+
1 row in set (0.00 sec)
MariaDB [atomDiscArch]>
MariaDB [atomDiscArch]> SELECT count(*) FROM information_object WHERE information_object.RGT >= '100631';
+----------+
| count(*) |
+----------+
| 41125 |
+----------+
1 row in set (0.02 sec)
-----
Any help would be greatly appreciated!
Sunny
--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/1fc0d283-9e29-4a24-851d-00f63a35dce3%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-ato...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/82828398-d9e8-43d6-b0aa-a12d73b8ab7an%40googlegroups.com.