piwik服务器性能,piwik 大负载以及多域名监控隐藏piwik服务器原始域名解决方案...,看起来不错ÿ


1先说下多应用部署的事:

How do I setup Piwik to

track multiple websites, without showing the same common Piwik

server URL in the Javascript code in all the websites tracked by

this same Piwik server?

By default, the Piwik

Javascript code on all tracked websites contains the Piwik server

URL. This is fine for most users, but someone (eg. a competitor)

could run a script that would look at thousands or millions of

websites and search for your Piwik server URL in the source code of

these websites. This person could then find out all websites

tracked in your Piwik instance.

In some cases you might want to hide this Piwik URL completely

while still tracking all websites in your Piwik instance. It is

possible to do by modifying your Piwik Javascript code, and point

it to a "proxy piwik.php script" instead of your Piwik server URL.

This piwik.php script has to be uploaded on each of the websites

tracked, and will automatically "forward" all requests to your

secret Piwik server.

All documentation on how to

install this script is found in the script itself. Click here to view the instructions.

Follow the instructions

carefully and you

will then have all your websites tracked without revealing your

common Piwik URL, ensuring that nobody can find out the websites

tracked by Piwik!

他这个是官方对多个应用部署piwik的时候,采用的方案。看起来不错,但是每个应用都是都需要有php环境。(The

website to track must run on a server with PHP5

support)。

我的解决方案是:每台应用服务器修改host文件。Host对应piwik的内网ip地址。

这样有个小问题:piwik必须和所有的应用都部署在同一个机房。

2在说说大负载情况

Does Piwik work in a load

balanced environment? How do I setup Piwik for high scale

tracking?

There are many Piwik power

users using Piwik to track more than 200k pages per day, and use

Piwik to track thousands of websites, using simple

& more advanced setup. See this forum thread

for more details (feel free to post there if you are tracking more

than 100k pages per day!).

If you want to provide high

reliability and performance in your Piwik setup, you can load

balance Piwik services on various servers. It is pretty easy to

do so, but make sure you read the following documentation.

Piwik stores all tracking data, reports, users, settings, etc. in

the shared mysql database.

Piwik also uses files:

1) config/config.ini.php is used by every request to Piwik. It

contains db access, plugins enabled, various settings, etc.

This file must be synched on every Piwik server.

2) tmp/* contains temporary and cached files such as: compiled

templates, generated PDFs, tracking caches, etc.

This directory tmp/ content can be safely deleted and Piwik will

automatically recompile templates and recreate caches.

3) by default, Piwik uses file session storage, which are usually

stored in tmp/sessions, or in the global sessions directory (see

php.ini).

There is a config setting to enable database session storage,

see this

faq

When Piwik is used behind a

load balancer, here are the things to check:

1) synchronize config/config.ini.php on all servers - make

sure it is always the same everywhere.

2) delete the content in tmp/* on every new deploy (eg. when

upgrading Piwik or making plugin upgrades)

Piwik should then work as

expected in a load balanced environment.

For example, a common way to

load balance Piwik on 3 servers: Load balancer in front of (2x)

webservers which are tracking/querying the (1x) Master mysql DB

server.

For further optimization, a (1x) UI webserver can be added, to

handle all API requests, UI requests, and run the cron

archiving. This server can also be doubled and load

balanced.

Typically, webserver boxes would be cheap to operate servers, and

the Master DB server would be bigger (eg. multiple cores, 8G

memory, fast disk access), which could scale to a certain point

(around 1M pages per day).

他给出的建议是:

3台机器

两台做web server。

为了更好的优化,再增加一台UI server,提供给咱们自己浏览以及运行定时程序。

另外

数据库要好点(例如,多核 8G内存

快速的磁盘访问)等

这样的配置可以支撑每天100万的pv量级

相关内容