OProxy
From ISPWiki
oProxy is a proxy server that provides load balancing and high availability, and operates along with ISPmanager cluster. Its main functions include:
- Caching HTTP traffic, balancing load among servers, providing high-availability (enable/disable failed nodes automatically).
- Processing static requests without Apache.
- Caching Mysql-traffic, balancing load, providing fault-tolerance.
- Calculating outgoing and incoming HTTP traffic per site, calculating the number of requests and total response time.
- Calculating MySQL traffic per user, the number of requests and total response time.
- Executing commands (see clusterctl)
Contents |
Operating principle
The utility listens the TCP- or UNIX sockets specified by the configuration files (see oproxy.conf). All the nodes with HTTP or MySQL roles specified are taken from cluster_nodes.conf (see clusterctl). Proxy counts how many requests each node is currently processing. The one processing the fewest number of requests is selected. If your attempt to connect to this node fails, the node is marked as down for some seconds (this can be set in the configuration file). You keep on trying to connect to the next one, etc. If all the nodes are down, the connection will be broken.
Beside HTTP and MySQL cashing, the utility can listen to a special command socket, where the root user can run any command. See clusterctl.
Configuration
By default oProxy searches for the config in /usr/local/ispmgr/etc/oproxy.conf. For more information see oproxy.conf.
Start options
Usage: oproxy [keys] Keys: --config Path to the configuration file. Default is /usr/local/ispmgr/etc/oproxy.conf --version Print the version and exit. -help Display that list of options --help Display that list of options
Managing proxy-server
The oproxyctl utility was specially created for proxy-server management. For example, you need to use the following command to stop oProxy:
/usr/local/ispmgr/sbin/oproxyctl 'stop daemon'
The operation will be stopped (statistics will be reset, all the UNIX-sockets will be deleted, etc.)
Traffic
If the log_statistics_period value in oproxy.conf is below zero, traffic statistics will be stored in /usr/local/ispmgr/var/oproxy-traf.log. Alternatively, you can view it with the commands:
/usr/local/ispmgr/sbin/oproxyctl 'show traffic http'
or
/usr/local/ispmgr/sbin/oproxyctl 'show traffic mysql'
If your statistics is stored in the file, these commands will display the latest traffic information stored in this file.
