Running Drupal in a Cluster Environment with a Load Balancer

We recently moved a client’s deployment of Drupal that was running on a single server environment, meaning one dedicated server running both Apache as the web server and MySQL as localhost on the server itself. This is a very common configuration for systems and sites that grow beyond their single server’s ability to meet the demands of your traffic.

You can get an overview on how to grow a single dedicated server or VPS into a cluster in our previous post.

You can view our Drupal Cluster & Drupal Load Balancer vendor here.

Mo’ users Mo’ Problems.

Upgrading Drupal to run on a cluster involves changing the way you think about the resource calls to Drupal’s individual components.

Our client’s traffic averaged about 800,000 visitors - A DAY, essentially jumping from about 120,000 daily visits, which the single server setup, as large as it was, was struggling to keep up.

With that many visitors, it is not always easy to just identify the bottlenecks from looking at the server side of the equation, its processes, MySQL usage and so on. This is because almost a million visitors a day magnifies everything to where even the smallest process running at a single point in time has a great impact.

Since we did not develop this client’s sites, we did not have the luxury of building things in a scalable fashion with running Drupal on a cluster as the intended goal. Instead we took the path of least resistance and began changing, optimizing, shutting off things as so:

You’re logging what?

In a world where Google analyitics knows all and see all, you probably do not need to be logging every piece of information Drupal or your server can collect. With high traffic Drupal sites, every request counts and if your Drupal build is logging to the database, these tables are going to grow, and grow and grow in size. More tables, more things to get fragmented and corrupt. We removed a tracking module one site had that had MILLIONS of entries per day and was GIGS in size, greater than the rest of the databases on this server combined. Removing that module increase performance significantly and reduced the load of MySQL.

As long as you do not need the stats for some other reason you should consider:

  • Turn off Drupal logging, Drupal Error Reporting and any other information being collected.
  • Turn off statistics packages running on your servers, including AWStats, Webalizer, Analog or Logaholic Stats packages.
  • Turn off statistics processing as some of these jobs run for hours and hours, even days if you are dealing with logs involving millions of visits a day.
  • Turn off error logging or have a process for paring down logs to a reasonable level, even small errors and warning add up when talking traffic of this magnitude.
  • Consider how you are logging and storing you /var/logs data. If you server setup is using multiple web servers at a glance these logs are less useful if you are using a load balancer that is splitting traffic across your network. I am not saying you do not need these, I am just saying that with “great traffic comes great responsibility” and you should set up a retainment policy for logs that does not increase your load or create storage problems. We encountered a 300GIG instance that ran out of storage within 1.5 days because it was logging everything and also had a runaway caching system, which leads us to:

Cache me if you can!

Hey, this pun works and you know it. Drupal caching can be very powerful and a boon to your deployment of Drupal in a cluster environment. The two caches we usually work with are Memcache/Memcached and Varnish. Memcache you set up as a service and run continuously, while Varnish is code-side.

Drupal 7+ has its own caching system built-in while older versions of Drupal, 5,6 etc often reply on third party modules like Boost cache.

IMPORTANT! Depending on the nature of your website and whether you make use of unique dynamic content such as :

  • Ad-serving technologies, where each unit carries unique information.
  • Video-serving technologies, where each load is considered unique.
  • Other dynamic content such as comments, related content (off-site usually) or syndication partnerships.

Depending on how your caching is set up to cache these blocks, templates or content that contains additional dynamic content (yes, even a single unique ID will trigger a whole new page to be cached), you can quickly overwhelm your CPU or worse yet, fill up your disk with millions and millions of cache files when talking about the traffic a cluster would probably warrant.

The Drupal Admin on a cluster – logging into Drupal

When you have a cluster of servers running Drupal, you have to plan ahead for you you are going to administer the website or do future development.

Obviously, you could make changes and then push them to each individual web server individually, but this is inefficient  slow, may cause downtime or cause problems with your cluster during the time to takes you to put or get files since only one server will have the updates at a time.

This means you have to create a deployment strategy involving something like a versioning system, Git, Github or other deployment system, which we will cover in a different post.

Drupal is now in session.

As far as staying logged into Drupal on a cluster with an external database server, it is all about the load balancer I’m afraid. We get our Drupal Loadbalancer

Your load balancer will have a mode called “session persistence” which needs to be set in order to stay logged into Drupal’s admin. If this is not set, every request you make may ping pong off the different servers in your cluster and you will get the dreaded “you are not authorized to access this site” message.

The reason is simple, if you are not using session persistence with your load balancer and Drupal, then you are logging into one session on one server, then the next click “may” have you on a different server, then another and so on.

Even if you continued to log in over and over again, the sessions would not match and Drupal will kick you out.

With session persistence, you stay logged in and so long as all of your Web Servers in the cluster are using the one remote database host, the changes you make will appear fine since they are in the single database.

It is also important when you create your database server to have your host or data center put the database server on a private network which will allow the web server to access the database lightning fast instead of going over traditional network connections.

This ends our post for now, next time we’ll cover other optimization of Drupal in a Cluster environment and focus more on how your development and deployment needs to change to accommodate such a monster. Click here if you need a good vendor for putting Drupal in the Cloud and Drupal enterprise hosting.

How to upgrade your dedicated server to a cluster of servers

How to upgrade a server to a cluster of servers.

One of the things that a website or server may have to do in its lifetime is scale up to a cluster of servers.

What’s a cluster?

A cluster can mean several things, but at a bare minimum it means “more than one server”. Yes, I realize that is not all that helpful to understanding all of this just yet, but stay with me.

Typical cluster configurations:

One web server – One database server:

With this set up we do not need to employ a load balancer that sends traffic requests to one or the other serve.

Wait. What’s a load balancer?

A load balancer is a device that sends traffic to one or more location. It can be set to do this a number of different ways, including:

  • Round robin – where it alternates between each server in turn.
  • Lowest process – where it sends it to the server with the least number of processes running (lesser bogged down of servers on load balancer)
  • Historical – the load balancer keeps track of which server is better to send traffic to at a given time. This is helpful if one or more of your servers has periods where it consumes more resources, like during scheduled backups, log analysis, data imports, etc.

You set up your different domains, sites, etc to point their A records at the load balancer rather than to a particular server.

The first server just runs Apache (Web Server) or IIS (Windows Web Server) and the second server just runs the database server (MySQL, MS SQL, etc)

You update your web applications to run off the database server, often by IP address or using a private network.

This is helpful for applications where the MySQL load interferes with the Web Server or vice versa,

Load Balancer + 2 Web Servers running their own Databases

In this configuration you have a load balancer that detects and sends traffic to one or more servers, each running as a separate instance of your entire website or web application.

The assumption is that you either:

  1. Do not need real time synchronization of data between each instance/server – meaning you probably do not have users that add content, comments, posts, transactions to the server. This is helpful for static sites or sites that delivery one-way content to its audience.-or-
  2. You have implemented an rsynch of files or other method for keeping data up to date. In short, having two whole servers means two places to update and edit and is not the best configuration for a lot of businesses.

Load Balancer + 2 Web Servers and a third database server.

Here’s where we get to true performance enhancing and scalability. (Also, is it just me or with the whole Lance Armstrong thing has that word lost all meaning?)

With a 3 server setup you offload the database functions to one server, balance two web servers and set each of them up to look at just that single database server.

The challenges with this are usually:

  1. You need to develop a workflow for working on your server’s websites and web applications. Whether this means you log into all web server to push updates, or you develop an rsynch script or other method to copy files – or you make use of a CVS (Concurrent Versioning System) to deploy your code across multiple platforms at once – you will need to start thinking of your design & development in terms of working on a network and not in a single server or single account setting.
  2. Logging into CMS systems like Drupal, WordPress, Joomla or any other administration panel becomes a nightmare unless you set up your local environment to look at just one server (e.g. change your localhost file) – or, you work on a local server and push your changes up that way.

Summary: We’ve assisted a number of companies in upgrading to clusters for single server (or VPS. shared hosting, whatever) and each deployment is uniquely different based on what you want to accomplish.

Usually, a client has or will be experiencing such high traffic or resource usage that their current server is overwhelmed and simply re-sizing the server is not going to cut it for them. This is where we develop a strategy for re-sizing to a cluster based on the individual domains, sites and web application that are running on the server.

The most overlooked items we see clients having to deal with when they resize to a cluster are:

  • Making Drupal run on a cluster and dealing with persistent logins and caching.
  • Making WordPress run on a cluster of servers and dealing with plugins looking for files, cache file, tmp files or other resources that are not present fuly in a two server environment
  • Making Joomla run on a cluster where administrator are not staying logged or need better session management.
  • Making forums run in a cluster where posts and comments come in so fast that any delay or lag creates chaos and frustration
  • Making CS-Cart, Zen Cart, Magento, OSCommerce or any other ecommerce function, keep users logged in, keep them able to checkout and not dump their cart now that they are running on a cluster.

Upgrading to a cluster is not necessarily the saving grace or the next logical step for a site that needs to scale. Often talking with a programmer can reveal other ways that you can adjust your user experience and gain additional performance out of your current system.

A note on shared hosts.

If you are on a shared host trying to do this, there’s probably no hope for you. Sorry, we’re not talking the same language at this point. A shared account’s next step is to move up to a VPS (Virtual Private Server). A VPS’s next step is to move to a larger VPS or true dedicated system running in its own space or hardware.

After that, it’s time to talk clusters - which you can contact us any time on.

Lotus Notes & HTML Email

NOTE – this is an archival article .. and we generally avoid TABLES now at all costs, however they still sometimes do have their place in HTML Email when you need to control some absolutes like width and table data cells.
Lotus Notes seems to be a source of frustration for many marketing, designers and …. other folks.

As evidenced by this email message we received recently from one reader:

Tom,

Lotus Notes [DELETED] won’t display [DELETED] properly. I’m ready to [DELETED] throw the [CENSORED, DELETED, ETC] using a pogo stick.

-Ted

We feel your pain Ted..really..we do.

Lotus Notes can be a very frustrating Email client to test your HTML Email Messages against. There is a general lack of information on how the Lotus Notes email client renders and displays HTML for the end-user. Many designers and firms tend to skip over the whole Lotus Notes compatibility issue due to the fact that the majority of recipients received

The problem is that there is a tremendous amount of corporate Lotus Notes users. One client of ours found out after a brief survey (and all of the negative feedback from their mailings to users who received a hodgepodge of mismatched code from them) – that nearly 40% of their entire mailing list were Lotus Notes clients due to the fact that their mailing list was made up of corporate clients.

So, whether you realize it or not, Lotus Notes may make a very significant portion of your existing mailing list. Unlike AOL recipients, who you can easily filter and send alternate content to as you mail, Lotus Notes users look and act just like the rest of us. Scary.

That being said, let’s dive into some of the more common concerns we get on an almost daily basis. The following is a guide which you may find helpful in diagnosing and trouble shooting common Lotus Email Marketing issues. Due to the wide variety of settings, open source tweaks and other variables that separate the Lotus Environment from your more common Exchange & Oracle systems, you’ll need to consult some of the resource links & forums we’ve collected below for additional help. However, with the little bit we are going to arm you with, you’ll be able to fake it just fine.

“Dear Template Kit,

A handful of employees that receive different emails in HTML format cannot seem to be able to view the pictures or images in Lotus Notes. The text seems to retain its HTML formatting, but the images appear as a box with a red “x” in them. What is going on?”

-Judy

If you are a current user of Lotus Notes, whether R5.07 – R5.10 or even the R6 and beyond releases, you’ve no doubt heard much of the following:

“We opened an HTML Email which looked fine in Outlook, but expanded to fill the entire page in Lotus, distorting the intended design, what happened?”

We’ve documented numerous accounts where Lotus Notes has completely ignored some HTML coding during rendering, while displaying other HTML coding just fine. This is especially true when it comes to width parameters for TABLE tags, nested TABLE tags and finally, TABLE tags that are not constrained within another table.

Example:

Foo on you!
Foo on you too!

One of the “Best Practices” we’ve established in consulting for clients is using one master table to constrain your entire email. Often, clients will be taking bits and pieces of code from various projects, emails, websites, catalogs, etc and placing them into their HTML Email Marketing. All of the various parameters can easily conflict with one another when rendered. By “wrapping” your HTML Email in one master table, you help reign in all of those various width=% and other “ambiguous” attributes and parameters which can wreck havoc on how your HTML Email is rendered by the viewer’s browser.

Wrapping your HTML Email message in a master table and then setting the TABLE Padding to equal at least “5” is also a good way to thwart certain Web-based systems that only render your code from after the what comes after the BODY tag. A good example of the differences can be found here: TemplateKit.com

By comparison, our TemplateKit.com newsletter uses cell padding of “18”. While you do not have to be as zealous as we may be in this regard, it is better to be safe than sorry.

Lotus “Punts” our stylesheet!

HAH! The most common complaint we get around the office. Disappearing style sheets when rendered in Lotus Notes. Your meticulously designed, corporate schema conforming

You send an email to a Lotus client and suddenly the text appears HUGE! Your beautifully design masterpiece, lovingly handcrafted 14pt, Helvetica with slight shades on the sidebar tables can completely come undone. Almost exactly like we’ve displayed here & here.

If you are going to be relying on style sheets to format your HTML Email, then you must be aware that Lotus just doesn’t like them. Most common style sheet applications are ignored by Lotus Notes nearly each and every time you try to use one. The same is often true for many Web-based email systems (Hotmail, AOL, Yahoo, etc) who want to avoid any style sheet conflicts between their own and yours.

If you are going to send HTML Email to a Lotus recipient, and your design is fairly dependent on that style sheet to keep the continuity of your design in place, then you can count on problems.

Except, if you do the following:

A normal Stylesheet Entry in thesection of your HTML document looks like this:

>

Even if you link to your style sheets, you are still using the above format which is called into your document when rendered by the email client.

The above style sheet will immediately be ignored by most Lotus Notes clients, ruining your email. However, if you were to comment out each line of the Stylesheet one by one, then your style sheet is suddenly recognized by the Lotus Environment, like so:

 

How to create a sample developer log entry

One of the most basic tasks that a developer or even one of our designers or UI/UX integrator must undertake (yes, we’re large enough to have these…) is logging and documenting what they may have changed in a development project, basecamp, CVS or other system.

Here is an example of a log (info changed to protect the innocent (website)

Developer: Thomas Granger

2-28-05:          Installed 2.2 Code base for OSC.

3-1-05:                        Configured OSC Store, Tax tables and administration

3-2-05:                        Installed USAePAY SDK and MID/TIDs, modified Code base :

Added to : /ecatalog/admin/includes/functions/general.php:

// Alias function for Store configuration values in the Administration Tool

function tep_cfg_select_multioption($select_array, $key_value, $key = '') {

for ($i=0; $i<sizeof($select_array); $i++) {

$name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');

$string .= '<br><input type="checkbox" name="' . $name . '" value="' . $select_array[$i] . '"';

$key_values = explode( ", ", $key_value);

if ( in_array($select_array[$i], $key_values) ) $string .= ' CHECKED';

$string .= '> ' . $select_array[$i];

}

$string .= '<input type="hidden" name="' . $name . '" value="--none--">';

return $string;

}

////

3-2-05: Customization of common OSC templates, no build changes.

That’s it!

Graphic Design Services – Marysville & Everett WA

FDG Web is a graphic design firm and company who has several graphic designers on staff and offers a wide variety of graphic design and design-related services.

Including:

  • Brochure Design & Printing
  • Logo creation, branding design and complete identity kits
  • Business cards, product brochures, letterhead, envelopes
  • Custom graphics, signs, trade show banners, outdoor banners and vehicle wraps
  • Sales presentations, materials, custom PowerPoint creation and design
  • Custom CD-ROM Development, printing or CD-ROM Business Cards
  • T-Shirts, Clothing and other graphics for marketing logowear.

We offer pre-press & file setup for you to take it to a printer of your choice, or we can help guide you through the process from start to finish.

For more information about our graphic design services or to talk to one of our graphic designers, contact us today!

 

Tom Granger is giving a presentation today.

See, I told you so?


This is the content page Tom is currently using for the “Tom Granger is giving a presentation today” example.

This page lives outside of his normal site, it was created on November 6th, 2012 while he was furiously typing away setting all of this up in Powerpoint.

What this is really all about is a landing page designed for a specific purpose, or centered around a specific phrase or keyword you want to capture traffic for. We have a handful of normal navigational pages and 1000s of content pages like this one that are designed for searches.

It is important to:

  • Make the content actually relevant.
  • Do not keyword jam.
  • Do not clutter with links.
  • The page should make some sense
  • Within one click the user should be back in your “normal” website.

Website Support

We maintain your mission critical systems & provide website support.

If you need a “developer or designer on demand” for website support - whether regularly or just when you just need help…  we’re that voice at the end of the live.  We have all local, all full-time staff that support our customer’s systems day in and day out. Just call us, you’ll see!

We provide support and maintenance for: Joomla, Drupal, WordPress, Magento, X-Cart, Zen Cart, Oscommerce, CRELoaded, CS Cart, Code Ignitor, CAKE PHP Framework, MAMBO, BigCommerce, ShopSite, Shopify and more!

Becuase we’re not the type of firm that books the job and then rounds up the people to do your work, our staff gets to know our client’s systems inside and out and can work fast and efficiently when you need work done.

We provide:

  • Web site support & maintenance
  • Content creative, creation & management
  • SugarCRM Support
  • Salesforce / Salesforce.com Support
  • Drupal, WordPress & Joomla support, upgrades and patches
  • CS Cart Support
  • Magento Support
  • We support all PHP / MySQL systems, including custom applications
  • We support all frontend coding – including Javascript, jQuery, AJAX, HTML 5, Python and more!
  • We work with Google App Engine, Facebook Mark-up Language (FBML) mobile apps and dozens of other technologies.

Seattle Website Support

We are a Seattle website support company who specializes in “Developer on Demand” type services.  Have a question about your site? Programming not working quite right? Need a designer to fix something for you – this is what we do. 100% all in-house, all local designers and developers working in the same office full-time to serve your needs. Talk to someone today by calling us toll-free at 877-239-3083 or emailing us here.

We work with:

CRM Applications

  • SugarCRM Support
  • Salesforce Support
  • vTiger CRM Support
  • BrowserCRM Support

CMS – Content Management Systems

  • Joomla Support & Maintenance
  • Drupal Support & Maintenance
  • WordPress Support & Maintenance
  • Code Ignitor Support & Maintenance
  • Custom CMS Applications

Ecommerce Systems and Shopping Carts

  • CS Cart Support & Maintenance
  • Zen Cart Support & Maintenance
  • Magento Ecommerce Support & Maintenance
  • OSCommerce Support & Maintenance
  • Virtuemart Support & Maintenance
  • Ubercart Support & Maintenance
  • Yahoo Stores Support & Maintenance
  • X-Cart Support & Maintenance
  • BigCommerce Support & Maintenance
  • and more!

In addition, we also provide day-to-day web application support services for mission critical systems. We currently maintain dozens of ecommerce systems on a daily basis – providing critical support to our customers (and, in turn, their customers as well) by providing high availability to our staff of designers, integrators and front-end coders as well as server administrators, security experts and programmers.

We have offerings that nearly every budget – from ad-hic “on-demand” services at an hourly rate, to monthly retainers that allow us to offer very cost effective rates for programming & design assistance.

Seattle SugarCRM Developers – Sugar CRM Training & Consulting

FDG Web specializes in custom development for both Sugar CRM  Salesforce CRM  - including advanced web / opportunity to lead forms and sales process automation. We serve clients both remotely or in person in the greater Seattle, Washington area – including Bellingham, Mount Vernon, Everett, Bellevue and Bothell.

Our Seattle SugarCRM Developers design & develop in person or via remote – the following types of Sugar CRM projects:

  • Installing Sugar CRM to a server environment for deployment
  • Securing Sugar CRM and protecting customer data
  • Integrating forms, web to lead or other SugarCRM website integration
  • Importing data into Sugar

Sugar CRM & Salesforce help an organization coordinate and track their sales cycles for prospects, leads, marketing, sales, deployment, support and management. CRM users (e.g. management) can monitor and manage campaigns and inbound leads (opportunities) across multiple marketing channels and direct qualified opportunities to the correct  salesperson or team to handle them. All the while they are able to track the effectiveness; monitor their sales pipeline, provide business process automation (BPA) and mine intelligence from their various sources of data. With CRM you waste less time with “unknowns” in your sales and marketing process.

CRM is also used for customer support, allowing your support teams to access historical customer information quickly and efficiently.

CRM is valuable for executive, who can use advanced reporting and forecasting tools to view their enterprise the way an executive should – the complete picture and not a series of small reports.

For more information – contact us today.

Bamboo Flooring & Bamboo Plywood

Plyboo is the most respected name in green bamboo flooring and bamboo plywood. They also produce a line of Palm Flooring under the Durapalm brand. Durapalm is derived from palms. Smith & Fong offers the world’s only formaldehyde-free FSC-certified bamboo, and the company’s FloorScore® certified flooring and IndoorAdvantage Gold™ certified plywood are found in design-rich commercial and residential environments worldwide, where sustainability meets innovation.

The look and feel of Plyboo Bamboo Flooring is fantastic. Unlike cheaply made box store alternatives with suspect origins for their supposed “earth friendly” manufacturing processes – Plyboo works to have their products certified and demonstrated to truly be clean and green.