The resurrection of atari-wiki.com

Latest Atari related news.
User avatar
exxos
Site Admin
Site Admin
Posts: 23151
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: The resurrection of atari-wiki.com

Post by exxos »

stephen_usher wrote: Fri Nov 17, 2023 4:38 pm MySQL does seem highly inefficient when it comes to deleting or many table operations.
I do read on Google others seem to be having similar problems. But I don't really get why it was going like 50 a second before and has dropped to like 1 every 20 seconds now. The only thing which has changed is the table I am working on. It has the usual 5.5million rows, but so did the text database.

I ran some disk i/o stats and basically no disk access at all. Server has 6GB free RAM.
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
exxos
Site Admin
Site Admin
Posts: 23151
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: The resurrection of atari-wiki.com

Post by exxos »

My A.I. friend wrote a script to calculate how long it would take to process all rows in the revision database ...
Start Count: 5525914
End Count: 5525910
Rows Changed: -4
Likely time to process all rows:
Hours: -23024.641666667
Days: -959.36006944444
So this poses somewhat of a small problem :lol: :roll:

I suppose in the future would be awesome when we have proper AI driven robots. I can just say to the AI robot, go solder all these circuit boards up and just leave it to it :lol:

EDIT:

I did a longer text over 10mins and looks better but still way to long.
Start Count: 5525901
End Count: 5525863
Rows Changed: -38
Likely time to process all rows:
Hours: -2423
Days: -100
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
chronicthehedgehog
Posts: 174
Joined: Sun May 08, 2022 6:11 pm
Location: The Midlands
Contact:

Re: The resurrection of atari-wiki.com

Post by chronicthehedgehog »

Is there an index on rev_text_id?

If it's having to do a full table scan each time that would slow it down. Can you generate an execution plan or similar? Might show what's holding it up

I only do SQL Server so not sure about MySQL. I assume it's ballpark similar under the hood

EDIT

Or maybe updating the index(es) is slowing it down??
User avatar
exxos
Site Admin
Site Admin
Posts: 23151
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: The resurrection of atari-wiki.com

Post by exxos »

chronicthehedgehog wrote: Fri Nov 17, 2023 6:30 pm Is there an index on rev_text_id?
Not sure, this is what the dump between text and revision database. I don't think they have indexes.

text.PNG
text.PNG (164.1 KiB) Viewed 111 times
revision.PNG
revision.PNG (195.84 KiB) Viewed 111 times
If it's having to do a full table scan each time that would slow it down. Can you generate an execution plan or similar? Might show what's holding it up
Possibly but why only slow down during deleting ? And why was it faster running on the text database but not the revision one?

If I run the script without the delete line, it completes within a couple of minutes.

It's really quite baffling.
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
chronicthehedgehog
Posts: 174
Joined: Sun May 08, 2022 6:11 pm
Location: The Midlands
Contact:

Re: The resurrection of atari-wiki.com

Post by chronicthehedgehog »

exxos wrote: Fri Nov 17, 2023 6:35 pm If I run the script without the delete line, it completes within a couple of minutes.

It's really quite baffling.
It could be the cost of updating the indexes.
Sometimes it's worth disabling them and recreating them afterwards for a big job - but only if you've got the means/scripts to recreate them
User avatar
exxos
Site Admin
Site Admin
Posts: 23151
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: The resurrection of atari-wiki.com

Post by exxos »

chronicthehedgehog wrote: Fri Nov 17, 2023 6:43 pm It could be the cost of updating the indexes.
Possibly but again why did this not happen with the text database.
Sometimes it's worth disabling them and recreating them for a big job - but only if you've got the means/scripts to recreate them
The only possible solution I can really think is to read all the contents out and dump them in a new database. Aside from the time in writing the script it should only take a few minutes to complete the transaction. Though I'm somewhat cautious of screwing around with databases on that level.

I guess I could just turn the server off and on again :lol: There isn't much of anything else which is simple that I can really do at this point.
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
exxos
Site Admin
Site Admin
Posts: 23151
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: The resurrection of atari-wiki.com

Post by exxos »

I've since realised that the database was actually MYISAM. So I converted the revision table to INNODB instead. Though I started the execution in phpmyadmin, and it logged me out. So i'm suspect if it actually completed before the logout or it continued in the background :shrug: but anyway, the table tests fine according to the check table thingy .

So the new results...
Start Count: 5525785
End Count: 5525699
Rows Changed: -86
Likely time to process all rows:
Hours: -1070
Days: -44
Basically twice as fast now. But still going to take a incredible long time :( I'll try again the optimise and de-frag options to see if that helps any.
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
exxos
Site Admin
Site Admin
Posts: 23151
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: The resurrection of atari-wiki.com

Post by exxos »

The defrag has been running all-night and still going :roll: CPU and RAM are fine but disk io is maxed out. I benchmarked the disk and get over 600MB/sec write and double for reads. But with iotop it's only showing about 10MB/sec and almost no disk activity.

So I've emailed ramnode and asked about the problem. It seems something is amiss somewhere as the server is doing almost nothing and yet has a io bottleneck somehow.
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
troed
Moderator
Moderator
Posts: 880
Joined: Mon Aug 21, 2017 10:27 pm

Re: The resurrection of atari-wiki.com

Post by troed »

I'm going to guess it's all io_wait. I think @chronicthehedgehog is on the right track regarding indexes. I'm guessing there's some immutable lock on each update.
User avatar
exxos
Site Admin
Site Admin
Posts: 23151
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: The resurrection of atari-wiki.com

Post by exxos »

troed wrote: Sat Nov 18, 2023 3:25 pm I'm going to guess it's all io_wait. I think @chronicthehedgehog is on the right track regarding indexes. I'm guessing there's some immutable lock on each update.
But how to solve it ? And why the revision tables does it and not the text database. :shrug:
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
Post Reply

Return to “NEWS & ANNOUNCEMENTS”