So, business is booming, and you are approaching your OpenX installation’s maximum capacity — you know this, because you measured your system capacity. You know that it’s time to scale your OpenX installation.
Or, perhaps you have no idea what you system’s maximum capacity is, but you have noticed that your system is a little bit slower than it used to be, and you think that scaling your OpenX installation might be a good idea.
How do you go about scaling an existing OpenX installation?
There are essentially two different options for doing this simply.
Vertical scaling
Vertical scaling is the easiest way of scaling your OpenX installation — simply upgrade your existing server (perhaps by adding more RAM or changing the hard drives so that they have faster I/O) or move your OpenX installation onto a larger, faster server.
Certainly, this will not be a hassle-free process — performing hardware upgrades or migrating services from one server to another are never going to The Guru’s idea of a fun day’s work — but if you currently run OpenX on a single server, then it can be comforting to know that, after you have completed a vertical upgrade, you will still have a familiar, single server setup.
Unfortunately, the main drawback with vertical scaling is that sooner or later, depending on your budget, it will simply become too expensive to perform a vertical upgrade.
Simple horizontal scaling
Simple horizontal scaling as an approach where OpenX is scaled horizontally (that is, over multiple servers) at the delivery/UI server level, but where there is still only one database.

Using this approach, there are only four things that are different from a single-server installation of OpenX that you need to worry about:
- Database access: In a single server installation, ensuring that OpenX can access the database is generally trivial, as all that is needed is a username/password. However, now that your delivery/UI servers are separate from the server that is running the database, you may need to update your database server’s accounts and/or permissions, to ensure that the OpenX code on the remote delivery/UI servers can connect to the database.
- Load balancing: To distribute the task of banner delivery and OpenX UI access across all of your delivery/UI servers, you will need some form of load balancing solution.
- Code synchronization: As OpenX is now installed on more than one server, you need to ensure that all servers remain synchronized with each other, so that when you make configuration changes, or perform an upgrade, you don’t end up with one (or more) of the servers in a different state from the others. This is relatively easy to achieve by using rsync, or a similar code synchronization system.
- Running maintenance: When OpenX is installed on more than one server, but you have a single, central database, it is important to ensure that only one server runs maintenance. Pick one of your delivery/UI servers, and set up maintenance to run on just that server. Disable maintenance from running on all the other servers. It’s even more important to run maintenance manually in this kind of setup, otherwise the issues of not doing so will be increased, as a result of having more delivery/UI servers!
Of course, with this form of simple horizontal scaling, the central database server can become a bottleneck. If this happens, you can either scale your database server vertically, or you will need to consider using OpenX’s “distributed statistics” mode for horizontal scaling, which allows the database load to be (partially) distributed across multiple servers — however, scaling OpenX in this was is most certainly not a simple means of scaling, and is a topic for another day…
A few days ago, the guys at isocket tweeted about a recent article in MarketingVOX. This article may be of interest to OpenX ad server users, in particular, this part:
Smaller online ads may be more effective than larger counterparts, a new study by Dynamic Logic found.
The study shows that ad shape and placement may be more important than size. Half banners, at 234 x 60, and 180 x 150 rectangles were shown to be more effective than ads that frame the page, like high-profile leaderboards and skyscrapers. It is possible that users no longer see such framing ads because they have developed “banner blindness.”
In addition, smaller ads may be more effective because they tend to be better incorporated into the content of Web pages.
If you’re an OpenX user, then you know how much easier OpenX makes your life when it comes to delivering banners into your web site(s). However, it’s important to remember that if you’re looking to generate income from a site, then you should be thinking about maximizing that revenue — and if you are, you can’t simply set up your website once, and only experiment with different banners and ad networks. You also need to think about your site design, the banner sizes you have and where those banners are positioned. Unless you experiment with your site and banners, you won’t really be sure if you are maximizing your revenue.
Sure, it certainly takes more effort than just swapping banners in OpenX, but it can be worth it.
Along the same lines, OpenX community member and consultant Erik Geurts has a great post up about 7 common problems with landing pages, which is also worth reading, and may help you in your site and banner experiments in the search for improved advertising revenues.
As you may be aware, the OpenX ad server summarizes data and calculated priorities for Contract campaigns on the basis of the configured Operation Interval.
You may also be aware that it is the maintenance script that summarizes the data and calculates the priorities. But how does this script run? There are two different ways — either automatically, or manually.
By default, an out of the box OpenX ad server installation will be configured to run the maintenance script automatically. The OpenX admin guide lists some advantages to running the maintenance script automatically:
- Outstanding maintenance tasks are triggered by banner delivery;
- Enabled by default on new installations; and
- No need to create scheduled tasks.
However, there are also some disadvantages to relying on automatic maintenance, in The Guru’s opinion:
- Automatic maintenance is called from the “lg.php” and “avw.php” delivery scripts. Respectively, these are the scripts responsible for performing impression logging after banner delivery, and for delivery of banners for the Image and No Cookie Image zone tag types. However, you may have noticed that the XML-RPC zone tag delivery script (“axmlrpc.php”) is not mentioned here. In fact, delivery via XML-RPC, which does not use a logging beacon, will not trigger the automatic maintenance process — therefore relying on automatic maintenance when you are using XML-RPC delivery may deliver inconsistent results, as maintenance will not be triggered.
- As a result of needing to test for when maintenance needs to be run, and then actually running it, the “lg.php” and “avw.php” delivery scripts will not complete as quickly as when automatic maintenance is turned off. Although the OpenX ad server tries to minimize the effects as much as possible, there will nevertheless be some users that occasionally experience a delay in the scripts completing when visiting your website.
- Finally, if you have a low volume site, it is possible that some Operation Intervals will not have the automatic maintenance script run at all. This can lead to some odd campaign priority values, as the script has been designed to run each and every interval.
As a result, running the maintenance script manually is The Guru’s preferred method. This is very easy to set up in crontab, as the OpenX admin guide shows.
However, once you have set up a crontab job to run maintenance manually, you should also update your OpenX configuration, to obtain the maximum benefits. While working as the Administrator account, go to Configuration > Maintenance Settings and then disable the automatic maintenance system — this will ensure the delivery scripts do not need to test to see if maintenance has been run recently, and will ensure you get the maximum performance from your delivery scripts.
 OpenX with automatic maintenance fully disabled.
Once you have done this, again while working as the Administrator account, go to Configuration > Maintenance, and OpenX will report the current maintenance script configuration. (Please note that you may need to wait for the end of the current Operation Interval to see the current settings.)
Finally, don’t forget to update your crontab entry to run the maintenance script once per Operation Interval, if you have opted to change the value from the default!
In OpenX, it is possible to apply capping to banners. Capping allows you to set a maximum number of times a banner will be seen by a user. This limitation can apply:
- For the browser session — that is, the limitation on the number of times a user will see the banner will apply until the user closes their web browser, at which time the capping limitation count will be re-set; or
- For all time — that is, once the user has seen the banner the number of times specified by the limitation cap, they will not see the banner again, even if they close and restart their browser.
With either type of capping, you can specify an optional time period. After this time period, the cap will be re-set, and the user will once again be able to see the banner, until the cap is reached again.
In addition to setting capping at the banner level, capping can also be applied at the campaign level. In this case, the capping is applied to the aggregate impressions for all banners in the campaign, and once the limit is reached, no banners from the campaign will be shown.
As an example, consider the banner shown below. It has been set up with a capping level of 2 impressions for all time, with a capping re-set period of 24 hours. You have already seen the banner once now, so, if you reload this page, you will see the banner for a second time — which is the limit. Should you re-load the page a second time, you will not see the banner, as you have already reached the limit of two impressions. (But if you come back tomorrow, the banner will once again show for another two impressions.)
An example banner with capping applied, set to 2 impressions every 24 hours. If you can't see this banner, then you have either already seen this banner twice in the last 24 hours, or you have cookies disabled,
or this is your very first visit ever to this website.
 The delivery capping options set for the above example banner.
With regards to the above example banner, no guaranteed delivery banner has been included in the zone being displayed, which is why no banner appears once you have reached the 2 impression limit per 24 hours. This highlights why, in a real-world OpenX setup, you should always have a guaranteed delivery banner in every zone.
Why use capping?
Capping banners is not for everyone. Indeed, it makes little sense to apply capping to banners that are there to simply take up unsold inventory.
However, it is widely believed that as the number of times a user has seen a banner increases, the likelihood of that user clicking on the banner decreases. As a result, if you are running CPC or CPA campaigns, you may find that you will make better use of your inventory by applying capping, so that you don’t show the banners to these users too many times — and once the capping limits have been reached for a given user, then you can show the user the lower earning CPM campaigns.
One important thing to note about banners with delivery caps applied is that they are managed using cookies. If OpenX cannot set cookies, then banners with delivery capping applied will never be shown. This is because, if capped banners were shown to users who had cookies disabled, then these users would be able to see capped campaigns infinitely. For cases where you have actually sold inventory on a capped basis, this would obviously be very bad — which is why OpenX does not do it.
However, this does mean that on the very first visit a user ever makes to your site, OpenX will not yet know if it can set a cookie or not. As a result, on this very first ever impression, OpenX will not deliver a capped banner. It will wait until the second impression to do so, when it can then be sure if it was able to set a cookie from the first impression. This may be important, if you absolutely require that a certain banner be shown to all users on their first visit to your site — in this case, you will need to use an uncapped banner.
One of the least understood configuration options in OpenX is the “Operation Interval” setting. What is it, and what does it do?
 Operation Interval in the Maintenance Settings
The first and foremost thing to know about the Operation Interval is that it is not a means of changing how often statistics will be updated in the user interface. OpenX, no matter what version you have installed, will only ever update the statistics in the user interface once per hour. That is it — end of story, end of discussion. Changing the Operation Interval to a value less than 60 minutes will not change this, and if you modify the Operation Interval setting expecting this to be the case, then you will be sorely disappointed.
So, if this is the case, what is the Operation Interval?
The Operation Interval is the mechanism by which OpenX performs internal statistics data aggregation and is the basis on which priority calculations are performed. That is:
- Statistics data is logged based on the Operation Interval (for OpenX 2.8, anyway);
- Statistics data is summarized and stored based on the Operation Interval; and
- Priority values for Contract Campaigns are calculated on the basis of the Operation Interval.
So, given that the Operation Interval is something that only relates to OpenX’s internal operations, why would you want to change it?
To answer this question, you need to understand the two effects that reducing the Operation Interval from the default value of 60 minutes has. (The Operation Interval can only be set to 5, 10, 15, 20, 30 or 60 minutes.)
Firstly, because data aggregation is performed using the Operation Interval value, if you reduce the value from the default of 60 minutes, then OpenX will need to store more data rows. This is because if the Operation Interval is reduced, then there are more Operation Intervals per hour, which means there will be less data aggregation based on the Operation Interval, and so more data rows that need to be stored. As the Operation Interval is the basis by which data is summarized and stored in the “data_intermediate_%” and “data_summary_%” tables in OpenX, which account for most of the database size, then you can expect that an OpenX installation with an Operation Interval of 30 minutes would require twice the database storage as an equivalent OpenX installation with an Operation Interval of 60 minutes.
Secondly, because the maintenance process which calculates Contract Campaign priority values does so on the basis of the Operation Interval, if you reduce the value from the default of 60 minutes, then the OpenX maintenance process will be required to perform more work to calculate the priorities. This is because the maintenance script calculates a priority for every active banner/zone link in the system for every Operation Interval, so if the Operation Interval is reduced, then there are more Operation Intervals per hour, which means there are more priority values to be calculated. The part of the maintenance script that calculates priorities for Contract Campaigns would be expected to take at least twice as long to run on an OpenX installation with an Operation Interval of 30 minutes than on an equivalent system with an Operation Interval of 60 minutes.
So, given the increase in database size and the decrease in performance of the maintenance script that comes with reducing the Operation Interval value, why would you ever change the Operation Interval from the default value of 60 minutes?
The answer is that if you run a very high end OpenX installation, having the Contract Campaign priority values updated only once per hour may sometimes not be enough, and you really do need these priority values updated every half an hour, or every 15 minutes, or maybe every 5 minutes. Be aware, though, that you will need some seriously expensive hardware if you expect to be able to run a large OpenX installation with an Operation Interval of 5 minutes.
Of course, if you do change the Operation Interval value, don’t forget:
- You need to update your system crontab so that the maintenance script is run once (and only once) per Operation Interval. There’s no point in setting your Operation Interval to 30 minutes, so that Contract Campaign priorities can be updated more often, and then not running the maintenance script every Operation Interval to do so!
- You should review your banner delivery cache setting, as there is no point in calculating the Contract Campaign priorities more often, only to have these values ignored due to a long cache value.
Finally, it is worth noting that if you don’t actually run any Contract Campaigns, then there is no point in reducing the Operation Interval from the default of 60 minutes, as there will be no benefit for you at all in this situation!
|
Unofficial Hosted Issue List Ask The Guru Got an OpenX problem The Guru hasn't written a tip about yet? Got an idea for a tip? Email: theguru@openxtips.com.
|