[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [rhelv5-list] [rhelv6-beta-list] A simple program runs under KVM faster than under nake PC.



So,a simple test can show AES is much faster inside KVM because of poor
_x86_64_AES_encrypt_compact 

###inside###
[root xen-727057^10 227 ~]# time ssh 10.12.10.192 'time dd if=/dev/zero
bs=1M count=300 | openssl aes-128-cbc -k 1231 2323 > /dev/null'
300+0 records in
300+0 records out
314572800 bytes (315 MB) copied, 3.38921 seconds, 92.8 MB/s

real    0m3.399s
user    0m2.415s
sys     0m1.701s

real    0m3.591s
user    0m0.000s
sys     0m0.000s

###outside###
[root xen-727057^10 227 ~]# time ssh 10.12.10.48 'time dd if=/dev/zero bs=1M
count=300 | openssl aes-128-cbc -k 1231 2323 > /dev/null'   
300+0 records in
300+0 records out
314572800 bytes (315 MB) copied, 5.22114 seconds, 60.2 MB/s

real    0m5.224s
user    0m4.972s
sys     0m0.655s

real    0m5.324s
user    0m0.000s
sys     0m0.000s

Regards,
   Kirby Zhou    
   from   SOHU-RD   +86-10-6272-8261


-----Original Message-----
From: Kirby Zhou [mailto:kirbyzhou sohu-rd com] 
Sent: Thursday, August 12, 2010 5:07 PM
To: 'Red Hat Enterprise Linux 6 (Santiago) Beta releases discussion
mailing-list'
Subject: RE: [rhelv6-beta-list] A simple program runs under KVM faster than
under nake PC.

With oprofile and gdb, I found that, openssl takes different code path
inside and outside KVM.

Outside the KVM, openssl calls _x86_64_AES_encrypt_compact, it seems slow
than_x86_64_AES_encrypt.

#### outside KVM #### 
[ djt_10_48 ~]# opcontrol --start; opcontrol --reset; ./a.out 1 10000;
opcontrol --dump; opreport -l        
Profiler running.
Signalling daemon... done
crc:a4580383
warning: /no-vmlinux could not be found.
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
samples  %        app name                 symbol name
20694    78.9847  no-vmlinux               /no-vmlinux
4797     18.3092  libcrypto.so.0.9.8e      _x86_64_AES_encrypt_compact
455       1.7366  libz.so.1.2.3            crc32
167       0.6374  libcrypto.so.0.9.8e      AES_cbc_encrypt
61        0.2328  a.out                    io_routine(void*)
7         0.0267  bash                     /bin/bash
4         0.0153  GBK.so                   gconv
3         0.0115  oprofiled                /usr/bin/oprofiled
2         0.0076  libc-2.5.so              mbrtowc
2         0.0076  libcrypto.so.0.9.8e      _x86_64_AES_set_encrypt_key
1         0.0038  ld-2.5.so                _dl_allocate_tls_init
1         0.0038  ld-2.5.so                _dl_sysdep_start
1         0.0038  ld-2.5.so                do_lookup_x
1         0.0038  libc-2.5.so              __close_nocancel
1         0.0038  libc-2.5.so              _dl_addr
1         0.0038  libc-2.5.so              _int_malloc
1         0.0038  libc-2.5.so              malloc
1         0.0038  libc-2.5.so              memset

#### inside KVM ####
[ djt_10_192 ~]# opcontrol --start; opcontrol --reset; ./a.out 1 10000;
opcontrol --dump; opreport -l
Profiler running.
Signalling daemon... done
crc:a4580383
warning: /no-vmlinux could not be found.
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
samples  %        app name                 symbol name
13659    81.7415  no-vmlinux               /no-vmlinux
2338     13.9916  libcrypto.so.0.9.8e      _x86_64_AES_encrypt
481       2.8785  libz.so.1.2.3            crc32
72        0.4309  libcrypto.so.0.9.8e      AES_cbc_encrypt
54        0.3232  a.out                    io_routine(void*)
14        0.0838  bash                     /bin/bash
6         0.0359  libc-2.5.so              _int_malloc
5         0.0299  ld-2.5.so                _dl_relocate_object
5         0.0299  ld-2.5.so                do_lookup_x
5         0.0299  libc-2.5.so              _nl_intern_locale_data
5         0.0299  libcrypto.so.0.9.8e      _x86_64_AES_set_encrypt_key
4         0.0239  ld-2.5.so                _dl_lookup_symbol_x
3         0.0180  GBK.so                   gconv
3         0.0180  ld-2.5.so                _dl_map_object_deps
3         0.0180  ld-2.5.so                dl_main
3         0.0180  ld-2.5.so                strcmp
3         0.0180  libc-2.5.so              _dl_addr
3         0.0180  libc-2.5.so              mbrtowc
3         0.0180  libc-2.5.so              memset
2         0.0120  gawk                     /bin/gawk
2         0.0120  ld-2.5.so                _dl_load_cache_lookup
2         0.0120  ld-2.5.so                _dl_setup_hash
2         0.0120  libc-2.5.so              __register_atfork
2         0.0120  libc-2.5.so              _int_free
2         0.0120  libc-2.5.so              malloc
2         0.0120  oprofiled                /usr/bin/oprofiled
1         0.0060  grep                     /bin/grep
1         0.0060  ld-2.5.so                .text
1         0.0060  ld-2.5.so                _dl_check_map_versions
1         0.0060  ld-2.5.so                _dl_map_object_from_fd
1         0.0060  ld-2.5.so                _dl_new_object
1         0.0060  ld-2.5.so                _dl_sysdep_start
1         0.0060  ld-2.5.so                check_match.8509
1         0.0060  ld-2.5.so                memcpy
1         0.0060  ld-2.5.so                memset
1         0.0060  libc-2.5.so              _IO_file_finish@@GLIBC_2.2.5
1         0.0060  libc-2.5.so              __close_nocancel
1         0.0060  libc-2.5.so              __default_morecore
1         0.0060  libc-2.5.so              __init_misc
1         0.0060  libc-2.5.so              _int_realloc
1         0.0060  libc-2.5.so              _nl_load_locale_from_archive
1         0.0060  libc-2.5.so              create_cd_newstate
1         0.0060  libc-2.5.so              free
1         0.0060  libc-2.5.so              new_composite_name
1         0.0060  libc-2.5.so              parse_reg_exp
1         0.0060  libc-2.5.so              re_string_reconstruct
1         0.0060  libc-2.5.so              setlocale
1         0.0060  libc-2.5.so              sigprocmask
1         0.0060  libc-2.5.so              strrchr
1         0.0060  libc-2.5.so              strstr
1         0.0060  libc-2.5.so              sysconf
1         0.0060  libc-2.5.so              wctype_l
1         0.0060  mkdir                    /bin/mkdir

Regards,
   Kirby Zhou    
   from   SOHU-RD   +86-10-6272-8261


-----Original Message-----
From: rhelv6-beta-list-bounces redhat com
[mailto:rhelv6-beta-list-bounces redhat com] On Behalf Of Kirby Zhou
Sent: Monday, August 09, 2010 2:43 PM
To: 'Red Hat Enterprise Linux 6 (Santiago) Beta releases discussion
mailing-list'
Subject: Re: [rhelv6-beta-list] A simple program runs under KVM faster than
under nake PC.

Please check my source code.
This is a PURE CPU program. No read, No Write.
So I do not think cache is the point.

Regards,
   Kirby Zhou    
   from   SOHU-RD   +86-10-6272-8261


-----Original Message-----
From: rhelv6-beta-list-bounces redhat com
[mailto:rhelv6-beta-list-bounces redhat com] On Behalf Of John Summerfield
Sent: Monday, August 09, 2010 8:01 AM
To: Red Hat Enterprise Linux 6 (Santiago) Beta releases discussion
mailing-list
Subject: Re: [rhelv6-beta-list] A simple program runs under KVM faster than
under nake PC.

Kirby Zhou wrote:
> Both RHEL5/RHEL6 encounter the same situation.
> 
> Is there any potential bug?
> 
>  
> 
> ]# g++ testaes.cpp -lcrypto -lz

If the program is I/O bound, I would expect the virtual box to run 
faster _for smallish files_. hdparm can report I/O speeds an order of 
magnitude faster than on real machines.

The reason is that the host caches the real disk. If you overflow the 
cache, results will be different.

Time this, I find it's quire a bit slower in any VM I've tried.

#!/usr/bin/perl
#use integer;
$i = 0;
while ($i < 10000)
         {
                 $j = 0;
                 while ($j < 10000)
                         {
                                 ++$j;
                         }
                 ++$i;
         }

07:59 [summer penguin ~]$


-- 

Cheers
John

-- spambait
1aaaaaaa coco merseine nu  Z1aaaaaaa coco merseine nu
-- Advice
http://webfoot.com/advice/email.top.php
http://www.catb.org/~esr/faqs/smart-questions.html
http://support.microsoft.com/kb/555375

You cannot reply off-list:-)

_______________________________________________
rhelv6-beta-list mailing list
rhelv6-beta-list redhat com
https://www.redhat.com/mailman/listinfo/rhelv6-beta-list

_______________________________________________
rhelv6-beta-list mailing list
rhelv6-beta-list redhat com
https://www.redhat.com/mailman/listinfo/rhelv6-beta-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]