Slow DB writes

Post Reply
Sanaki
Posts: 110
Joined: Wed Mar 09, 2011 1:30 am

Slow DB writes

Post by Sanaki » Thu May 12, 2011 11:07 pm

While in general I understand tables can be used for most database functions, this isn't always feasible. However, after setting up a system which appeared to work fine, I ran into an issue with major slowdown whenever I had to do multiple updates in rapid succession. I just put it into a time tester, and 10 sets in a row of "fetch, update", over twenty tests, have an execution time of 0.86 seconds at -best-, reaching as high as 1.108 seconds on the worst. From what I can tell, this is because as opposed to a standard database, this is actually doing a file write on every update. Thing is, this lag is freezing the entire client during the delay, not just causing a delay in the connection or somesuch. Is there any way to load the file into RAM and have it only updated at a set interval or somesuch? Or alternatively, is this a behavior that can be fixed in a future version of Mudlet? I'd just move it to using the database I already have running on this computer, but that effectively destroys my ability to export it to other players.

User avatar
Vadi
Posts: 4643
Joined: Sat Mar 14, 2009 3:13 pm

Re: Slow DB writes

Post by Vadi » Thu May 12, 2011 11:29 pm

It's not broken, it's your slow HDD. You can disable automatic writes to the disk, see "Transactions" section of the db manual, or get an SSD.

Sanaki
Posts: 110
Joined: Wed Mar 09, 2011 1:30 am

Re: Slow DB writes

Post by Sanaki » Thu May 12, 2011 11:50 pm

Huh. Somehow hadn't thought about using transactions that way. Much appreciated! And for the record, I'd love an SSD. It's my wallet that's being all stingy on me.

User avatar
Vadi
Posts: 4643
Joined: Sat Mar 14, 2009 3:13 pm

Re: Slow DB writes

Post by Vadi » Fri May 13, 2011 12:25 am

Same :(

Yetzederixx
Posts: 186
Joined: Sun Nov 14, 2010 5:57 am

Re: Slow DB writes

Post by Yetzederixx » Fri May 13, 2011 12:49 am

Load your database contents into a table and do your work with that if possible, that's how I do it.

Sanaki
Posts: 110
Joined: Wed Mar 09, 2011 1:30 am

Re: Slow DB writes

Post by Sanaki » Fri May 13, 2011 1:15 am

If that were reasonable, there'd be no reason for me to keep the database usage for this at all. I'd just store it in a persistent table.

Sanaki
Posts: 110
Joined: Wed Mar 09, 2011 1:30 am

Re: Slow DB writes

Post by Sanaki » Fri May 13, 2011 7:08 am

Transactions fixed the problem quite nicely, zero slowdown now. And to think I believed I wouldn't have a use for them in Mudlet.

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 2 guests