@@ -248,7 +248,6 @@ look like::
248
248
count-checkedout
249
249
count-connections
250
250
count-detached
251
- count-invalidated
252
251
count-numpools
253
252
count-numprocs
254
253
derive-checkouts
@@ -302,30 +301,6 @@ integers representing the current count of a resource or activity:
302
301
they have been disconnected from the engine/pool using the ``.detach() ``
303
302
method but are still being used as a database connection.
304
303
305
- * ``count-invalidated `` - total number of connections that have been **explicitly **
306
- invalidated, meaning, the ``.invalidate() `` method has been called
307
- individually for a connection. In this state, there may or may not be a
308
- database connection present for each of these, depending on if the
309
- invalidation was "hard" or "soft". Invalidation usually corresponds to a
310
- connection that reported a problem in being able to communicate with the
311
- database, and for which an error was raised. For this reason, the
312
- "invalidated" count should be considered to be roughly an "error" counter -
313
- each count here usually corresponds to a connectivity error encountered by
314
- the application to which it responded by invalidating the connection, which
315
- results either in immediate or eventual reconnection.
316
-
317
- For most invalidation scenarios, the entire pool of connections is
318
- invalidated at once using a "freshness" timestamp; any connection older than
319
- this timestamp is refreshed on next use. This is to suit the case of assuming
320
- that the database was probably restarted, so all connections need to be
321
- reconnected. These connections which have been **implicitly ** invalidated
322
- are **not ** included in this count.
323
-
324
- Since an invalidated connection is usually discarded immediately, this
325
- number as a running count should be very low, unless the database is down in
326
- which case you'll see a spike.The ``derive-invalidated `` value should be
327
- consulted as well which provides an ongoing *rate * of invalidation.
328
-
329
304
* ``count-numpools `` - the number of connection pools in use. A SQLAlchemy
330
305
``Engine `` features exactly one connection pool. If an application connects
331
306
to two different database URLs in a process and creates two different
@@ -364,7 +339,8 @@ on the reporting tools being used.
364
339
* ``derive-invalidated `` - rate of connections that are explicitly **invalidated **,
365
340
e.g. have encountered a connectivity error which made the program invalidate
366
341
the connection. The application may or may not have tried to connect
367
- again immediately depending on how it is using this feature.
342
+ again immediately depending on how it is using this feature. See the
343
+ section on "invalidated connections" below for details on this.
368
344
369
345
* ``derive-commits `` - (TODO: not implemented yet) rate of calls to ``transaction.commit() ``. This value
370
346
can be used to estimate TPS, e.g. transactions per second, however note that
@@ -380,19 +356,48 @@ on the reporting tools being used.
380
356
if the application also discards transactions and/or ``Session `` objects
381
357
without calling ``.commit() `` or ``.rollback() ``.
382
358
383
-
384
- .. topic Collectd types
385
-
386
- These funny names ``count-`` and ``derive-`` are an artifact of how
387
- collectd provides **types**. collectd has a fixed list of "types" which it
388
- lists in a file called ``types.db``. The server does not accept type names
389
- that are not either in this file or in a separately configured custom types file,
390
- as each type is accompanied by a template for what kinds of values it
391
- carries. Annoyingly, collectd does not let us add these names within the
392
- regular .conf file, which would make it very easy for us to include
393
- our own custom names; it instead requires they be listed in completely separate file that must be
394
- explicitly referred to by absolute path within a conf file, and then to
395
- make matters worse when this option is used, we have to uncomment the location
396
- of the default types.db file in the central collectd.conf else it will
397
- no longer be able to find it. Given the choice between "very nice names"
398
- and "no need to set up three separate config files", we chose the latter :)
359
+ Invalidated Connections
360
+ ^^^^^^^^^^^^^^^^^^^^^^^
361
+
362
+ The ``derive-invalidated `` stat records the rate of invalidations.
363
+
364
+ By invalidated, we mean the ``.invalidated() `` method on the connection
365
+ is called, which marks this connection as no longer usable and marks it
366
+ for refresh on next use (soft invalidation) or more commonly closes it
367
+ immediately (hard invalidation). Typically, when a connection is invalidated,
368
+ the application is either pre-pinging the database and will try to connect
369
+ again, or it was in the middle of an operation when the database got
370
+ cut off, in which case depending on how the application was designed it
371
+ may or may not try the operation again.
372
+
373
+ Invalidation usually corresponds to a
374
+ connection that reported a problem in being able to communicate with the
375
+ database, and for which an error was raised. For this reason, the
376
+ "invalidated" rate should be considered to be roughly an "error" rate -
377
+ each count here usually corresponds to a connectivity error encountered by the
378
+ application to which it responded by invalidating the connection, which results
379
+ either in immediate or eventual reconnection.
380
+
381
+ For most invalidation scenarios, the entire pool of connections is
382
+ invalidated at once using a "freshness" timestamp; any connection older than
383
+ this timestamp is refreshed on next use. This is to suit the case of assuming
384
+ that the database was probably restarted, so all connections need to be
385
+ reconnected. These connections which have been **implicitly ** invalidated
386
+ are **not ** included in this count.
387
+
388
+ Collectd Types
389
+ ^^^^^^^^^^^^^^^
390
+
391
+ These funny names ``count- `` and ``derive- `` are an artifact of how
392
+ collectd provides **types **. collectd has a fixed list of "types" which it
393
+ lists in a file called ``types.db ``. The server does not accept type names
394
+ that are not either in this file or in a separately configured custom types file,
395
+ as each type is accompanied by a template for what kinds of values it
396
+ carries. Annoyingly, collectd does not let us add these names within the
397
+ regular .conf file, which would make it very easy for us to include
398
+ our own custom names; it instead requires they be listed in completely separate file that must be
399
+ explicitly referred to by absolute path within a conf file, and then to
400
+ make matters worse when this option is used, we have to uncomment the location
401
+ of the default types.db file in the central collectd.conf else it will
402
+ no longer be able to find it. Given the choice between "very nice names"
403
+ and "no need to set up three separate config files", we chose the latter :)
0 commit comments