hourly_maint.php
is run at the top of each hour. It reloads
the shared memory segments that determine which creatives are assigned
to which sections and how many of each to run.
hourly_maint.php
daily_maint.php
if appropriateforce_daily
command-line option is specified), we'll call the daily maintenance
script, which will rebuild the DailyTargets table.
A large table is constructed. For each section S in the section tree, there is a hash. The keys to this hash are creative dimensions ('120x90', '468x60', etc.). The value associated with each key D is an array of CreativeIDs for all the creatives of dimensions D which are running on section S. The delivery engine will use this table to quickly acquire a list of all candidate creatives for a given section.
Example: suppose it is hour 22. You have said that you get on average 10,000 pageviews in hour 22 and 5,000 pageviews in hour 23. You have two active creatives. Creative 1 runs all hours of the day. Creative 2 runs hours 10 a.m. to 10 p.m. Each still needs 600 impressions before the end of the day. Creative 1 will be scheduled for
600 * 10,000 / (10,000 + 5,000) = 400 impressions
Creative 2, which does not run in hour 23, will be scheduled for
600 * 10,000 / (10,000) = 600 impressions
Creatives which do not have specific impression targets will be entered into the HourlyTargets shared memory if they are slated to run during the given hour.
For each active creative, four values are stored in the HourlyTargets shared memory segment: the hourly impression target, the weight of the creative, the number of impressions remaining, and the number of clicks delivered.
For creatives with impression targets, the number of impressions remaining is equal to the hourly impression target when the table is loaded. As impressions are delivered, this number decrements until it hits 0, at which point no more impressions are served.
For creatives without impression targets, the number of impressions remaining is 0 when the table is loaded. As impressions are delivered, this number goes negative.
The log file is slurped up and each entry is tallied. The result is that for each creative/section combination, a record is saved in the HourlyStats. Impressions, clicks, impression errors, and click errors are stored in the table. Reports are generated on the fly from these records.
In addition to the fairly detailed HourlyStats table, there is a table called CampaignDailyStats, which contains one record per campaign per day. This table exists for speed in generating invoices and the revenue report. You can't slice and dice the numbers like the HourlyStats, but it is a much more compact representation.
The contents of the log file are appended to the file
YYYY/MM-DD.log
in the directory specified by the LogDir
preference. During hour 0, yesterday's log file is gzipped. Note that
you can clean these files up at will; they are only there for your
reference.
hourly_maint.php
to the crontabThe job should run at the top of every hour, as so:
0 * * * * /path/to/oasis/mgmt/hourly_maint.php > /dev/null
hourly_maint.php
from the command-line
/path/to/oasis/mgmt/hourly_maint.php startThis will force the running of
daily_maint.php
, and
it will reload the hourly targets. It will not process the logs
or attempt to record any traffic from the previous hour. Use this
to start up OASIS after a reboot (and before you start your Web server).
/path/to/oasis/mgmt/hourly_maint.php force_dailyThis is the same as "start", but it also records the last hour's traffic.
/path/to/oasis/mgmt/hourly_maint.php reloadThis is basically the same as calling
hourly_maint.php
with
no arguments, but it won't call the daily maintenance script (even if
it is run during hour 0), and it won't run the inventory simulation
(even if it is run during hour 0). It will record the last hour's
traffic, process the logs, and reload the hourly targets.
/path/to/oasis/mgmt/hourly_maint.php stopThis method of invocation will run the script and record the last hour's traffic. It then clears shared memory and processes the log. It does not attempt to calculate any targets for the next hour. In fact, if
oasisi.php
runs after the shutdown process, it will not be
able to deliver anything.
You should run this immediately after shutting down your Web server. Note that you can safely stop your Web server at any time without doing anything to OASIS. But if you want to reboot the server, you should run 'stop' to record the last hour's data to disk first.
/path/to/oasis/mgmt/hourly_maint.php resumeThis method of invocation will not attempt to process logs or record the last hour's traffic. It will not try to clear shared memory. All it will do is reload shared memory. Use this after you've run 'stop', before restarting your Web server.
The difference between this method and the 'start' method is that 'start' will force a recalculation of daily targets. If you've been running and you stop the server only to decide to restart it, you can use 'resume'.