Last modified: 2014-06-17 07:40:58 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T50851, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48851 - Database inserts are slow at the replicated databases
Database inserts are slow at the replicated databases
Status: RESOLVED FIXED
Product: Wikimedia Labs
Classification: Unclassified
tools (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Marc A. Pelletier
:
Depends on: 55929
Blocks: labs-replication
  Show dependency treegraph
 
Reported: 2013-05-27 10:02 UTC by Maarten Dammers
Modified: 2014-06-17 07:40 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Maarten Dammers 2013-05-27 10:02:01 UTC
This weekend I played around with the databases on Toollabs. I'm using the commonswiki.labsdb server. I compared the speed with the Toolserver databases.

SELECTs on commonswiki_p are very fast. I created a databases p50380g50518__heritage_p on this server. INSERTs seem to be very slow and sometimes seem to get stuck. I think some performance tuning needs to happen here. The program I'm using tries to do about 1.000.000 inserts. The whole program takes about an hour to complete on the Toolserver (when I last checked), on labs it's several times slower.

Ps. Now is probably a good time to add a database component.
Comment 1 Maarten Dammers 2013-06-05 12:02:45 UTC
Is anyone working on this? This blocks us from setting up the monuments database at toollabs.
Comment 2 Marc A. Pelletier 2013-06-05 12:49:13 UTC
Looking into it.
Comment 3 Maarten Dammers 2013-06-30 19:57:47 UTC
Any news?
Comment 4 Marc A. Pelletier 2013-07-05 20:00:18 UTC
The issue is known, and a fix is forthcoming shortly (basically, user databases will be moved to a different filesystem)
Comment 5 Yuvi Panda 2013-07-05 21:04:53 UTC
Apparently this will be fixed when the database is migrated to run on a native filesystem in a week or so, which should apparently fix this issue.
Comment 6 Asher Feldman 2013-07-05 21:34:42 UTC
I noticed that the tables in p50380g50518__heritage_p were all myisam.  No effort had been made to tune for myisam performance.  I just increased the bulk_insert_buffer_size and key_buffer_size which should be relevant to your workload.  Can you report on any improvement? 

(In reply to comment #0)
> This weekend I played around with the databases on Toollabs. I'm using the
> commonswiki.labsdb server. I compared the speed with the Toolserver
> databases.
> 
> SELECTs on commonswiki_p are very fast. I created a databases
> p50380g50518__heritage_p on this server. INSERTs seem to be very slow and
> sometimes seem to get stuck. I think some performance tuning needs to happen
> here. The program I'm using tries to do about 1.000.000 inserts. The whole
> program takes about an hour to complete on the Toolserver (when I last
> checked), on labs it's several times slower.
> 
> Ps. Now is probably a good time to add a database component.
Comment 7 Maarten Dammers 2013-08-25 17:50:44 UTC
I fired up the program that harvests all the tables. Takes about an hour to complete on the toolserver (maybe two).

It crashed at some point because I forgot to create a table, these are the times:

real    265m22.993s
user    11m30.679s
sys     1m4.912s

That's much slower than the Toolserver.

After three months nothing changed. I'm going to stop wasting time on this.
Comment 8 Maarten Dammers 2013-08-25 17:57:46 UTC
Oh, it uses MyISAM because that's the default engine and it supports full text search (something I don't believe InnoDB supports)
Comment 9 Maarten Dammers 2013-08-25 21:32:08 UTC
Marc suggested I used commonswiki.labsdb, switched to tools-db and that one is much faster. Changed the subject to reflect that.
Comment 10 Yuvi Panda 2013-09-03 00:00:51 UTC
Adding a note: apparently the replica databases are on a different data center than toollabs, with a ping time of 26ms. This probably explains the slow inserts, if they were not batched.
Comment 11 Maarten Dammers 2013-09-03 17:06:01 UTC
26ms? Wow, can you get coffee on the way back?
Comment 12 Yuvi Panda 2014-06-17 07:40:58 UTC
Should be fixed now, since everything is in eqiad. Do re-open if this still exists.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links