FAQ: Statistics for Multiple Sites
Can Sawmill generate separate analyses for all the web sites hosted on my server?
Yes, Sawmill includes a number of features for just this purpose.
Absolutely. This is one of our core design goals -- to make Sawmill a good choice for web hosting providers, ISPs, and others who serve multiple sites from a single server. Sawmill's profiles provide an excellent mechanism for generating different statistics for each customer or web site. If each site has its own log file(s), this is trivial; you can just make a profile that analyzes the appropriate log file. If all sites share a single log file, it's not much harder -- Sawmill's advanced filtering mechanism lets you easily ignore all log entries except those of interest to a particular web site.
The technique you use depends on your situation. In general, you will need to have a separate profile for each user (you can quickly create all of your profiles using the Create/Update Many Profiles feature). For maximum flexibility, each profile can have its own database, and each profile can be password-protected or secured in some other way, to prevent unauthorized users from accessing it. See Security for a discussion of some of the ways profiles can be secured. If each profile has its own database, then the log filters can be used to filter out all statistics except those belonging to the user.
If you don't care if users can access each others' statistics, you can use a single profile with a single database, and give each user a bookmark URL pointing to their statistics in the database; this is the simplest approach, but it makes it possible for one user to see another's statistics, which is usually undesirable.
Advantages of using a single database:
Faster log processing -- log data is read only once. This is particularly important when using an FTP log source with a log file containing the data for all profiles, because the log data will be fetched once per profile, so if you have 1000 profiles, this will use 1000 times more bandwidth. For local log files, this is not much if an issue, because Sawmill skips quickly over log entries it doesn't need, so it will only be spending real time on each log entry once.
Advantages of using multiple databases:
Smaller databases. Though Sawmill has to create many databases instead of one, generally the total disk usage will be smaller, because each database is tightly focused on its site, and does not need to keep around information that applies only to other sites. In one real-world example, the total database size shrunk by a factor of 200 when the customer switched from one database to many.
Faster statistics browsing. A small database is generally faster to browse than a large databases, so using multiple small databases will make the statistics faster.
More flexibility. Each profile can be configured separately, so you can have different cross-references, filters, database fields, etc. for different profiles. Using a single database locks you into a single database structure for all profiles.
In summary, you'll usually want to use multiple databases for multiple servers or sites. The main situation you'd want to use a single database for is if you're using FTP over a metered line to fetch the data; a single database will fetch it just once. Even then, though, you could set up an external script to fetch the log data to the local disk once, and then process it locally with Sawmill.