Tidy the lining up of a message; add documentation.

This commit is contained in:
counterpoint 2015-06-24 14:39:13 +01:00
parent dfbb42ead9
commit ced5c67338
4 changed files with 84 additions and 5 deletions

View File

@ -460,6 +460,21 @@ The `socket` option may be included in a listener definition, this configures th
If a socket option and an address option is given then the listener will listen on both the specific IP address and the Unix socket.
#### `persistpoolmax`
The `persistpoolmax` parameter defaults to zero but can be set to an integer value for a back end server.
If it is non zero, then when a DCB connected to a back end server is discarded by the
system, it will be held in a pool for reuse, remaining connected to the back end server.
If the number of DCBs in the pool has reached the value given by `persistpoolmax` then
any further DCB that is discarded will not be retained, but disconnected and discarded.
#### `persistmaxtime`
The `persistmaxtime` parameter defaults to zero but can be set to an integer value
indicating a number of seconds. A DCB placed in the persistent pool for a server will
only be reused if the elapsed time since it joined the pool is less than the given
value. Otherwise, the DCB will be discarded and the connection closed.
### Filter
Filters provide a means to manipulate or process requests as they pass through MaxScale between the client side protocol and the query router. A filter should be defined in a section with a type of filter.

View File

@ -314,10 +314,25 @@ It is possible to see more details regarding a given server using the show serve
Port: 3307
Server Version: 5.5.25-MariaDB-log
Node Id: 124
Number of connections: 0
Current no. of conns: 0
Number of connections: 0
Current no. of conns: 0
Current no. of operations: 0
MaxScale>
If the server has a non-zero value set for the server configuration item "persistpoolmax",
then additional information will be shown:
Persistent pool size: 1
Persistent measured pool size: 1
Persistent pool max size: 10
Persistent max time (secs): 3660
The distinction between pool size and measured pool size is that the first is a
counter that is updated when operations affect the persistent connections pool,
whereas the measured size is the result of checking how many persistent connections
are currently in the pool. It can be slightly different, since any expired
connections are removed during the check.
## Setting The State Of A Server
MaxScale maintains a number of status bits for each server that is configured, these status bits are normally maintained by the monitors, there are two commands in the user interface that are used to manually maintain these bits also; the set server and clear server commands.
@ -358,6 +373,13 @@ All status bits, with the exception of the maintenance bit, will be set by the m
MaxScale> clear server server3 maintenance
MaxScale>
## Viewing the persistent pool of DCB
The DCBs that are in the pool for a particular server can be displayed (in the
format described below in the DCB section) with a command like:
MaxScale> show persistent server1
# Working With Sessions
The MaxScale session represents the state within MaxScale. Sessions are dynamic entities and not named in the configuration file, this means that sessions can not be easily named within the user interface. The sessions are referenced using ID values, these are actually memory address, however the important thing is that no two session have the same ID.
@ -448,6 +470,10 @@ The details of an individual DCB can be obtained by use of the show dcb command
MaxScale> show dcb 0x727900
DCB: 0x727900
DCB state: DCB in the polling loop
Username: somename
Protocol: MySQLBackend
Server Status: Master, running
Role: Request Handler
Connected to: 127.0.0.1
Owning Session: 0x727da0
Statistics:
@ -457,8 +483,14 @@ The details of an individual DCB can be obtained by use of the show dcb command
No. of Accepts: 0
No. of High Water Events: 0
No. of Low Water Events: 0
Added to persistent pool: Jun 24 09:09:56
MaxScale>
The information Username, Protocol, Server Status are not
always relevant, and will not be shown when they are null.
The time the DCB was added to the persistent pool is only shown
for a DCB that is in a persistent pool.
# Working with Filters
Filters allow the request contents and result sets from a database to be modified for a client connection, pipelines of filters can be created between the client connection and MaxScale router modules.

View File

@ -6,7 +6,8 @@ The purpose of this tutorial is to introduce the MaxScale Administrator to a few
[Starting MaxScale](#starting)
[Stopping MaxScale](#stopping)
[Checking The Status Of The MaxScale Services](#checking)
[Checking The Status Of The MaxScale Services](#checking)
[Persistent Connections](#persistent)
[What Clients Are Connected To MaxScale](#clients)
[Rotating Log Files](#rotating)
[Taking A Database Server Out Of Use](#outofuse)
@ -94,6 +95,37 @@ It is possible to use the maxadmin command to obtain statistics regarding the se
It should be noted that network listeners count as a user of the service, therefore there will always be one user per network port in which the service listens. More detail can be obtained by use of the "show service" command which is passed a service name.
<a name="persistent"></a>
### Persistent Connections
Where the clients who are accessing a database system through MaxScale make frequent
short connections, there may be a benefit from invoking the MaxScale Persistent
Connection feature. This is controlled by two configuration values that are specified
per server in the relevant server section of the configuration file. The configuration
options are `persistpoolmax` and `persistmaxtime`.
Normally, when a client connection is terminated, all the related back end database
connections are also terminated. If the `persistpoolmax` options is set to a non-zero
integer, then up to that number of connections will be kept in a pool for that
server. When a new connection is requested by the system to meet a new client request,
then a connection from the pool will be used if possible.
The connection will only be taken from the pool if it has been there for no more
than `persistmaxtime` seconds. It was also be discarded if it has been disconnected
by the back end server. Connections will be selected that match the user name and
protocol for the new request.
Please note that because persistent connections have previously been in use, they
may give a different environment from a fresh connection. For example, if the
previous use of the connection issued "use mydatabase" then this setting will be
carried over into the reuse of the same connection. For many applications this will
not be noticeable, since each request will assume that nothing has been set and
will issue fresh requests such as "use" to establish the desired configuration. In
exceptional cases this feature could be a problem.
It is possible to have pools for as many servers as you wish, with configuration
values in each server section.
<a name="clients"></a>
### What Clients Are Connected To MaxScale

View File

@ -2219,7 +2219,7 @@ dprintOneDCB(DCB *pdcb, DCB *dcb)
struct tm * timeinfo;
timeinfo = localtime (&dcb->persistentstart);
strftime(buff, sizeof(buff), "%b %d %H:%M:%S", timeinfo);
dcb_printf(pdcb, "\t\tAdded to persistent pool: %s\n", buff);
dcb_printf(pdcb, "\t\tAdded to persistent pool: %s\n", buff);
}
}
/**
@ -2393,7 +2393,7 @@ dprintDCB(DCB *pdcb, DCB *dcb)
struct tm * timeinfo;
timeinfo = localtime (&dcb->persistentstart);
strftime(buff, sizeof(buff), "%b %d %H:%M:%S", timeinfo);
dcb_printf(pdcb, "\t\tAdded to persistent pool: %s\n", buff);
dcb_printf(pdcb, "\t\tAdded to persistent pool: %s\n", buff);
}
}