wiki:HitsProcessingModes

Hits handling strategies

FireStats supports several strategies to handle incoming hits

FS_COMMIT_IMMEDIATE

This is the slowest mode. each incoming hit is fully processed immediately. The advantage is that the hit is available in the statistics immediately.

FS_COMMIT_MANUAL

This is the fastest mode, each incoming hit is stored in the firestats_pending_data table. data stored in this table is not visible anywhere in FireStats and must be processed before it will appear.
To process the hits, the system administrator need to ensure the script php/commit-pending.php is called periodically. typical setup is to use a cron job and to call the script as frequently as possible (once an hour is a good choice).

This option requires MySQL 5.0 or newer.

FS_COMMIT_AUTOMATIC

This option is about half the speed of the FS_COMMIT_MANUAL option, but much more convenient:
FireStats will store hits in the firestats_pending_data table, but will commit the pending hits automatically every predefined number of seconds (FS_AUTOMATIC_COMMIT_INTERVAL_SECONDS), the default is 60 seconds. in effect, this method gives near real-time experience while maintaining good performance.

This option requires MySQL 5.0 or newer.

FS_COMMIT_BY_OPTION (default)

This is the default option. it allows the user to select between

  • Process immediatelly (FS_COMMIT_IMMEDIATE)
  • Buffer hits (FS_COMMIT_AUTOMATIC)

from the settings tab (through a user interface).
This option adds a slight overhead over pure FS_COMMIT_IMMEDIATE and FS_COMMIT_AUTOMATIC, but is allows FireStats to select the best option automatically based on the version of MySQL. (MySQL 5.0 or newer will use FS_COMMIT_AUTOMATIC and older will use FS_COMMIT_IMMEDIATE).

How to change the commit strategy

By default, the commit strategy is FS_COMMIT_BY_OPTION, which allows changing it through the settings tab. If you want to change to FS_COMMIT_MANUAL, or to otherwise get slightly better performance it's possible to set the strategy through the conf.php file (see sample-conf.php for more information)

Last modified 10 years ago Last modified on Apr 17, 2008, 5:13:07 AM