Using this benchmark and an unmodified Linux 2.0.30 kernel, NT is much faster than Linux at context switching, either between processes (1.9x) or threads (3.2x). Since context switching occurs much more frequently than context creation, it would seem that Linux has a problem. When Windows makes a CPU stop executing one thread's code and start executing another thread's code, we call this a context switch. A context switch is fairly expensive because the operating system has to: So circa CLR via C# 2.0 lets say we are on Pentium 4 2.4ghz 1 core non-HT, XP. Every 20 milliseconds? StartIsBack 2.9.7 for Win10 / 1.7.6 for Win8.1 / 2.1.2 for Win8. Bring back the standard Start Menu to Windows 8, 8.1 or 10 and enjoy accessing your favorite progr.
- Contexts 3 2 0 – Fast Window Switcher Panel Wiring
- Contexts 3 2 0 – Fast Window Switcher Panel Drug Screen
- Contexts 3 2 0 – Fast Window Switcher Panels
- Contexts 3 2 0 – Fast Window Switcher Panel Installation
According to Wikipedia:
- Compiz is a compositing window manager for the X Window System, using 3D graphics hardware to create fast compositing desktop effects for window management. Effects, such as a minimization animation or a cube workspace, are implemented as loadable plugins.
- 1Installation
- 2Starting
- 2.1Enabling important plugins
- 2.2Compiz startup
- 3Using Compiz as a standalone window manager
- 3.1Starting the session with a display manager
- 4Tips and tricks
- 5Troubleshooting
- 5.1Missing GLX_EXT_texture_from_pixmaps
- 6Known issues
- 6.2Xfce panel issues
Installation
There are two versions of Compiz available, the 0.8 series which is written in C and the 0.9 series which is a complete re-write of Compiz in C++. As of August 2016, both series are actively developed. Compiz 0.9 is developed by the Compiz Maintainers on Launchpad whilst Compiz 0.8 is developed by the Compiz Reloaded project on GitLab. The two series cannot be installed side by side.
0.9 series
Note: From Compiz 0.9.8 onwards, all Compiz components are developed and distributed as a single project. This means that a single package can provide all of the Compiz components.
- Compiz — OpenGL compositing window manager with CCSM, Plugins and GTK Window Decorator.
- https://launchpad.net/compiz || compizAUR
0.8 series
Note: The GTK Window Decorator is provided by compiz-gtkAUR, a split package from compiz-coreAUR.
Required:
- Compiz Core — OpenGL compositing window manager.
- https://github.com/compiz-reloaded/compiz/ || compiz-coreAUR
Highly recommended:
- CompizConfig Settings Manager — Graphical settings manager for Compiz.
- https://github.com/compiz-reloaded/ccsm || ccsmAUR
- Compiz Fusion Plugins Main — Main plugins collection for Compiz.
- https://github.com/compiz-reloaded/compiz-plugins-main || compiz-fusion-plugins-mainAUR
- Compiz Fusion Plugins Extra — Extra plugins collection for Compiz.
- https://github.com/compiz-reloaded/compiz-plugins-extra || compiz-fusion-plugins-extraAUR
Optional:
- Compiz Fusion Plugins Experimental — Experimental Compiz plugins (known as Plugins Unsupported prior to version 0.8.12).
- https://github.com/compiz-reloaded/compiz-plugins-experimental || compiz-fusion-plugins-experimentalAUR
Extras
Note: Emerald since 0.8.12 and Fusion Icon since 0.1.2 support Compiz 0.9 as well as Compiz 0.8. Compiz 0.9 users using the older Emerald 0.9.5 release are recommended to switch to Emerald 0.8.12 or a higher version in the 0.8 series as Emerald 0.9 is not actively developed.
- Emerald — A standalone window decorator for Compiz.
- https://github.com/compiz-reloaded/emerald || emeraldAUR
- Emerald Themes — Extra themes for the Emerald window decorator.
- https://github.com/compiz-reloaded/emerald-themes || emerald-themesAUR
- Fusion Icon — A tray applet for starting Compiz and switching window managers and decorators on the fly.
- https://github.com/compiz-reloaded/fusion-icon || fusion-iconAUR
- Compiz Manager — A wrapper script to start Compiz.
- https://github.com/compiz-reloaded/compiz-manager || compiz-managerAUR
- Simple CCSM — Simplified graphical settings manager for Compiz 0.8.
- https://github.com/compiz-reloaded/simple-ccsm || simple-ccsmAUR
Starting
Enabling important plugins
Tip: Depending on which package you installed Compiz from, some of these plugins may already be activated.
Before starting Compiz, you should activate some plugins to provide basic window manager behaviour or else you will have no ability to drag, scale or close any windows. Important plugins are listed below:
- Window Decoration - provides window borders, see #Window decoration.
- Move Window.
- Resize Window.
- Place Windows - configure window placement options.
- Application Switcher - provides an
Alt+Tab
switcher - there are numerous alternative application switcher plugins, for example: Shift Switcher, Static Application Switcher and more. Not all of them use theAlt+Tab
keybinding.
To be able to switch to different viewports you will need to enable one of the following:
- Desktop Cube & Rotate Cube - provides the spinning cube with each side being a different viewport.
- Desktop Wall - viewports are arranged next to each other - the animation is similar to the workspace switching animation in Cinnamon and GNOME Shell.
- Expo - creates a view of all viewports and windows when the mouse is moved into the top left corner - this plugin can be used on its own or in conjunction with either of the two previous plugins.
Window decoration
Tip: For information on selecting and managing themes, see: Compiz/Configuration#Window decoration themes.
Note: The KDE Window Decorator is not compatible with KDE Plasma 5. The Compiz 0.8 upstream dropped the KDE Window Decorator from Compiz Core in December 2015. [1]
The window decorator is the program which provides windows with borders. Unlike window managers such as Kwin or Xfwm which provide just one decorator, users of Compiz have a choice of three: GTK Window Decorator, KDE Window Decorator and Emerald. The GTK Window Decorator and the KDE Window Decorator are included in the Compiz source and can be optionally compiled whilst building Compiz. Emerald, on the other hand, is a separate, standalone decorator. The Window Decoration plugin in CCSM must be ticked otherwise no window decorator will be started.
- Choosing the decorator
The window decorator that will be started is specified under CCSM -> Effects -> Window Decoration -> Command. The default command is compiz-decorator which is a script which will attempt to locate the emerald and gtk-window-decorator executables (and also the kde4-window-decorator executable if you are using Compiz 0.9). It will then start the first decorator that it finds, according to the search order and conditions (such as session detection) specified in the script. Note that the script provided by Compiz 0.8 differs significantly from the one provided by Compiz 0.9 so the behavior may be different.
Keepassxc browser edge. The compiz-decorator command can be replaced with one of the executables listed above. If you find that your preferred decorator is not being started, try appending the
--replace
switch to the command, for example: emerald --replace
.Compiz startup
Note: Some Compiz versions may require you to manually load the CCP plugin on startup:
compiz --replace ccp
[2]You can start Compiz using the following command:
See
compiz --help
for more options.Fusion Icon
Tip: When #Autostarting Compiz in a desktop environmentfusion-icon can be set as the default command instead of compiz.
To start Compiz using Fusion Icon, execute the command below:
To ensure that fusion-icon then starts Compiz, right click on the icon in the panel and go to select window manager. Choose Compiz if it is not selected already.
Autostarting Compiz in a desktop environment
See Desktop environment#Use a different window manager.
Contexts 3 2 0 – Fast Window Switcher Panel Wiring
Using Compiz as a standalone window manager
Starting the session with a display manager
A standalone Compiz session can be started from a display manager. For most display managers - LightDM for example - all that is required is to create a
.desktop
file in /usr/share/xsessions
that executes compiz (with command line options if needed) or fusion-icon. See the article for your display manager. See Desktop entries for information on creating a .desktop
file.Autostarting programs when using a display manager
Mountain duck 1 8 1. One way in which you could start programs with your Compiz session, when it is started from a display manager, is to use an xprofile file. Another option is for the
.desktop
file in /usr/share/xsessions
to not execute compiz directly but to execute a script which starts the programs you wish to start and also starts Compiz.Starting the session with startx
A Compiz session can be started with startx. Define either compiz or fusion-icon in your
.xinitrc
file. See the xinitrc article for more details.Add a root menu
To add a root menu similar to that in Openbox and other standalone window managers install compiz-boxmenuAUR. This program is a fork of compiz-deskmenuAUR.
Then copy the config files to your home directory as shown below:
where
username
is your username and group
is the primary group for your user.Then, open CCSM, navigate to the Commands plugin and in Command line 0 enter the command
compiz-boxmenu
. In the Key Bindings tab, set Run command 0 to Control+Space
or another key/mouse button combination of choice. Take care not to use a combination that is already used for other functionality.Now navigate to the Viewport Switcher plugin and click on the Desktop-based Viewport Switching tab. Change the Plugin for initiate action to
core
and change Action name for initiate to run_command0_key
.You should now find that a menu appears when you click
Control+Space
. To launch a graphical menu editor, click on the Edit option or run compiz-boxmenu-editor
in a terminal. If you would prefer to edit your menu manually, open the following file in your favourite editor: ~/.config/compiz/boxmenu/menu.xml
. For your changes to take effect, you must click the Reload option in your menu.Allow users to shutdown/reboot
An unprivileged user should be able to execute commands such as
systemctl poweroff
and systemctl reboot
. You could assign a keyboard shortcut to one of these commands using the Commands plugin in CCSM. Alternatively, you could create a launcher for one of these commands in compiz-boxmenuAUR - see above. For more detailed information on shutting down see the following article: Allow users to shutdown.Tips and tricks
Restoring the native window manager
You can switch back to your desktop environment's default window manager with the following command:
using kwin, metacity or xfwm4 for example instead of wm_name.
Enabling the Alt+F2 run dialog
- GNOME Panel
Enable the Gnome Compatibility plugin in CCSM.
- MATE Panel
There are two ways to enable MATE Panel's run dialog in Compiz. You can either:
- Enable the MATE Compatibility plugin in CCSM (use the Gnome Compatibility plugin for older Compiz versions which lack the MATE plugin).
- Map the command below to the
Alt+F2
key combination using the Commands plugin in CCSM.
- LXDE Panel
Map the command below to the
Alt+F2
key combination using the Commands plugin in CCSM.- Xfce Appfinder
When Compiz is used in an Xfce session, the run dialog (provided by xfce4-appfinder) should work without intervention. If you are using Xfce Appfinder in a standalone Compiz session, map the command below to the
Alt+F2
key combination using the Commands plugin in CCSM.- Other run dialogs
Map the command for a run dialog of choice to the
Alt+F2
key combination using the Commands plugin in CCSM.Remove title bar from maximized windows
Start CCSM and navigate to the Window Decoration plugin. Then in the Decoration Windows field, change
any
to !state=maxvert
. [3]Troubleshooting
Missing GLX_EXT_texture_from_pixmaps
ATI cards
A possible issue with GLX_EXT_texture_from_pixmap on ATI cards is that the card can only render it indirectly. If so, you have to pass the option to your libgl as shown below:
Intel chips
Use the following command to start Compiz (this command must be used every time).
Compiz starts without window borders with NVIDIA binary drivers
Firstly, ensure that your window decorator settings are configured correctly - see #Window decoration. If window borders still do not start try adding Option 'AddARGBGLXVisuals' 'True' and Option 'DisableGLXRootClipping' 'True' to your 'Screen' section in
/etc/X11/xorg.conf.d/20-nvidia.conf
. If window borders still do not load and you have used other Options elsewhere in /etc/X11/xorg.conf.d/
try commenting them out and using only the aformentioned ARGBGLXVisuals and GLXRootClipping Options.Blank screen on resume from suspend-to-ram with NVIDIA binary drivers
If you receive a blank screen with a responsive cursor upon resume, try disabling sync to vblank. To do so, open CCSM, navigate to the OpenGL plugin and untick the Sync to VBlank option.
Poor performance from capable graphics cards
NVIDIA and Intel chips: If everything is configured correctly but you still have poor performance with some effects, try disabling CCSM > General Options > Display Settings > Detect Refresh Rate and instead choose a value manually.
NVIDIA chips only: The inadequate refresh rate with Detect Refresh Rate may be due to an option called DynamicTwinView being enabled by default which plays a factor in accurately reporting the maximum refresh rate that your card and display support. You can disable DynamicTwinView by adding the following line to the 'Device' or 'Screen' section of your
/etc/X11/xorg.conf.d/20-nvidia.conf
, and then restarting your computer:Screen flicks with NVIDIA card
To fix this behaviour create the file below:
Video tearing
If you experience video tearing when using Compiz, try enabling the Workarounds plugin in CCSM. Once enabled, ensure that the following options are enabled in Workarounds: Force complete redraw on initial damage, Force full screen redraws (buffer swap) on repaint.
If you are using Intel graphics and the workaround above does not fix the video tearing, see Intel graphics#Tearing.
Also see, #Poor performance from capable graphics cards.
Fusion Icon fails to start
If you get an output like this from the command line:
the problem is with the permission on
~/.config/compiz/
. To fix it, use:Alt+F4 keybinding not working (Xfce)
If Compiz replaces Xfwm4 at login, this can cause the
Alt+F4
keybinding to become non-functional. To avoid this issue, ensure that only Compiz is started at login - see Xfce#Use a different window manager.Emerald crashes when selecting a theme
You may find that Emerald crashes when selecting certain themes (especially themes that use the legacy engine). If this occurs, select another theme in Emerald Theme Manager and then run the command
emerald --replace
.No system bell when Compiz is running
You may find that the system bell (such as the drip sound played when pressing backspace at the beginning of a line in GNOME or MATE Terminal) will not sound if Compiz is running. See the following upstream bug report.
PulseAudio users, as a workaround, can force PulseAudio to handle the system bell, see PulseAudio#X11 Bell Events.
Compiz crashes when enabling the Gnome Compatibility plugin (GSettings backend)
If you are using the GSettings backend, you may find that Compiz crashes if you try to enable the Gnome Compatibility plugin. In order to enable this plugin whilst using the GSettings backend you need to open CCSM and navigate to Preferences. Under the header Integration untick the box labelled Enable integration into the desktop environment. After unticking this option, you should find it possible to enable the Gnome Compatibility plugin.
Windows lose focus when unminimised
You may find that certain windows (such as a Chromium window) will lose focus when unminimised. See the following upstream bug report. One possible solution is to enable the Keep previews of minimized windows option, located within the Workarounds plugin.
Note: If you use the Chrome/Chromium browser and you enable this workaround, you will need to ensure that the Use system title bar and borders option within Chrome is enabled. If Chrome's own titlebar is used with the Keep previews of minimized windows Compiz workaround then when Chrome is minimized, the desktop beneath will become unresponsive.
Popout windows are offset when Compiz is running
You may find that popout windows for panels which are placed at the bottom of the screen are offset by a few pixels so that the window appears to float above the panel. This problem is known to affect Xfce and KDE and may affect other desktops as well. Listed below are a number of workarounds that might fix some cases.
- Place the panel at the top of screen instead of the bottom - this should work in most cases.
- Disable the Place Windows plugin - this works for the Xfce Whisker Menu plugin but may not work elsewhere.
- Use fixed window placement to determine the window's position. This can be set from the Place Windows plugin. For instance, for the Whisker Menu, specify that the window with the title Whisker Menu should appear at (-1, -1).
For more information, see the following upstream bug report.
Alt-Tab switcher has no background (Emerald)
You may find that the
Alt-Tab
switcher (provided by the staticswitcher or switcher plugins) has a completely transparent background when using Emerald as well. This can make it hard to differentiate window thumbnails from the desktop background behind them. As of Compiz 0.9.12 (revision 3975) a workaround is available. In CCSM, navigate to Application Switcher or Static Application Switcher depending on which plugin you are using. For the former, the Background settings are located under General and for the latter the settings are located under Appearance. Once you have found the settings, ensure that the Set background color box is ticked. The default is a dark grey which can be optionally changed.Alternatively, use GTK Window Decorator instead of Emerald or use a different window switcher altogether such as the shift switcher. Note that even if you are using the GTK Window Decorator, you can still change the background color as described above.
Mouse cursor invisible or X shaped on startup
See Cursor themes#Change X shaped default cursor.
Known issues
Plugins in Compiz 0.8 are not present in Compiz 0.9
Some plugins that were popular in Compiz 0.8 were disabled in Compiz versions 0.9.8 and above in order to complete OpenGL ES support. A few of the disabled plugins have since been re-enabled; for instance, the Animations Add-On plugin was re-enabled for the Compiz 0.9.13.0 release. Other currently-disabled plugins that receive patches for this issue may well be re-enabled in future releases. For more information, see the Compiz 0.9.8 release notes.
Likewise, Compiz Plugins Unsupported (a package which includes plugins such as Atlantis) is unavailable in recent versions of Compiz 0.9. It has not been developed for the Compiz 0.9 series since Compiz 0.9.5 and no longer builds successfully.
Xfce panel issues
Xfce panel window buttons are not refreshed when a window changes viewport
You may find that if you right click on a window title and choose an option such as Move to Workspace Right then the window will move but the window button will still be visible in the viewport the window moved from until you switch viewports. This issue can be fixed by replacing xfce4-panel with xfce4-panel-compizAUR which incorporates a patch for this issue. See the following upstream bug report for more information.
Xfce workspace switcher has wrong aspect ratio
When Compiz is used with Xfce Panel 4.11 and above, the workspace pager will use the width of only one workspace but will divide this space into ever smaller bars, according to how many viewports Compiz specifies. This issue can be fixed by replacing xfce4-panel with xfce4-panel-compizAUR which incorporates a patch for this issue. For more information, see the following upstream bug report.
Compiz crashes when enabling the D-Bus plugin
The D-Bus plugin will cause Compiz to crash if enabled in conjunction with certain other plugins such as the Cube plugin. See the following upstream bug report.
Workspace pager and window buttons issues
Only a few taskbars are compatible with Compiz's viewports. Incompatible panels and docks may display issues such as showing all window buttons in all workspaces or the workspace pager may only show one workspace available. The panels listed below are known to be compatible:
- xfce4-panel (partial, see #Xfce panel issues)
- perlpanel-gitAUR
See also
Contexts 3 2 0 – Fast Window Switcher Panel Drug Screen
- Compiz Home, including wiki and forum (website and wiki are unmaintained)
- Troubleshooting - Compiz Wiki, (wiki is unmaintained)
Retrieved from 'https://wiki.archlinux.org/index.php?title=Compiz&oldid=634814'
Latest versions
Branch | Release date | End of life | Latest version | Changelog | Links |
2.3-dev | ~2020-Q4 | 2022-Q2 (dev » stable) | 2.3-dev7 | 2020/10/17 | git / web / dir / announce |
2.2 | 2020-07-07 | 2025-Q2 (LTS) | 2.2.4 | 2020/09/30 | git / web / dir / announce / bugs |
2.1 | 2019-11-25 | 2021-Q1 | 2.1.9 | 2020/09/30 | git / web / dir / announce / bugs |
2.0 | 2019-06-16 | 2024-Q2 (LTS) | 2.0.18 | 2020/09/30 | git / web / dir / announce / bugs |
1.9 | 2018-12-19 | 2020-Q2 (unmaintained) | 1.9.16 | 2020/07/31 | git / web / dir / announce / bugs |
1.8 | 2017-11-26 | 2022-Q4 (LTS) | 1.8.26 | 2020/08/03 | git / web / dir / announce / bugs |
1.7 | 2016-11-25 | 2021-Q4 (critical fixes only) | 1.7.12 | 2019/10/25 | git / web / dir / announce / bugs |
1.6 | 2015-10-13 | 2020-Q4 (critical fixes only) | 1.6.15 | 2019/10/25 | git / web / dir / announce / bugs |
1.5 | 2014-06-19 | 2020-01-10 (unmaintained) | 1.5.19 | 2016/12/25 | git / web / dir / announce / bugs |
1.4 | 2010-02-26 | 2018-02-08 (unmaintained) | 1.4.27 | 2016/03/14 | git / web / dir / announce / bugs |
1.3 | 2006-06-29 | 2016-03-14 (unmaintained) | 1.3.28 | 2016/03/14 | git / web / dir / announce / bugs |
1.2 | 2003-11-09 | 2011-08-06 (unmaintained) | 1.2.18 | 2008-05-25 | git / web / dir |
1.1 | 2002-03-10 | 2006-01-29 (unmaintained) | 1.1.34 | 2006-01-29 | git / web / dir |
1.0 | 2001-12-16 | 2001-12-30 (unmaintained) | 1.0.2 | 2001-12-30 | git / web / dir |
Quick News
- As most already expected it, the HAProxyConf 2020 which was initially planned around November will be postponed to a yet unknown date in 2021 depending on how the situation evolves regarding the pandemic. At this point it's useless to forecast anything, so we'll start to announce it upfront once we have a better visibility of what is possible.
In the mean time, if you're impatient, please be aware that all the 2019 talks are available on https://www.haproxyconf.com/2019/presentations/.
July 7th, 2020 : HAProxy 2.2.0 is ready!
- HAProxy 2.2 is tha latest LTS release, delivered few weeks late, but for good given that many early bugs were addressed during this time! New features include runtime certificate addition and crtlist management, dynamic error pages and return statements, logging over TCP, refined idle connection pools saving server resources, extensible health checks, improved I/O processing and scheduling for even lower latency processing, even more debugging information. Please check the announce here for more details.
November 25th, 2019 : HAProxy 2.1.0 is out!
- Delivered on time, for once, proving that our new development process works better. In short this provides hot-update of certificates, FastCGI to backends, better performance, more debugging capabilities and some extra goodies. Please check the announce here for more details.
Description
HAProxy is a free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It is particularly suited for very high traffic web sites and powers quite a number of the world's most visited ones. Over the years it has become the de-facto standard opensource load balancer, is now shipped with most mainstream Linux distributions, and is often deployed by default in cloud platforms. Since it does not advertise itself, we only know it's used when the admins report it :-)
Its mode of operation makes its integration into existing architectures very easy and riskless, while still offering the possibility not to expose fragile web servers to the net, such as below :
We always support at least two active versions in parallel and an extra old one in critical fixes mode only. The currently supported versions are :
- version 2.2 : runtime certificate additions, improved idle connection management, logging over TCP, HTTP 'return' directive, errorfile templates, TLSv1.2 by default, extensible health-checks
- version 2.1 : improved I/Os and multi-threading, FastCGI, runtime certificate updates, HTX-only, improved debugging, removal of obsolete keywords
- version 2.0 : gRPC, layer 7 retries, process manager, SSL peers, log load balancing/sampling, end-to-end TCP fast-open, automatic settings (maxconn, threads, HTTP reuse, pools), ..
- version 1.9 : improved multi-threading, end-to-end HTTP/2, connection pools, queue priority control, stdout logging, ..
- version 1.8 : multi-threading, HTTP/2, cache, on-the fly server addition/removal, seamless reloads, DNS SRV, hardware SSL engines, ..
- version 1.7 : added server hot reconfiguration, content processing agents, multi-type certs, ..
- version 1.6 : added DNS resolution support, HTTP connection multiplexing, full stick-table replication, stateless compression, ..
- version 1.5 : added SSL, IPv6, keep-alive, DDoS protection, ..
Main features
Supported platforms
- Linux 2.4 on x86, x86_64, Alpha, Sparc, MIPS, PARISC
- Linux 2.6-5.x on x86, x86_64, ARM, AARCH64, MIPS, Sparc, PPC64
- Solaris 8/9 on UltraSPARC 2 and 3
- Solaris 10 on Opteron and UltraSPARC
- FreeBSD 4.10 - current on x86
- OpenBSD 3.1 to -current on i386, amd64, macppc, alpha, sparc64 and VAX (check the ports)
- AIX 5.1 - 5.3 on Power™ architecture
Highest performance is achieved with modern operating systems supporting scalable polling mechanisms such as epoll on Linux 2.6/3.x or kqueue on FreeBSD and OpenBSD. This requires haproxy version newer than 1.2.5. Fast data transfers are made possible on Linux 3.x using TCP splicing and haproxy 1.4 or 1.5. Forwarding rates of up to 40 Gbps have already been achieved on such platforms after a very careful tuning. While Solaris and AIX are supported, they should not be used if extreme performance is required.
Current typical 1U servers equipped with a dual-core Opteron or Xeon generally achieve between 15000 and 40000 hits/s and have no trouble saturating 2 Gbps under Linux.
Performance
[ warning: information in this section dates 2007, things have improved by an order of magnitude since then ]
Well, since a user's testimony is better than a long demonstration, please take a look at Chris Knight's experience with haproxy saturating a gigabit fiber in 2007 on a video download site. Since then, the performance has significantly increased and the hardware has become much more capable, as my experiments with Myricom's 10-Gig NICs have shown two years later. Now as of 2014, 10-Gig NICs are too limited and are hardly suited for 1U servers since they do rarely provide enough port density to reach speeds above 40-60 Gbps in a 1U server. 100-Gig NICs are coming and I expect to run new series of tests when they are available.
Well, since a user's testimony is better than a long demonstration, please take a look at Chris Knight's experience with haproxy saturating a gigabit fiber in 2007 on a video download site. Since then, the performance has significantly increased and the hardware has become much more capable, as my experiments with Myricom's 10-Gig NICs have shown two years later. Now as of 2014, 10-Gig NICs are too limited and are hardly suited for 1U servers since they do rarely provide enough port density to reach speeds above 40-60 Gbps in a 1U server. 100-Gig NICs are coming and I expect to run new series of tests when they are available.
HAProxy involves several techniques commonly found in Operating Systems architectures to achieve the absolute maximal performance :
- a single-process, event-driven model considerably reduces the cost of context switch and the memory usage. Processing several hundreds of tasks in a millisecond is possible, and the memory usage is in the order of a few kilobytes per session while memory consumed in preforked or threaded servers is more in the order of megabytes per process.
- O(1) event checker on systems that allow it (Linux and FreeBSD) allowing instantaneous detection of any event on any connection among tens of thousands.
- Delayed updates to the event checker using a lazy event cache ensures that we never update an event unless absolutely required. This saves a lot of system calls.
- Single-buffering without any data copy between reads and writes whenever possible. This saves a lot of CPU cycles and useful memory bandwidth. Often, the bottleneck will be the I/O busses between the CPU and the network interfaces. At 10-100 Gbps, the memory bandwidth can become a bottleneck too.
- Zero-copy forwarding is possible using the splice() system call under Linux, and results in real zero-copy starting with Linux 3.5. This allows a small sub-3 Watt device such as a Seagate Dockstar to forward HTTP traffic at one gigabit/s.
- MRU memory allocator using fixed size memory pools for immediate memory allocation favoring hot cache regions over cold cache ones. This dramatically reduces the time needed to create a new session.
- Work factoring, such as multiple accept() at once, and the ability to limit the number of accept() per iteration when running in multi-process mode, so that the load is evenly distributed among processes.
- CPU-affinity is supported when running in multi-process mode, or simply to adapt to the hardware and be the closest possible to the CPU core managing the NICs while not conflicting with it.
- Tree-based storage, making heavy use of the Elastic Binary tree I have been developping for several years. This is used to keep timers ordered, to keep the runqueue ordered, to manage round-robin and least-conn queues, to look up ACLs or keys in tables, with only an O(log(N)) cost.
- Optimized timer queue : timers are not moved in the tree if they are postponed, because the likeliness that they are met is close to zero since they're mostly used for timeout handling. This further optimizes the ebtree usage.
- optimized HTTP header analysis : headers are parsed an interpreted on the fly, and the parsing is optimized to avoid an re-reading of any previously read memory area. Checkpointing is used when an end of buffer is reached with an incomplete header, so that the parsing does not start again from the beginning when more data is read. Parsing an average HTTP request typically takes half a microsecond on a fast Xeon E5.
- careful reduction of the number of expensive system calls. Most of the work is done in user-space by default, such as time reading, buffer aggregation, file-descriptor enabling/disabling.
- Content analysis is optimized to carry only pointers to original data and never copy unless the data needs to be transformed. This ensures that very small structures are carried over and that contents are never replicated when not absolutely necessary.
All these micro-optimizations result in very low CPU usage even on moderate loads. And even at very high loads, when the CPU is saturated, it is quite common to note figures like 5% user and 95% system, which means that the HAProxy process consumes about 20 times less than its system counterpart. This explains why the tuning of the Operating System is very important. This is the reason why we ended up building our own appliances, in order to save that complex and critical task from the end-user.
In production, HAProxy has been installed several times as an emergency solution when very expensive, high-end hardware load balancers suddenly failed on Layer 7 processing. Some hardware load balancers still do not use proxies and process requests at the packet level and have a great difficulty at supporting requests across multiple packets and high response times because they do no buffering at all. On the other side, software load balancers use TCP buffering and are insensible to long requests and high response times. A nice side effect of HTTP buffering is that it increases the server's connection acceptance by reducing the session duration, which leaves room for new requests.
There are 3 important factors used to measure a load balancer's performance :
- The session rate
This factor is very important, because it directly determines when the load balancer will not be able to distribute all the requests it receives. It is mostly dependant on the CPU. Sometimes, you will hear about requests/s or hits/s, and they are the same as sessions/s in HTTP/1.0 or HTTP/1.1 with keep-alive disabled. Requests/s with keep-alive enabled is generally much higher (since it significantly reduces system-side work) but is often meaningless for internet-facing deployments since clients often open a large amount of connections and do not send many requests per connection on avertage. This factor is measured with varying object sizes, the fastest results generally coming from empty objects (eg: HTTP 302, 304 or 404 response codes). Session rates around 100,000 sessions/s can be achieved on Xeon E5 systems in 2014. - The session concurrency
This factor is tied to the previous one. Generally, the session rate will drop when the number of concurrent sessions increases (except with the epoll or kqueue polling mechanisms). The slower the servers, the higher the number of concurrent sessions for a same session rate. If a load balancer receives 10000 sessions per second and the servers respond in 100 ms, then the load balancer will have 1000 concurrent sessions. This number is limited by the amount of memory and the amount of file-descriptors the system can handle. With 16 kB buffers, HAProxy will need about 34 kB per session, which results in around 30000 sessions per GB of RAM. In practise, socket buffers in the system also need some memory and 20000 sessions per GB of RAM is more reasonable. Layer 4 load balancers generally announce millions of simultaneous sessions because they need to deal with the TIME_WAIT sockets that the system handles for free in a proxy. Also they don't process any data so they don't need any buffer. Moreover, they are sometimes designed to be used in Direct Server Return mode, in which the load balancer only sees forward traffic, and which forces it to keep the sessions for a long time after their end to avoid cutting sessions before they are closed. - The data forwarding rate
This factor generally is at the opposite of the session rate. It is measured in Megabytes/s (MB/s), or sometimes in Gigabits/s (Gbps). Highest data rates are achieved with large objects to minimise the overhead caused by session setup and teardown. Large objects generally increase session concurrency, and high session concurrency with high data rate requires large amounts of memory to support large windows. High data rates burn a lot of CPU and bus cycles on software load balancers because the data has to be copied from the input interface to memory and then back to the output device. Hardware load balancers tend to directly switch packets from input port to output port for higher data rate, but cannot process them and sometimes fail to touch a header or a cookie. Haproxy on a typical Xeon E5 of 2014 can forward data up to about 40 Gbps. A fanless 1.6 GHz Atom CPU is slightly above 1 Gbps.
A load balancer's performance related to these factors is generally announced for the best case (eg: empty objects for session rate, large objects for data rate). This is not because of lack of honnesty from the vendors, but because it is not possible to tell exactly how it will behave in every combination. So when those 3 limits are known, the customer should be aware that it will generally perform below all of them. A good rule of thumb on software load balancers is to consider an average practical performance of half of maximal session and data rates for average sized objects.
You might be interested in checking the 10-Gigabit/s page.
Reliability - keeping high-traffic sites online since 2002
Security - Not even one intrusion in 13 years
HAProxy also provides regex-based header control. Parts of the request, as well as request and response headers can be denied, allowed, removed, rewritten, or added. This is commonly used to block dangerous requests or encodings (eg: the Apache Chunk exploit), and to prevent accidental information leak from the server to the client. Other features such as Cache-control checking ensure that no sensible information gets accidentely cached by an upstream proxy consecutively to a bug in the application server for example.
Download
- Development version (2.2) :
- Browse directory for docs, sources and binaries
- Daily snapshots are built once a day when the GIT repository changes
- Latest LTS version (2.2) :
- Release Notes for version 2.2.4
- haproxy-2.2.4.tar.gz (MD5) : Source code under GPL
- Browse directory for other files or versions
- Previous version (2.1) :
- Release Notes for version 2.1.9
- haproxy-2.1.9.tar.gz (MD5) : Source code under GPL
- Browse directory for other files or versions
- Previous LTS version (2.0) :
- Release Notes for version 2.0.18
- haproxy-2.0.18.tar.gz (MD5) : Source code under GPL
- Browse directory for other files or versions
- Previous version (1.9) :
- Release Notes for version 1.9.16
- haproxy-1.9.16.tar.gz (MD5) : Source code under GPL
- Browse directory for other files or versions
- Previous version (1.8) :
- Release Notes for version 1.8.26
- haproxy-1.8.26.tar.gz (MD5) : Source code under GPL
- Browse directory for other files or versions
- Older version (1.7) :
- Release Notes for version 1.7.12
- haproxy-1.7.12.tar.gz (MD5) : Source code under GPL
- Browse directory for other files or versions
- Older version (1.6) :
- Release Notes for version 1.6.15
- haproxy-1.6.15.tar.gz (MD5) : Source code under GPL
- Browse directory for other files or versions
- Oldest version (1.5) :
- Release Notes for version 1.5.19
- haproxy-1.5.19.tar.gz (MD5) : Source code under GPL
- Browse directory for other files or versions
- Unmaintained version (1.4) :
- Release Notes for version 1.4.27
- haproxy-1.4.27.tar.gz (MD5) : Source code under GPL
- haproxy-1.4.26-linux-i586.gz : (MD5) Linux/i586 executable linked with Glibc 2.2
- haproxy-1.4.26-pcre-solaris-sparc.notstripped.gz : (MD5) Solaris8/Sparc executable
- Browse directory for other files or versions
- Unmaintained version (1.3) :
- Release Notes for version 1.3.28
- haproxy-1.3.28.tar.gz (MD5) : Source code under GPL
- haproxy-1.3.27-linux-i586.gz : (MD5) Linux/i586 executable linked with Glibc 2.2
- haproxy-1.3.27-pcre-solaris-sparc.notstripped.gz : (MD5) Solaris8/Sparc executable
- Browse directory for other files or versions
- Unmaintained branch (1.2) :
- Release Notes for version 1.2.18
- haproxy-1.2.18.tar.gz (MD5) : Source code under GPL
- haproxy-1.2.18-linux-i586.gz : (MD5) Linux/i586 executable linked with Glibc 2.2
- haproxy-1.2.18-sol8-ultrasparc-static-pcre.gz : (MD5) Solaris8/Sparc executable
- Browse directory for other files or versions
- Various Patches :
- Some patches for Stunnel by HAProxy Technologies (formerly Exceliance), such X-Forwarded-For, send-proxy, unix-sockets, multi-process SSL session synchronization, transparent binding and performance improvements.
- http://www.haproxy.com/download/free/patches/linux/epoll-2.4/ : kernel patches to enable epoll on standard Linux 2.4 kernels and on Red Hat Enterprise Linux 3.
- HAProxy Technologies' public patch repository for other patches (stud, stunnel, linux, keepalived, ..)
- Browse directory for other (outdated) patches.
- Browsable directory for other files (not only patches)
Documentation
- Reference Manual for version 2.3 (development) :
- Starter guide in HTML (up to date, maintained by Cyril Bonté)
- Configuration Manual in HTML (up to date, maintained by Cyril Bonté)
- Management Guide in HTML (up to date, maintained by Cyril Bonté)
- Lua reference manual in HTML (up to date, maintained by Thierry Fournier)
- Lua Architecture in HTML (up to date, maintained by Thierry Fournier)
- intro.txt : Starter guide in text format
- management.txt : Management guide in text format
- configuration.txt : Configuration Manual in text format
- Browsable directory : Various other docs and diagrams
- Reference Manual for version 2.2 (Stable) :
- Starter guide in HTML (up to date, maintained by Cyril Bonté)
- Configuration Manual in HTML (up to date, maintained by Cyril Bonté)
- Management Guide in HTML (up to date, maintained by Cyril Bonté)
- Lua reference manual in HTML (up to date, maintained by Thierry Fournier)
- Lua Architecture in HTML (up to date, maintained by Thierry Fournier)
- intro.txt : Starter guide in text format
- management.txt : Management guide in text format
- configuration.txt : Configuration Manual in text format
- Browsable directory : Various other docs and diagrams
- Reference Manual for version 2.1 (Stable) :
- Starter guide in HTML (up to date, maintained by Cyril Bonté)
- Configuration Manual in HTML (up to date, maintained by Cyril Bonté)
- Management Guide in HTML (up to date, maintained by Cyril Bonté)
- Lua reference manual in HTML (up to date, maintained by Thierry Fournier)
- Lua Architecture in HTML (up to date, maintained by Thierry Fournier)
- intro.txt : Starter guide in text format
- management.txt : Management guide in text format
- configuration.txt : Configuration Manual in text format
- Browsable directory : Various other docs and diagrams
- Reference Manual for version 2.0 (Stable (LTS)) :
- Starter guide in HTML (up to date, maintained by Cyril Bonté)
- Configuration Manual in HTML (up to date, maintained by Cyril Bonté)
- Management Guide in HTML (up to date, maintained by Cyril Bonté)
- Lua reference manual in HTML (up to date, maintained by Thierry Fournier)
- Lua Architecture in HTML (up to date, maintained by Thierry Fournier)
- intro.txt : Starter guide in text format
- management.txt : Management guide in text format
- configuration.txt : Configuration Manual in text format
- Browsable directory : Various other docs and diagrams
- Reference Manual for version 1.9 (unmaintained) :
- Starter guide in HTML (up to date, maintained by Cyril Bonté)
- Configuration Manual in HTML (up to date, maintained by Cyril Bonté)
- Management Guide in HTML (up to date, maintained by Cyril Bonté)
- Lua reference manual in HTML (up to date, maintained by Thierry Fournier)
- Lua Architecture in HTML (up to date, maintained by Thierry Fournier)
- intro.txt : Starter guide in text format
- management.txt : Management guide in text format
- configuration.txt : Configuration Manual in text format
- Browsable directory : Various other docs and diagrams
- Reference Manual for version 1.8 (Stable (LTS)) :
- Starter guide in HTML (up to date, maintained by Cyril Bonté)
- Configuration Manual in HTML (up to date, maintained by Cyril Bonté)
- Management Guide in HTML (up to date, maintained by Cyril Bonté)
- Lua reference manual in HTML (up to date, maintained by Thierry Fournier)
- Lua Architecture in HTML (up to date, maintained by Thierry Fournier)
- intro.txt : Starter guide in text format
- management.txt : Management guide in text format
- configuration.txt : Configuration Manual in text format
- Browsable directory : Various other docs and diagrams
- Reference Manual for version 1.7 (Critical fixes only) :
- Starter guide in HTML (up to date, maintained by Cyril Bonté)
- Configuration Manual in HTML (up to date, maintained by Cyril Bonté)
- Management Guide in HTML (up to date, maintained by Cyril Bonté)
- Lua reference manual in HTML (up to date, maintained by Thierry Fournier)
- Lua Architecture in HTML (up to date, maintained by Thierry Fournier)
- intro.txt : Starter guide in text format
- management.txt : Management guide in text format
- configuration.txt : Configuration Manual in text format
- Browsable directory : Various other docs and diagrams
- Reference Manual for version 1.6 (Critical fixes only) :
- Starter guide in HTML (up to date, maintained by Cyril Bonté)
- Configuration Manual in HTML (up to date, maintained by Cyril Bonté)
- Management Guide in HTML (up to date, maintained by Cyril Bonté)
- Lua reference manual in HTML (up to date, maintained by Thierry Fournier)
- Lua Architecture in HTML (up to date, maintained by Thierry Fournier)
- intro.txt : Starter guide in text format
- configuration.txt : Configuration Manual in text format
- management.txt : Management guide in text format
- Browsable directory : Various other docs and diagrams
- Reference Manual for version 1.5 (unmaintained) :
- Configuration Manual in HTML (up to date, maintained by Cyril Bonté)
- configuration.txt : Configuration Manual in text format
- Browsable directory : Various other docs and diagrams
- Reference Manual for version 1.4 (unmaintained) :
- Configuration Manual in HTML (up to date, maintained by Cyril Bonté)
- configuration.txt : Configuration Manual in text format
- Browsable directory : Various other docs and diagrams
- Reference Manual for version 1.3 (unmaintained) :
- configuration.txt : Configuration Manual
- architecture.txt : Architecture Guide
- haproxy-en.txt : old English version, outdated
- haproxy-fr.txt : old French version, outdated
- Browsable directory : Various other docs and diagrams
- Reference Manual for version 1.2 (unmaintained) :
- haproxy-en.txt : English version
- haproxy-fr.txt : French version
- Reference Manual for version 1.1 (unmaintained) :
- haproxy-en.txt : English version
- haproxy-fr.txt : French version
- architecture.txt : Architecture Guide
- Article on Load Balancing (HTML version) : worth reading for people who don't know what type of load balancer they need
In addition to Cyril's HTML converter above, an automated format converter is being developed by Pavel Lang. At the time of writing these lines, it is able to produce a PDF from the documentation, and some heavy work is ongoing to support other output formats. Please consult the project's page for more information. Here's an example of what it is able to do on version 1.5 configuration manual.
Commercial Support and availability
- contact HAProxy Technologies to hire some professional services or subscribe a support contract ;
- install HAProxy Enterprise Edition (HAPEE), which is a long-term maintained HAProxy package accompanied by a well-polished collection of software, scripts, configuration files and documentation which significantly simplifies the setup and maintenance of a completely operational solution ; it is particularly suited to Cloud environments where deployments must be fast.
- try an ALOHA appliance (hardware or virtual), which will even save you from having to worry about the system, hardware and from managing a Unix-like system.
Add-on features and contributions
- sFlow support
Neil Mckee posted a patch to the list in early 2013, and unfortunately this patch did not receive any sign of interest nor feedback, which is sad considering the amount of work that was done. I personally am clueless about sFlow and expressed my skepticism to Neil about the benefits of sampling some HTTP traffic when you can get much more detailed informations for free with existing logs.
Neil kindly responded with the following elements :
- I agree that the logging you already have in haproxy is more flexible and detailed, and I acknowledge that the benefit of exporting sFlow-HTTP records is not immediately obvious.
The value that sFlow brings is that the measurements are standard, and are designed to integrate seamlessly with sFlow feeds from switches, routers, servers and applications to provide a comprehensive end to end picture of the performance of large scale multi-tier systems. So the purpose is not so much to troubleshoot haproxy in isolation, but to analyze the performance of the whole system that haproxy is part of.
Perhaps the best illustration of this is the 1-in-N sampling feature. If you configure sampling.http to be, say, 1-in-400 then you might only see a handful of sFlow records per second from an haproxy instance, but that is enough to tell you a great deal about what is going on -- in real time. And the data will not bury you even if you have a bank of load-balancers, hundreds of web-servers, a huge memcache-cluster and a fast network interconnect all contributing their own sFlow feeds to the same analyzer.
Even after that explanation, no discussion emerged on the subject on the list, so I guess there is little interest among users for now. I suspect that sFlow is probably more deployed among network equipments than application layer equipments, which could explain this situation. The code is large (not huge though) and I am not convinced about the benefits of merging it and maintaining it if nobody shows even a little bit of interest. Thus for now I prefer to leave it out of tree. Neil has posted it on GitHub here : https://github.com/sflow/haproxy.
Please, if you do use this patch, report your feedback to the mailing list, and invest some time helping with the code review and testing.
This table enumerates all known significant contributions that led to version 1.4, as well as proposed fundings and features yet to be developped but waiting for spare time. It is not more up to date though. Wifispoof 3 4 8 x 4.
Contexts 3 2 0 – Fast Window Switcher Panels
Some older code contributions which possibly do not appear in the table above are still listed here.
- Application CookiesAleksandar Lazic and Klaus Wagner implemented this feature which was merged in 1.2. It allows the proxy to learn cookies sent by the server to the client, and to find it back in the URL to direct the client to the right server. The learned cookies are automatically purged after some inactive time.
- Least Connections load balancing algorithmThis patch for haproxy-1.2.14 was submitted by Oleksandr Krailo. It implements a basic least connection algorithm. I've not merged this version into 1.3 because of scalability concerns, but I'm leaving it here for people who are tempted to include it into version 1.2, and the patch is really clean.
- haproxy-1.2.14-leastconn.diff
- Soft Server-StopAleksandar Lazic sent me this patch against 1.1.28 which in fact does two things. The first interesting part allows one to write a file enumerating servers which will have to be stopped, and then sending a signal to the running proxy to tell it to re-read the file and stop using these servers. This will not be merged into mainline because it has indirect implications on security since the running process will have to access a file on the file-system, while current version can run in a chrooted, empty, read-only directory. What is really needed is a way to send commands to the running process. However, I understand that some people might need this feature, so it is provided here. The second part of the patch has been merged. It allowed both an active and a backup server to share a same cookie. This may sound obvious but it was not possible earlier.
- haproxy_comafile+multi-cookie.diff
Usage: Aleks says that you just have to write the server names that you want to stop in the file, then kill -USR2 the running process. I have not tested it though. - Server WeightSébastien Brize sent me this patch against 1.1.27 which adds the 'weight' option to a server to provide smoother balancing between fast and slow servers. It is available here because there may be other people looking for this feature in version 1.1.
I did not include this change because it has a side effect that with high or unequal weights, some servers might receive lots of consecutive requests. A different concept to provide a smooth and fair balancing has been implemented in 1.2.12, which also supports weighted hash load balancing.- patch-haproxy-1.1.27-weight
Usage: specify 'weight X' on a server line.
Note: configurations written with this patch applied will normally still work with future 1.2 versions. - IPv6 support for 1.1.27I implemented IPv6 support on client side for 1.1.27, and merged it into haproxy-1.2. Anyway, the patch is still provided here for people who want to experiment with IPv6 on HAProxy-1.1.
- haproxy-1.1.27-ipv6.diff
- Other patchesPlease browse the directory for other useful contributions.
Other Solutions
- Linux Virtual Servers (LVS)
Very fast layer 3/4 load balancing merged in Linux 2.4 and 2.6 kernels. Should be coupled with Keepalived to monitor servers. This generally is the solution embedded by default in most IP-based load balancers. - Nginx ('engine X')
Nginx is an excellent piece of software. Initially it's a very fast and reliable web server, but it has grown into a full-featured proxy which can also offer load-balancing capabilities. Nginx's load balancing features are less advanced than haproxy's but it can do extra things (eg: caching, running FCGI apps), which explains why they are very commonly found together. I strongly recommend it to whoever needs a fast, reliable and flexible web server ! - Pound
Pound is very small and reasonably good. It aims at remaining small and auditable prior to being fast. It used to support SSL and keep-alive before HAProxy. Its configuration file is small and simple. It's thread-based, but can be a simpler alternative to HAProxy for a small site when the flexibility and performance of HAProxy are not required. - Pen
Pen is a very simple load balancer for TCP protocols. It supports source IP-based persistence for up to 2048 clients. Supports IP-based ACLs. Uses select() and supports higher loads than Pound but will not scale very well to thousands of simultaneous connections. It's more versatile however, and could be considered as the missing link between HAProxy and socat.
Contacts
- mailing-list :
Read the list archives on mail-archive
Read the list archives on Marc.info(temporarily broken)
Read the list archives on gmane.org(temporarily broken)
Subscribe to the list :
Unsubscribe from the list : - Willy' main site : http://1wt.eu/
- This site in IPv6 only : http://ipv6.haproxy.org/ (should be OK if you see a green square here ⇒ )
- e-mail :
Contexts 3 2 0 – Fast Window Switcher Panel Installation
Some people regularly ask if it is possible to send donations, so I have set up a Paypal account for this. Click here if you want to donate.
An IRC channel for haproxy has been opened on FreeNode (but don't seek me there, I'm not) :
- irc://irc.gnu.org/%23haproxy
- https://slack.haproxy.org/
External links
- Linux networking stack from the ground up (parts 1-5) (useful to whoever wants to know what happens below haproxy)