Skip to content

Instantly share code, notes, and snippets.


Reid Parham parhamr

View GitHub Profile
View Development Environment User

Development Environment User Stories

Boilerplate Features and Behaviors For Engineering Needs.

This document contains epics and their stories to identify engineering needs that should be satisfied by application development efforts. It is written for systems engineers and uses the perspectives of software, front end, and user experience engineers.

Epic: As an engineer, I can build a new development environment

As an engineer, I want to read a guide to familiarize myself with an application


Use the log output from wget to capture a list of URLs:

wget -a wget-log.txt --ignore-tags=img,link,script -X admin -e robots=off -nv --header="Accept: text/html" -r -l 0 --no-cookies

Process that log file to collect a sorted list of unique URLs:

cat wget-log.txt | grep -F 'URL:http' | awk '{print $3}' | sort | uniq | sed -e s/^URL:// > tmp.txt
parhamr / sysctl.conf
Last active Aug 29, 2015 — forked from colby/-
Boilerplate Linux Kernel tweaks for a webserver
View sysctl.conf
parhamr /
Last active Aug 29, 2015
MySQL statistics for PHP upgrade research

MariaDB 10.0.10 global statistics

This test server has been running for 24.7 days as the data store for load testing Magento 1.13.1 EE against various PHP versions.

Minutely averages

  • 5042 SELECTs
  • 2301 INSERTs
  • 176 COMMITs
  • 253 UPDATEs
parhamr / opcache.ini
Last active Mar 14, 2016
Known working Zend OPcache configuration for PHP 5.5
View opcache.ini
; configuration for php ZendOpcache module
; Tuned for Magento 1.13.1 on PHP 5.5
; Test server has 8 CPU cores and 32 GB RAM

Magento Scaling Hypotheses

Magento’s checkout throughput can increase to at least 8 times its current capacity and up to 26 times more in ideal conditions.

  1. The current checkouts per hour limit for large, real-world Magento stores is 4,500
  2. This limit cannot effectively be increased with more and/or better hardware
  3. The improper type handling in Magento’s SQL code is the cause of the current limit
  4. If one SQL query is fixed, large Magento stores can scale to a new, real-world limit of 120,000 checkouts per hour
  5. For commodity hardware, this new limit might be 36,000 checkouts per hour
parhamr /
Last active Dec 25, 2015
MySQL 5.6.11 skips indices when given quoted INTs

Removing quotes from an INT column allows MySQL to use the index and this can reduce rows scanned by 99.997 percent. Example from Magento 1.12 on a production database; the query takes nearly a second to execute:

mysql> explain DELETE FROM `catalog_product_index_price` WHERE entity_id IN('433284', 433283)\G;
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: catalog_product_index_price
         type: ALL
possible_keys: NULL
parhamr /
Created Oct 15, 2013
How to represent competitions in code


  1. Competitions of fixed time will be scored on a measurement criteria
  2. Competitions of fixed measurements will be scored on a time criteria

The criteria can be high score OR low score wins

Measurements are typically distance (miles, km, etc) or counts (arbitrary; pins in bowling, free throws in basketball, dollars in fundraising)

Override layers are needed for some conditions where special scoring is wanted. These can be tournaments, score handicaps, or even something playful like house rules.

parhamr / MySQL data
Last active Dec 25, 2015
Fast, safe (excepting schema changes), and ugly data transfer between MySQL databases
View MySQL data
  1. Source host: mysqldump --skip-opt -e -q --compact --single-transaction -n -t --set-charset [$database_name] [$tables]
  2. Move the dump to destination host (scp)
  3. lock destination $tables
  4. truncate destination $tables
  5. `SET SESSION sql_mode='ALLOW_INVALID_DATES'; SET SESSION foreign_key_checks=0; SET SESSION unique_checks=0; SET SESSION autocommit=0;
  6. Load dump as SQL source
  7. commit transaction
  8. unlock destination $tables