• Home

  • Custom Ecommerce
  • Application Development
  • Database Consulting
  • Cloud Hosting
  • Systems Integration
  • Legacy Business Systems
  • Security & Compliance
  • GIS

  • Expertise

  • About Us
  • Our Team
  • Clients
  • Blog
  • Careers

  • VisionPort

  • Contact
  • (Image|Graphics)Magick trick for monitoring or visualizations

    Kiel Christofferson

    By Kiel Christofferson
    November 3, 2010

    It’s a good time for all when we start poking fun at the visual assault of stereotypical PowerPoint presentations. On the other hand, when data is presented in an effective visual format, human brains are able to quickly grasp the ideas involved and pick out important pieces of information, such as “outliers”.

    Without getting into a long trumpeting session about the usefulness of data visualization (there are plenty of books on the subject), I’d like to jump directly into a Magick trick or two for creating simple visualizations.

    Let’s imagine we’ve got a group of machines serving a particular purpose. Now let’s say I want quick insight into not only the internal activity of all 8 machines, but also what the systems believe they are sending to their displays.

    With a little magick (of the ImageMagick or GraphicsMagick variety), we can save ourselves from running “ps” and “free” and from having to be in the same room (or the same country) as the system we’re checking up on.

    First, let’s organize some simple output from the system:

    $ echo -en "$(hostname) GPID: $( pgrep googleearth-bin ). APPID: $( pgrep -u root -f sbin/apache2 ).\nCRASH: $( ls -1 ${HOME}/.googleearth/crashlogs/ | …

    graphics linux visionport monitoring

    Speeding up the Spree demo site

    Jon Jensen

    By Jon Jensen
    November 2, 2010

    There’s a lot that can be done to speed up Spree, and Rails apps in general. Here I’m not going to deal with most of that. Instead I want to show how easy it is to speed up page delivery using standard HTTP server tuning techniques, demonstrated on demo.spreecommerce.com.

    First, let’s get a baseline performance measure from the excellent webpagetest.org service using their remote Internet Explorer 7 tests:

    • First page load time: 2.1 seconds
    • Repeat page load time: 1.5 seconds

    The repeat load is faster because the browser has images, JavaScript, and CSS cached, but it still has to check back with the server to make sure they haven’t changed. Full details are in this initial report.

    The demo.spreecommerce.com site is run on a Xen VPS with 512 MB RAM, CentOS 5 i386, Apache 2.2, and Passenger 2.2. There were several things to tune in the Apache httpd.conf configuration:

    • mod_deflate was already enabled. Good. That’s a big help.
    • Enable HTTP keepalive: KeepAlive On and KeepAliveTimeout 3
    • Limit Apache children to keep RAM available for Rails: StartServers 5, MinSpareServers 2, MaxSpareServers 5
    • Limit Passenger pool size to 2 child processes (down from the default 6), to queue extra …

    ecommerce hosting optimization performance rails spree

    Keep the Aisles Clean at Checkout

    Mark Johnson

    By Mark Johnson
    October 26, 2010

    It’s no mystery in ecommerce that checkout processing must flow smoothly for an effective store. Providing products or services in high demand doesn’t mean much if they cannot be purchased, or the purchase process is so burdensome that would-be customers give up in frustration.

    Unfortunately, checkout also tends to include the most volatile elements of a web store. It virtually always involves database writes, which can be hindered by locking. It often involves real-time network access to 3rd-party providers, with payment transactions being at the top of the list. It can involve complex inventory assessments, where high concurrency can make what’s normally routine highly unpredictable. Meanwhile, your customers wait, while the app sifts through complexity and waits on responses from various services. If they wait too long, you might lose sales; even worse, you might lose customers.

    Even armed with the above knowledge, it’s all too easy to fall into the trap of expediency. A particular action is so logically suited to be included as part of the checkout routine, and a superficial evaluation makes it seem like such a low-risk operation. That action can be tucked in there just after …


    ecommerce interchange performance tips

    Spree on Rails 3: Part One

    Steph Skardal

    By Steph Skardal
    October 25, 2010

    A couple of weeks ago, I jumped into development on Spree on Rails 3. Spree is an open source Ruby on Rails ecommerce platform. End Point has been involved in Spree since its inception in 2008, and we continue to develop on Spree with a growing number of clients. Spree began to transition to Rails 3 several months ago. The most recent stable version of Spree (0.11.2) runs on Rails 2.*, but the edge code runs on Rails 3. My personal involvement of Rails 3 based Spree began recently; I waited to look at edge Spree until Rails 3 had a bit of momentum and until Rails 3 based Spree had more documentation and stability. My motivation for looking at it now was to determine whether End Point can recommend Rails 3 based Spree to clients and to share insight to my coworkers and other members of the Spree community.

    First, I looked at the messy list of gems that have built up on my local machine throughout development of various Rails and Spree projects. I found this simple little script to remove all my old gems:

    #!/bin/bash
    
    GEMS=`gem list --no-versions`
    for x in $GEMS; do sudo gem uninstall $x --ignore-dependencies -a; done

    Then, I ran gem install rails to install Rails 3 and …


    ecommerce rails spree

    Spree on Rails 3: Part Two

    Steph Skardal

    By Steph Skardal
    October 25, 2010

    Yesterday, I discussed my experiences on getting Rails 3 based Spree up and running. I’ve explained in several blog articles (here and here) that customizing Spree through extensions will produce the most maintainable code – it is not recommended to work directly with source code and make changes to core classes or views. Working through extension development was one of my primary goals after getting Spree up and running.

    To create an extension named “foo”, I ran rails g spree:extension foo. Similar to pre-Rails 3.0 Spree, a foo directory is created (albeit inside the sandbox/) directory as a Rails Engine. The generator appends the foo directory details to the sandbox/ Gemfile. Without the Gemfile update, the rails project won’t include the new foo extension directory (and encompassed functionality). I reviewed the extension directory structure and files and found that foo/lib/foo.rb was similar to the the *_extension.rb file.

    New
    require 'spree_core'
    

    module Foo class Engine < Rails::Engine

    config.autoload_paths += %W(#{config.root}/lib)
    
    def self.activate
      # Activation logic goes here.
      # A good use for this is performing
      # class_eval on classes that are defined
      # …

    ecommerce rails spree

    check_postgres meets pgbouncer

    Josh Tolley

    By Josh Tolley
    October 22, 2010

    Recently the already well-known PostgreSQL monitoring tool check_postgres gained an ability to monitor pgbouncer, the PostgreSQL connection pooling daemon more closely. Previously check_postgres could verify pgbouncer was correctly proxying connections, and make sure its settings hadn’t been modified. The pgbouncer administrative console, reports many useful pgbouncer statistics and metrics; now check_postgres can monitor some of those as well.

    pgbouncer’s description of its pools consists of “client” elements and “server” elements. “Client” refers to connections coming from clients, and “server” to connections to the PostgreSQL server. The new check_postgres actions pay attention only to the pgbouncer “SHOW POOLS” command, which provides the following metrics:

    • cl_active: Connections from clients which are associated with a PostgreSQL connection. Use the pgb_pool_cl_active action.
    • cl_waiting: Connections from clients that are waiting for a PostgreSQL connection to service them. Use the pgb_pool_cl_waiting action.
    • sv_active: Connections to PostgreSQL that are in use by a client connection. Use the pgb_pool_sv_active action.
    • sv_idle: Connections to PostgreSQL that are idle, ready to …

    nagios postgres

    Cross Browser Development: A Few CSS and JS Issues

    Steph Skardal

    By Steph Skardal
    October 20, 2010

    Coding cross browser friendly JavaScript and CSS got you down? In a recent project, Ron, David, and I worked through some painful cross browser issues. Ron noted that he even banged his head against the wall over a couple of them :) Three of these issues come up frequently in my other projects full of CSS and JS development, so I wanted to share.

    Variable Declaration in JS

    In several cases, I noticed that excluding variable declaration (“var”) resulted in broken JavaScript-based functionality in IE only. I typically include variable declaration when I’m writing JavaScript. In our project, we were working with legacy code and conflicting variable names may have be introduced, resulting in broken functionality. Examples of before and after:

    Bad Better
    var display_cart_popup = function() {
        popup_id = '#addNewCartbox';
        left = (parseInt($(window).width()) - 772) / 2;
        ...
    };
    
    var display_cart_popup = function() {
        var popup_id = '#addNewCartbox';
        var left = (parseInt($(window).width()) - 772) / 2;
        ...
    };
    
    ...
    address_display = '';
    

    country = $(type+’_country’).value; address = $(type+’_address’).value; address2 = …


    browsers css javascript

    Simple audio playback with Yahoo Mediaplayer

    Jeff Boes

    By Jeff Boes
    October 20, 2010

    Recently I had need to show a list of MP3 files with a click-to-play interface.

    I came upon a very simple self-contained audio player:

    <script type="text/javascript" src="http://mediaplayer.yahoo.com/js"></script>

    The code to set up my links for playing was dirt-simple:

    <script type="text/javascript">
    var player = document.getElementById('player');
    function add_to_player() {
        var link = this;
        player.src.replace(/audioUrl=.*/,'audioUrl=' + link.src);
        return false;
    }
    var links = document.getElementsByTagName('A');
    for (var i = 0; i < links.length; i++) {
        if (links[i].src.match(/\.mp3$/)) {
            links.onclick = add_to_player;
        }
    }
    </script>

    You could use various ways to identify the links to be player-ized, but I chose to just associate the links with a class, “mp3”:

    <a class="mp3" href="/path/to/file.mp3">Audio File 1</a>

    Obviously, if jQuery is in use for your page, you can reduce the code to an even smaller snippet.


    javascript audio
    Previous page • Page 175 of 222 • Next page