WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

RE: [Xen-users] xen4 on debian squeeze, slow mysql in domU

thanks for quick reply..
im using lvm to create domU patitions.

domU config:
----------------------------------------------------------------
kernel      = '/boot/vmlinuz-2.6.32-5-xen-amd64'
ramdisk     = '/boot/initrd.img-2.6.32-5-xen-amd64'
vcpus       = '8'
memory      = '4096'
root        = '/dev/xvda2 ro'
disk        = [
                  'phy:/dev/Xen/mysql-data,xvda4,w',
                  'phy:/dev/Xen/mysql-boot,xvda3,w',
                  'phy:/dev/Xen/mysql-root,xvda2,w',
                  'phy:/dev/Xen/mysql-swap,xvda1,w',
              ]
name        = 'mysql'
vif         = [ 'ip=x.x.x.172,mac=00:16:3E:F5:x:x' ]

on_reboot   = 'restart'
on_crash    = 'restart'
----------------------------------------------------------------

partitions config:
----------------------------------------------------------------
[root]
size=2G
type=xfs
mountpoint=/
options=defaults

[boot]
size=200M
type=ext3
mountpoint=/boot
options=errors=remount-ro

[data]
size=16G
type=xfs
mountpoint=/data
options=noatime,logbsize=256k

[swap]
size=1G
type=swap
----------------------------------------------------------------

database is on / xfs filesystem
i make some tweaks just for testing and change mount option for / to:
noatime,nodiratime,attr2,logbufs=8,logbsize=256k

now is little bit better performance of disk but nothing change on mysql insert speed  0.13sec is the best result
performance of disk write speed on VM is much better then physical
dd if=/dev/zero of=test bs=1M count=1000

on VM: 114 MB/s, 121 MB/s, 123 MB/s
on physical server: 56.5 MB/s, 73.9 MB/s, 66.5 MB/s

i try create fullvirtualize machine:
--------------------------------------------------
import os, re
arch = os.uname()[4]
kernel       = '/usr/lib/xen-4.0/boot/hvmloader'
device_model = '/usr/lib/xen-4.0/bin/qemu-dm'
builder      = 'hvm'
memory = 4096
shadow_memory = 8
#name = mysql
vif = [ 'bridge=eth0' ]
disk = ['phy:/dev/Xen/mysql,xvda,w','file:/root/debian-testing-amd64-netinst.iso,xvdc:cdrom,r']
boot = 'c'
sdl=0
vnc=1
vnclisten="0.0.0.0"
vncconsole=1
vncpasswd='x'
stdvga=0
serial='pty'
usbdevice='tablet'

on_reboot   = 'restart'
on_crash    = 'restart'
--------------------------------------------------

performance of inserting is little bit better but..
--------------------------------------------------
mysql> INSERT INTO __test (name, value) VALUES(RAND(), RAND());
Query OK, 1 row affected (0.12 sec)

mysql> INSERT INTO __test (name, value) VALUES(RAND(), RAND());
Query OK, 1 row affected (0.06 sec)

mysql> INSERT INTO __test (name, value) VALUES(RAND(), RAND());
Query OK, 1 row affected (0.17 sec)

mysql> INSERT INTO __test (name, value) VALUES(RAND(), RAND());
Query OK, 1 row affected (0.05 sec)

mysql> INSERT INTO __test (name, value) VALUES(RAND(), RAND());
Query OK, 1 row affected (0.05 sec)
--------------------------------------------------

i try also sysbench test with same parameter like before
sysbench --num-threads=16 --max-requests=1000 --test=oltp --oltp-table-size=1000 --mysql-socket=/var/run/mysqld/mysqld.sock --mysql-user=root run
--------------------------------------------------
OLTP test statistics:
    queries performed:
        read:                            14616
        write:                           5096
        other:                           2044
        total:                           21756
    transactions:                        1000   (246.68 per sec.)
    deadlocks:                           44     (10.85 per sec.)
    read/write requests:                 19712  (4862.59 per sec.)
    other operations:                    2044   (504.22 per sec.)

Test execution summary:
    total time:                          4.0538s
    total number of events:              1000
    total time taken by event execution: 64.5168
    per-request statistics:
         min:                                  8.17ms
         avg:                                 64.52ms
         max:                                596.93ms
         approx.  95 percentile:             272.76ms

Threads fairness:
    events (avg/stddev):           62.5000/1.32
    execution time (avg/stddev):   4.0323/0.01
--------------------------------------------------

with full virtualization i get little bit better performance, but still test take 2x longer time then on physical server!
i dont know what i can expect i never use xen and mysql together. 


______________________________________________________________
> Od: viaum@xxxxxxxxxxxxxxx
> Komu: <xen-users@xxxxxxxxxxxxxxxxxxx>
> Datum: 23.10.2010 16:19
> Předmět: RE: [Xen-users] xen4 on debian squeeze, slow mysql in domU
>
> > > >> >> On Sat, 23 Oct 2010 15:11:52 +0200 <s3t@xxxxxxxxxx> wrote:
>
> hi,
>> i have a mysql server in guest domU on debian squeeze.
>> when i create test table and do INSERT INTO test (name, value) VALUES(RAND(), RAND());
>> Query OK, 1 row affected (0.28 sec)
>>
>> at other physical server with same configuration
>> Query OK, 1 row affected (0.00 sec)
>>
>> i try this several time but on physical server max value never get over 0.05sec and on VM lowest value was 0.13sec.
>> another tests:
>> sysbench > --num-threads=16 --max-requests=1000 --test=oltp --oltp-table-size=1000 > --mysql-socket=/var/run/mysqld/mysqld.sock --mysql-user=root run
>>
>> on physical server:
>> ----------------------------------------------------------------
>> OLTP test statistics:
> > queries performed:
> > read: 15568
> > write: 5228
> > other: 2112
> > total: 22908
> > transactions: 1000 (436.65 per sec.)
> > deadlocks: 112 (48.91 per sec.)
> > read/write requests: 20796 (9080.65 per sec.)
> > other operations: 2112 (922.21 per sec.)
>>
>> Test execution summary:
> > total time: 2.2901s
> > total number of events: 1000
> > total time taken by event execution: 35.0599
> > per-request statistics:
> > min: 2.51ms
> > avg: 35.06ms
> > max: 365.01ms
> > approx. 95 percentile: 73.80ms
>>
> >Threads fairness:
> > events (avg/stddev): 62.5000/9.62
> > execution time (avg/stddev): 2.1912/0.14
> >----------------------------------------------------------------
>>
>>
> >on VM:
> >----------------------------------------------------------------
> >OLTP test statistics:
> > queries performed:
> > read: 14280
> > write: 5048
> > other: 2020
> > total: 21348
> > transactions: 1000 (177.26 per sec.)
> > deadlocks: 20 (3.55 per sec.)
> > read/write requests: 19328 (3426.02 per sec.)
> > other operations: 2020 (358.06 per sec.)
>>
>> Test execution summary:
> > total time: 5.6415s
> > total number of events: 1000
> > total time taken by event execution: 89.6339
> > per-request statistics:
> > min: 35.81ms
> > avg: 89.63ms
> > max: 275.89ms
> > approx. 95 percentile: 115.18ms
>>
>> Threads fairness:
> > events (avg/stddev): 62.5000/1.58
> > execution time (avg/stddev): 5.6021/0.03
>> ----------------------------------------------------------------
>>
>> can someone share his experience with using mysql server in xen domU?
>> what can be wrong?
>
>Could you post your domU confing files. What kind of blk devices were you using? Images, Partitions, etc?


-M
>_______________________________________________
>Xen-users mailing list
>Xen-users@xxxxxxxxxxxxxxxxxxx
>http://lists.xensource.com/xen-users
>
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users