<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://kb.linux-vs.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dogonthesun</id>
		<title>LVSKB - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://kb.linux-vs.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dogonthesun"/>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki/Special:Contributions/Dogonthesun"/>
		<updated>2026-05-02T09:47:42Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=Performance_and_Tuning&amp;diff=6189</id>
		<title>Performance and Tuning</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=Performance_and_Tuning&amp;diff=6189"/>
				<updated>2012-01-26T11:37:51Z</updated>
		
		<summary type="html">&lt;p&gt;Dogonthesun: /* Connection Hash Table Size */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Performance Measurement ==&lt;br /&gt;
&lt;br /&gt;
=== Tools ===&lt;br /&gt;
&lt;br /&gt;
* testlvs: simple throughput testing tool for LVS from Julian, see [http://www.ssi.bg/~ja/#testlvs the testlvs page]&lt;br /&gt;
* ab: apache benchmark&lt;br /&gt;
* httperf: a tool for measuring web server performance from HP, see [http://www.hpl.hp.com/research/linux/httperf/ the httperf homepage]&lt;br /&gt;
* Tsung: an open-source multi-protocol distributed load testing tool, see [http://tsung.erlang-projects.org/ Tsung project homepage]&lt;br /&gt;
* specweb: web server benchmark by spec.org, it is now [http://www.spec.org/web2005/ specweb2005]. &lt;br /&gt;
* webbench: a licensed benchmark program that measures the performance of Web servers, developed by VeriTest.&lt;br /&gt;
&lt;br /&gt;
== Performance Tuning ==&lt;br /&gt;
&lt;br /&gt;
=== Connection Hash Table Size ===&lt;br /&gt;
&lt;br /&gt;
The IPVS connection hash table uses the chaining scheme to handle&lt;br /&gt;
hash collisions. Using a big IPVS connection hash table will greatly&lt;br /&gt;
reduce conflicts when there are hundreds of thousands of connections&lt;br /&gt;
in the hash table.&lt;br /&gt;
&lt;br /&gt;
Note the table size must be power of 2. The table size will be the&lt;br /&gt;
value of 2 to the your input number power. The number to choose is&lt;br /&gt;
from 8 to 20, the default number is 12, which means the table size&lt;br /&gt;
is 4096. Don't input the number too small, otherwise you will lose&lt;br /&gt;
performance on it. You can adapt the table size yourself, according&lt;br /&gt;
to your virtual server application. It is good to set the table size&lt;br /&gt;
not far less than the number of connections per second multiplying&lt;br /&gt;
average lasting time of connection in the table.  For example, your&lt;br /&gt;
virtual server gets 200 connections per second, the connection lasts&lt;br /&gt;
for 200 seconds in average in the connection table, the table size&lt;br /&gt;
should be not far less than 200x200, it is good to set the table&lt;br /&gt;
size 32768 (2**15).&lt;br /&gt;
&lt;br /&gt;
We can configure the size of IPVS connection hash table before compiling the Linux kernel. Here are the IPVS configurations in the 'make menuconfig' menu:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Networking Options --&amp;gt;&lt;br /&gt;
  Network packet filtering framework (Netfilter)  ---&amp;gt;&lt;br /&gt;
    IP: Virtual Server Configuration --&amp;gt;&lt;br /&gt;
      [*]   IPv6 support for IPVS                                        &lt;br /&gt;
      [ ]   IP virtual server debugging                                  &lt;br /&gt;
      (20)  IPVS connection table size (the Nth power of 2)              &lt;br /&gt;
            *** IPVS transport protocol load balancing support ***       &lt;br /&gt;
      [*]   TCP load balancing support                                   &lt;br /&gt;
      [*]   UDP load balancing support                                   &lt;br /&gt;
      [*]   ESP load balancing support                                   &lt;br /&gt;
      [*]   AH load balancing support                                    &lt;br /&gt;
            *** IPVS scheduler ***                                       &lt;br /&gt;
      &amp;lt;M&amp;gt;   round-robin scheduling                                       &lt;br /&gt;
      &amp;lt;M&amp;gt;   weighted round-robin scheduling                              &lt;br /&gt;
      &amp;lt;M&amp;gt;   least-connection scheduling                                  &lt;br /&gt;
      &amp;lt;M&amp;gt;   weighted least-connection scheduling                         &lt;br /&gt;
      &amp;lt;M&amp;gt;   locality-based least-connection scheduling                   &lt;br /&gt;
      &amp;lt;M&amp;gt;   locality-based least-connection with replication scheduling  &lt;br /&gt;
      &amp;lt;M&amp;gt;   destination hashing scheduling                               &lt;br /&gt;
      &amp;lt;M&amp;gt;   source hashing scheduling                                    &lt;br /&gt;
      &amp;lt;M&amp;gt;   shortest expected delay scheduling                           &lt;br /&gt;
      &amp;lt;M&amp;gt;   never queue scheduling                                       &lt;br /&gt;
            *** IPVS application helper ***                              &lt;br /&gt;
      &amp;lt;M&amp;gt;   FTP protocol helper                                          &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Netfilter Connection Track ===&lt;br /&gt;
&lt;br /&gt;
[[IPVS]] uses its own simple and fast connection tracking for performance reasons, instead of using netfilter connection tracking. So, if you don't use firewalling feature at [[load balancer]] and you need an extremely fast load balancer, do not load  netfilter conntrack modules into you system, because there is no need to do double tracking. Note that [[LVS/NAT]] should work too without the conntrack modules.&lt;br /&gt;
&lt;br /&gt;
Julian compared the performance of IPVS with ip_conntrack and without ip_conntrack. See http://archive.linuxvirtualserver.org/html/lvs-users/2001-12/msg00141.html&lt;br /&gt;
&lt;br /&gt;
== Some Performance Data ==&lt;br /&gt;
&lt;br /&gt;
While the [[LVS/DR]] cluster was pushing out 9.6Gbps traffic, the LVS [[load balancer]] was&lt;br /&gt;
doing a negilgable ammount of work, which seems to indicate that LVS&lt;br /&gt;
could push a great deal more traffic given sufficient real-servers and&lt;br /&gt;
end-users.&lt;br /&gt;
&lt;br /&gt;
* http://archive.linuxvirtualserver.org/html/lvs-users/2005-11/msg00266.html&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kegel.com/c10k.html The C10K problem] written by Dan Kegel, good notes on how to configure operating systems and write code to support 10K clients on a single server&lt;br /&gt;
&lt;br /&gt;
[[Category:LVS Handbook]]&lt;/div&gt;</summary>
		<author><name>Dogonthesun</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=Performance_and_Tuning&amp;diff=6188</id>
		<title>Performance and Tuning</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=Performance_and_Tuning&amp;diff=6188"/>
				<updated>2012-01-26T11:36:45Z</updated>
		
		<summary type="html">&lt;p&gt;Dogonthesun: /* Connection Hash Table Size */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Performance Measurement ==&lt;br /&gt;
&lt;br /&gt;
=== Tools ===&lt;br /&gt;
&lt;br /&gt;
* testlvs: simple throughput testing tool for LVS from Julian, see [http://www.ssi.bg/~ja/#testlvs the testlvs page]&lt;br /&gt;
* ab: apache benchmark&lt;br /&gt;
* httperf: a tool for measuring web server performance from HP, see [http://www.hpl.hp.com/research/linux/httperf/ the httperf homepage]&lt;br /&gt;
* Tsung: an open-source multi-protocol distributed load testing tool, see [http://tsung.erlang-projects.org/ Tsung project homepage]&lt;br /&gt;
* specweb: web server benchmark by spec.org, it is now [http://www.spec.org/web2005/ specweb2005]. &lt;br /&gt;
* webbench: a licensed benchmark program that measures the performance of Web servers, developed by VeriTest.&lt;br /&gt;
&lt;br /&gt;
== Performance Tuning ==&lt;br /&gt;
&lt;br /&gt;
=== Connection Hash Table Size ===&lt;br /&gt;
&lt;br /&gt;
The IPVS connection hash table uses the chaining scheme to handle&lt;br /&gt;
hash collisions. Using a big IPVS connection hash table will greatly&lt;br /&gt;
reduce conflicts when there are hundreds of thousands of connections&lt;br /&gt;
in the hash table.&lt;br /&gt;
&lt;br /&gt;
Note the table size must be power of 2. The table size will be the&lt;br /&gt;
value of 2 to the your input number power. The number to choose is&lt;br /&gt;
from 8 to 20, the default number is 12, which means the table size&lt;br /&gt;
is 4096. Don't input the number too small, otherwise you will lose&lt;br /&gt;
performance on it. You can adapt the table size yourself, according&lt;br /&gt;
to your virtual server application. It is good to set the table size&lt;br /&gt;
not far less than the number of connections per second multiplying&lt;br /&gt;
average lasting time of connection in the table.  For example, your&lt;br /&gt;
virtual server gets 200 connections per second, the connection lasts&lt;br /&gt;
for 200 seconds in average in the connection table, the table size&lt;br /&gt;
should be not far less than 200x200, it is good to set the table&lt;br /&gt;
size 32768 (2**15).&lt;br /&gt;
&lt;br /&gt;
We can configure the size of IPVS connection hash table before compiling the Linux kernel. Here are the IPVS configurations in the 'make menuconfig' menu:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Networking Options --&amp;gt;&lt;br /&gt;
  Network packet filtering framework (Netfilter)  ---&amp;gt;&lt;br /&gt;
    IP: Virtual Server Configuration --&amp;gt;&lt;br /&gt;
      &amp;lt;M&amp;gt; virtual server support (EXPERIMENTAL)&lt;br /&gt;
      [ ]   IP virtual server debugging&lt;br /&gt;
      (12)   IPVS connection table size (the Nth power of 2)&lt;br /&gt;
      --- IPVS scheduler&lt;br /&gt;
      &amp;lt;M&amp;gt;   round-robin scheduling&lt;br /&gt;
      &amp;lt;M&amp;gt;   weighted round-robin scheduling&lt;br /&gt;
      &amp;lt;M&amp;gt;   least-connection scheduling scheduling&lt;br /&gt;
      &amp;lt;M&amp;gt;   weighted least-connection scheduling&lt;br /&gt;
      &amp;lt;M&amp;gt;   locality-based least-connection scheduling&lt;br /&gt;
      &amp;lt;M&amp;gt;   locality-based least-connection with replication scheduling&lt;br /&gt;
      &amp;lt;M&amp;gt;   destination hashing scheduling&lt;br /&gt;
      &amp;lt;M&amp;gt;   source hashing scheduling&lt;br /&gt;
      &amp;lt;M&amp;gt;   shortest expected delay scheduling&lt;br /&gt;
      &amp;lt;M&amp;gt;   never queue scheduling&lt;br /&gt;
      --- IPVS application helper&lt;br /&gt;
      &amp;lt;M&amp;gt;   FTP protocol helper&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Netfilter Connection Track ===&lt;br /&gt;
&lt;br /&gt;
[[IPVS]] uses its own simple and fast connection tracking for performance reasons, instead of using netfilter connection tracking. So, if you don't use firewalling feature at [[load balancer]] and you need an extremely fast load balancer, do not load  netfilter conntrack modules into you system, because there is no need to do double tracking. Note that [[LVS/NAT]] should work too without the conntrack modules.&lt;br /&gt;
&lt;br /&gt;
Julian compared the performance of IPVS with ip_conntrack and without ip_conntrack. See http://archive.linuxvirtualserver.org/html/lvs-users/2001-12/msg00141.html&lt;br /&gt;
&lt;br /&gt;
== Some Performance Data ==&lt;br /&gt;
&lt;br /&gt;
While the [[LVS/DR]] cluster was pushing out 9.6Gbps traffic, the LVS [[load balancer]] was&lt;br /&gt;
doing a negilgable ammount of work, which seems to indicate that LVS&lt;br /&gt;
could push a great deal more traffic given sufficient real-servers and&lt;br /&gt;
end-users.&lt;br /&gt;
&lt;br /&gt;
* http://archive.linuxvirtualserver.org/html/lvs-users/2005-11/msg00266.html&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kegel.com/c10k.html The C10K problem] written by Dan Kegel, good notes on how to configure operating systems and write code to support 10K clients on a single server&lt;br /&gt;
&lt;br /&gt;
[[Category:LVS Handbook]]&lt;/div&gt;</summary>
		<author><name>Dogonthesun</name></author>	</entry>

	</feed>