Tag Archives: business metrics

5 things toxic to scalability

The.Rohit - Flickr
The.Rohit – Flickr

Check out our followup post 5 More Things Deadly to Scalability

If you’re using MySQL checkout 5 ways to boost MySQL scalability.

1. Object Relational Mappers

ORMs are popular among developers but not among performance experts.  Why is that?  Primarily these two engineers experience a web application from entirely different perspectives.  One is building functionality, delivering features, and results are measured on fitting business requirements.  Performance and scalability are often low priorities at this stage.  ORMs allow developers to be much more productive, abstracting away the SQL difficulties of interacting with the backend datastore, and allowing them to concentrate on building the features and functionality.

Scalability is about application, architecture and infrastructure design, and careful management of server components.

On the performance side the picture is a bit different.  By leaving SQL query writing to an ORM, you are faced with complex queries that the database cannot optimize well.  What’s more ORMs don’t allow easy tweaking of queries, slowing down the tuning process further.

Also: Is the difference between dev & ops a four-letter word?

2. Synchronous, Serial, Coupled or Locking Processes

Locking in a web application operates something like traffic lights in the real world.  Replacing a traffic light with a traffic circle often speeds up traffic dramatically.  That’s because when you’re out somewhere in the country where there’s very little traffic, no one is waiting idly at a traffic light for no reason.  What’s more even when there’s a lot of traffic, a traffic circle keeps things flowing.  If you need locking, better to use InnoDB tables as they offer granular row level locking than table level locking like MyISAM tables.

Avoid things like semi-synchronous replication that will wait for a message from another node before allowing the code to continue.  Such waits can add up in a highly transactional web application with many thousands of concurrent sessions.

Avoid any type of two-phase commit mechanism that we see in clustered databases quite often.  Multi-phase commit provides a serialization point so that multiple nodes can agree on what data looks like, but they are toxic to scalability.  Better to use technologies that employ an eventually consistent algorithm.

Related: Is automation killing old-school operations?

3. One Copy of Your Database

Without replication, you rely on only one copy of your database.  In this configuration, you limit all of your webservers to using a single backend datastore, which becomes a funnel or bottleneck.  It’s like a highway that is under construction, forcing all the cars to squeeze into one lane.  It’s sure to slow things down.  Better to build parallel roads to start with, and allow the application aka the drivers to choose alternate routes as their schedule and itinerary dictate.

Using MySQL? Checkout our our howto Easy Replication Setup with Hotbackups.

Read: Do managers underestimate operational cost?

4. Having No Metrics

Having no metrics in place is toxic to scalability because you can’t visualize what is happening on your systems.  Without this visual cue, it is hard to get business units, developers and operations teams all on the same bandwagon about scalability issues.  If teams are having trouble groking this, realize that these tools simple provide analytics for infrastructure.

There are tons of solutions too, that use SNMP and are non-invasive.  Consider Cacti, Munin, OpenNMS, Ganglia and Zabbix to name a few.  Metrics collections can involve business metrics like user registrations, accounts or widgets sold.  And of course they should also include low level system cpu, memory, disk & network usage as well as database level activity like buffer pool, transaction log, locking sorting, temp table and queries per second activity.

Also: Are SQL Databases dead?

5. Lack of Feature Flags

Applications built without feature flags make it much more difficult to degrade gracefully.  If your site gets bombarded by a spike in web traffic and you aren’t magically able to scale and expand capacity, having inbuilt feature flags gives the operations team a way to dial down the load on the servers without the site going down.   This can buy you time while you scale your webservers and/or database tier or even retrofit your application to allow multiple read and write databases.

Without these switches in place, you limit scalability and availability.

Also: Is high availability overrated? The myth of five nines…

Get more. Grab our exclusive monthly Scalable Startups. We share tips and special content. Our latest Why I don’t work with recruiters

iHeavy Insights 81 – Web Performance Metrics

Metrics are those pesky little numbers we like to keep an eye on to see how we’re doing.  Website performance may be full of lots of jargon and fancy terminology but in the end the purpose is the same.  Watch the numbers to know how we’re doing.

In Economics

If you follow the economy you’re probably familiar with GDP or Gross Domestic Product tells you the total amount of goods and services that a country produced.  What about the CPI or Consumer Price Index, well that measures the price of a so-called basket of goods.  Those are intended to be goods everyone must have, such as food & beverages, housing, apparel, transportation, medical care and so forth.  By measuring the CPI we get a sense of consumers buying power or how far the dollar goes.

In Baseball

If you follow sports, you’ve probably heard of a players batting average which is hits divided by at bats.  A simple ratio, gives a picture of the players past performance.  Another statistic is the RBI or runs batted in, which tells you how many times the player caused runs to be scored.

Web Performance

Taken generally metrics give us a quick view of a more complicate picture.  Performance metrics for websites are no different.  For instance if we’re looking at the business or application level, we might keep track of things like:

  • user registrations
  • subscriptions sold
  • widgets sold
  • new accounts sold
  • user & social interactions
  • ratings and other gamification stats

So too at a lower level we can capture metrics of the systems our web application runs on top of with tools like Cacti, Munin, Ganglia, Zabbix, or OpenNMS.  The basics include:

  • cpu utilization
  • network throughput
  • disk throughput
  • memory usage
  • load average

And further down the stack we can keep metrics of are database activity such as:

  • buffer pool usage
  • files & table I/O
  • sorting activity
  • locking and lock waits
  • queries per second
  • transaction log activity

By tracking these metrics over time, we can view graphs at-a-glance and see trends.  What’s more folks from different sides of the business, can get visibility into what others needs are.  Business teams can see server loads and operations people can see real revenue and income.  That brings teams together to a common goal.

Performance Metrics – What are they and why are they important?

In order to understand how fast your website is, we need some numbers.  We call these fancy numbers performance metrics, objective measures that we can track over time.  We can track them for seasonality as well as website traffic and growth.  But we can also track them for feature and application changes based on deployments to see if new code has caused perfermance to improve or degrade.

Some useful business or application performance metrics include:

  • user registrations
  • accounts sold
  • widgets sold
  • user interactions & social metrics
  • so-called gamification, ratings & related

We also want to capture lower-level system  metrics with a tool like Cacti, Ganglia, Munin, OpenNMS, Zabbix or similar:

  • cpu
  • memory
  • disk
  • network
  • load average

Along with the basic system level metrics you’ll want to collect some at the database level such as:

  • InnoDB Buffer Pool activity
  • Files & Tables
  • Binary log activity
  • Locking
  • Sorting
  • Temporary objects
  • Queries/second

Sean Hull asks on Quora – What are web performance metrics and why are they important?

Metrics Bridge Gap Between IT & Business Units

On the business side we’ve all seen requests for hardware purchases that seem astronomical, or somehow out of proportion to the project at hand.  And on the IT side we’ve been faced with the challenge of selling capital expenditures on technology, as demands grow.

Collecting statistics on real usage of server systems, and then connecting the dots to business metrics is an excellent way to bridge the gap.  This allows IT to draw concrete connection between technology investment, and reaching business goals.

Metrics and drawing the dotted line in this way also educates folks on both sides of the tracks.  It educates technologists on exactly how technology purchases can be justified, by their direct return to the business.  And it educates finance and business executives on how those hardware purchases directly contribute to business growth.