All of lore.kernel.org
 help / color / mirror / Atom feed
* [Performance] Improvement on DB Performance
@ 2014-05-21 10:15 Haomai Wang
  2014-05-21 10:21 ` Haomai Wang
  0 siblings, 1 reply; 13+ messages in thread
From: Haomai Wang @ 2014-05-21 10:15 UTC (permalink / raw)
  To: ceph-devel@vger.kernel.org

Hi all,

I remember there exists discuss about DB(mysql) performance on rbd.
Recently I test mysql-bench with rbd and found awful performance. So I
dive into it and find that main cause is "flush" request from guest.
As we know, applications such as mysql, ceph has own journal for
durable and journal usually send sync&direct io. If fs barrier is on,
each sync io operation make kernel issue "sync"(barrier) request to
block device. Here, qemu will call "rbd_aio_flush" to apply.

Via systemtap, I found a amazing thing:
aio_flush                          sum: 4177085    avg: 24145  count:
173      max: 28172  min: 22747
flush_set                          sum: 4172116    avg: 24116  count:
173      max: 28034  min: 22733
flush                              sum: 3029910    avg: 4      count:
670477   max: 1893   min: 3

This statistic info is gathered in 5s. Most of consuming time is on
"ObjectCacher::flush". What's more, with time increasing, the flush
count will be increasing.

After view source, I find the root cause is "ObjectCacher::flush_set",
it will iterator the "object_set" and look for dirty buffer. And
"object_set"  contains all objects ever opened.  For example:

2014-05-21 18:01:37.959013 7f785c7c6700  0 objectcacher flush_set
total: 5919 flushed: 5
2014-05-21 18:01:37.999698 7f785c7c6700  0 objectcacher flush_set
total: 5919 flushed: 5
2014-05-21 18:01:38.038405 7f785c7c6700  0 objectcacher flush_set
total: 5920 flushed: 5
2014-05-21 18:01:38.080118 7f785c7c6700  0 objectcacher flush_set
total: 5920 flushed: 5
2014-05-21 18:01:38.119792 7f785c7c6700  0 objectcacher flush_set
total: 5921 flushed: 5
2014-05-21 18:01:38.162004 7f785c7c6700  0 objectcacher flush_set
total: 5922 flushed: 5
2014-05-21 18:01:38.202755 7f785c7c6700  0 objectcacher flush_set
total: 5923 flushed: 5
2014-05-21 18:01:38.243880 7f785c7c6700  0 objectcacher flush_set
total: 5923 flushed: 5
2014-05-21 18:01:38.284399 7f785c7c6700  0 objectcacher flush_set
total: 5923 flushed: 5

These logs record the iteration info, the loop will check 5920 objects
but only 5 objects are dirty.

So I think the solution is make "ObjectCacher::flush_set" only
iterator the objects which is dirty.

-- 
Best Regards,

Wheat

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-05-26 13:57 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-21 10:15 [Performance] Improvement on DB Performance Haomai Wang
2014-05-21 10:21 ` Haomai Wang
2014-05-21 12:00   ` Luke Jing Yuan
2014-05-21 12:12     ` Haomai Wang
2014-05-21 15:06       ` Mark Nelson
2014-05-21 15:23   ` Sage Weil
2014-05-21 15:50     ` Mike Dawson
2014-05-21 15:53       ` Mark Nelson
2014-05-21 16:15       ` Sage Weil
     [not found]         ` <77004F70-7FE7-4EBE-A34D-46A8DC290936@profihost.ag>
2014-05-21 18:41           ` Sage Weil
2014-05-21 18:51             ` Stefan Priebe - Profihost AG
2014-05-21 20:05               ` Stefan Priebe
2014-05-26 13:57     ` Haomai Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.