Re: performance problem about haproxy with libvirt20131201
What are your ethernet settings? Are you using virtio or emulation? You need to tune libvirt to get close to real hardware. On Dec 1, 2013 1:07 AM, "xuxinkun" wrote: > hi: > I’m a coder from CHINA. Recently, I make a research on elastic > cluster, just like ELB of Amazon( > http://aws.amazon.com/elasticloadbalancing). I make use of haproxy to > balance the load to the virtual machines. I’m amazing about the performance > of the haproxy. It can forward the request with just little cost. But, with > libvirt(http://libvirt.org/), haproxy cannot perform as well as it > usually do. The performance of haproxy will be reduced to one quarter. Let > me show you my environment. > In our environment, I use tomcat as a web server. When I make a get > request on url http://127.0.0.1:8080/ok.html, it just returns a “ok”. I > deploy it on a virtual machine called vm_A(192.168.13.87). Then I choose > haproxy as load balancing node. The haproxy is located on a physical > machine, called machine_B(192.168.13.6). Haproxy has only one backend and > only one frontend with port 80. The backend has only one server, vm_A. > Besides, vm_A is not in machine_B. > Then I make a performance test. The result is following: > When the test machine directly accessed vm_A( > http://192.168.13.87:8080/ok.html). It can reach about 9000 Transactions > Per Second. > When the test machine accessed haproxy machine_B( > http://192.168.13.6/ok.html). It can also reach about 8000 Transactions > Per Second. > Then I just installed the libvirt on machine_B (without changing the > conf file of haproxy) and did the test again. When accessed > http://192.168.13.6/ok.html, it can reach only about 2000 Transactions > Per Second. And when I just remove the libvirt of machine_B (without > changing the conf file of haproxy), and test again. It recovered to about > 8000 Transactions Per Second. I have done the test for server times. The > result is same. > > The following is the info about my environment. > Haproxy:v.1.4.24 > Physical Machine: Intel(R) Xeon(R) CPU E5620 @ 2.40GHz 16 Cores; 32GB > Memory;500GB Disk. > Physical Machine OS: centos 6.3 > libvirt: x86_64,v0.10.2-18.el6_4.15 > > Does haproxy have conflict with libvirt? I guess that may libvirt > change system configure. But after severl days’ work, I still cannot figure > it out. So, I write this email to you and ask for your help. > Thanks for your reading. I'm looking forward to your reply. > > >XuXinkun > > 2013-12-1 > > -- > Name:XuXinkun > Email:xuxin...@gmail.com > Address:Hohai University NanJing JiangSu >
Re: performance problem about haproxy with libvirt20131201
Hi Xuxinkun, When testing with libvirt, could you run a top, then type 1 to see CPU usage and report us the Soft Interrupts CPU usage? Same test without libvirt. Baptiste On Sun, Dec 1, 2013 at 7:06 AM, xuxinkun wrote: > hi: > I’m a coder from CHINA. Recently, I make a research on elastic cluster, > just like ELB of Amazon(http://aws.amazon.com/elasticloadbalancing). I make > use of haproxy to balance the load to the virtual machines. I’m amazing > about the performance of the haproxy. It can forward the request with just > little cost. But, with libvirt(http://libvirt.org/), haproxy cannot perform > as well as it usually do. The performance of haproxy will be reduced to one > quarter. Let me show you my environment. > In our environment, I use tomcat as a web server. When I make a get > request on url http://127.0.0.1:8080/ok.html, it just returns a “ok”. I > deploy it on a virtual machine called vm_A(192.168.13.87). Then I choose > haproxy as load balancing node. The haproxy is located on a physical > machine, called machine_B(192.168.13.6). Haproxy has only one backend and > only one frontend with port 80. The backend has only one server, vm_A. > Besides, vm_A is not in machine_B. > Then I make a performance test. The result is following: > When the test machine directly accessed > vm_A(http://192.168.13.87:8080/ok.html). It can reach about 9000 > Transactions Per Second. > When the test machine accessed haproxy > machine_B(http://192.168.13.6/ok.html). It can also reach about 8000 > Transactions Per Second. > Then I just installed the libvirt on machine_B (without changing the > conf file of haproxy) and did the test again. When accessed > http://192.168.13.6/ok.html, it can reach only about 2000 Transactions Per > Second. And when I just remove the libvirt of machine_B (without changing > the conf file of haproxy), and test again. It recovered to about 8000 > Transactions Per Second. I have done the test for server times. The result > is same. > > The following is the info about my environment. > Haproxy:v.1.4.24 > Physical Machine: Intel(R) Xeon(R) CPU E5620 @ 2.40GHz 16 Cores; 32GB > Memory;500GB Disk. > Physical Machine OS: centos 6.3 > libvirt: x86_64,v0.10.2-18.el6_4.15 > > Does haproxy have conflict with libvirt? I guess that may libvirt change > system configure. But after severl days’ work, I still cannot figure it out. > So, I write this email to you and ask for your help. > Thanks for your reading. I'm looking forward to your reply. > > > XuXinkun > > 2013-12-1 > > -- > Name:XuXinkun > Email:xuxin...@gmail.com > Address:Hohai University NanJing JiangSu
Re: performance problem about haproxy with libvirt20131201
On 1 December 2013 13:20, Lukas Tribus wrote: > I'm not sure what libvirt exactly does and how/why it affects performance I don't believe libvirt is the issue, as it's merely an orchestration abstraction over the top of a variety of hypervisors. I think XuXinkun merely means s/he's running under virtualisation, and is surprised at the performance degradation observed in that setup. XuXinkun - the extent to which your performance will degrade when running under virtualisation will not only depend on coarse factors such as the hypervisor used and the resource allocation you specify, but also on a *wide* array of low-level tuning parameters at the hypervisor, network IO, disk IO, kernel, application and HAProxy levels. I'm not the best person to help you with tuning these - others on list may choose to. I *strongly* (STRONGLY!) suggest you browse this list's archives to find information that's come up in the past on this exact topic. This list is archived in a few different places - once such place is here: http://marc.info/?l=haproxy Regards, Jonathan -- Jonathan Matthews Oxford, London, UK http://www.jpluscplusm.com/contact.html
RE: performance problem about haproxy with libvirt20131201
Hi, > Then I make a performance test. The result is following: > When the test machine directly accessed > vm_A(http://192.168.13.87:8080/ok.html). It can reach about 9000 > Transactions Per Second. > When the test machine accessed haproxy > machine_B(http://192.168.13.6/ok.html). It can also reach about 8000 > Transactions Per Second. > Then I just installed the libvirt on machine_B (without changing > the conf file of haproxy) and did the test again. When accessed > http://192.168.13.6/ok.html, it can reach only about 2000 Transactions > Per Second. And when I just remove the libvirt of machine_B (without > changing the conf file of haproxy), and test again. It recovered to > about 8000 Transactions Per Second. I have done the test for server > times. The result is same. I'm not sure what libvirt exactly does and how/why it affects performance; I suspect the guys on the libvirt mailing list are more helpful in this case, you should contact them [1]. [1] http://libvirt.org/contact.html Regards, Lukas