@sgiehl opened this Issue on June 29th 2010 Member

One of our customers is using piwik on a high traffic website. To handle all the request there are two nodes with piwik behind a loadbalancer.

There are some problems appearing with this system configuration. When changes are made to plugins, the settings are stored in the local config file. But this happens only on the machine the request has been sent to. So plugins are active only on one of the two machines.

This also brings problems when installing new plugins, that try to make database changes in install method.

@mattab commented on June 29th 2010 Member

This is a known bug - users with multiple boxes would have to rsync the config files over, and purge tmp/*

The config file is necessary to store Super user settings and allow override of other settings from global.ini.php

can you think of a solution that we could implement in Piwik to make it a non issue, or is it a won't fix?

@robocoder commented on June 29th 2010 Contributor

Use bootstrap.php to define PIWIK_USER_PATH -- and point it at a shared network directory to host the config and tmp folders.

Future idea:

  • post an event when config file or cache files are removed/updated.
  • add a plugin that:
    • keeps track of the machines in the cluster
    • listens for the event and notifies other machines in the cluster via a REST API method
    • has a REST API method to invalidate its cache (eg software update) or specific cache files (eg cache/tracker)
@anonymous-piwik-user commented on June 29th 2010

Well, as I'm having the same issue I wouldn't recommend to build some complex thing like tracking machines in a cluster and pushing changes to it.
Just do some simple things:

  • to avoid session issues on login use some other session backend like memcache (can be done on the user side, not your part to change that)
  • store settings which change during runtime like enabled/disabled plugins in the database (I currently just reload the site over and over until all nodes picked up the change). Usually only installation critical settings like database settings are stored in the files.
@robocoder commented on June 29th 2010 Contributor

Pushing an update requires less resources.

If we move the config (except db connection info and maybe superuser), we'd have to maintain lastModified timestamps for the config and site tables, so machines could determine if they need to refresh cache files or not. Adding this query to the tracker would impair tracker performance.

The session issue is covered by another ticket.

@mattab commented on July 29th 2010 Member

I think a wont fix for now. It makes sense to tie config file to enabled plugins and database infos.

This Issue was closed on July 29th 2010
Powered by GitHub Issue Mirror