Skip to content

Instantly share code, notes, and snippets.

I expected the ioloop method to win here, and it does hold its ground when ran on my local machine.
But i'm surprised how reordered things are when ran on a server on GCP:
the naive method is still slow, but it's a third faster than my local machine, which clocked in at 120 seconds.
I'm honestly surprised that the naive HTTP2.0 method is so slow. Maybe because of the overhead of the http2 library i use.
As usual, the threaded method was the winner here. I'm guessing it's because requests' builtin libraries are fast enough for HEADs. The HTTP2 method would probably win if we actually fetch the content.
@aronasorman
aronasorman / more benchmarks.md
Created July 27, 2017 18:26
500 pages in summer

latest 0.4.x:

all scenarios completed
Complete report @ 2017-07-27T17:47:44.285Z
  Scenarios launched:  50
  Scenarios completed: 50
  Requests completed:  100
  RPS sent: 2.2
  Request latency:
 min: 2343.3

Without PRAGMAs:

all scenarios completed
Complete report @ 2017-07-22T00:21:45.560Z
  Scenarios launched:  50
  Scenarios completed: 50
  Requests completed:  100
  RPS sent: 1.03
  Request latency:
    min: 5654.4
@aronasorman
aronasorman / crashing-nodes.md
Created July 14, 2017 18:20
My devlog on cordoning off nonworking nodes, using Kubernetes

Our company uses Kubernetes to deploy contentworkshop.learningequality.org. However when we deployed our new code, it got stalled, and one of the pods had a NodeLost status. Uh oh!

I checked the status of the nodes by running kubectl get nodes:

NAME                                                  STATUS     AGE       VERSION
gke-contentworkshop-cent-default-pool-827dd3f8-4h8z   Ready      66d       v1.6.2
gke-contentworkshop-cent-default-pool-827dd3f8-vs6s   NotReady   66d       v1.6.2

Indeed, looks like one of our nodes arrived in a weird state, and is not reporting anything to the kubernetes master.


with the key [ASAqA1N36LMyEbCajX87MHSFTLey0cFmiyp8H7ZOTcUF6go](https://keybase.io/
aronasorman), yielding the signature:

hKRib2R5hqhkZXRhY2hlZMOpaGFzaF90eXBlCqNrZXnEIwEgKgNTd+izMhGwmo1/OzB0hUy3stHBZosqfB +2Tk3FBeoKp3BheWxvYWTFAvN7ImJvZHkiOnsia2V5Ijp7ImVsZGVzdF9raWQiOiIwMTAxMmU0ZThjMDBm ZmRlNWFkMzBlNTg5NDM1Y2VjM2NlN2RhZDViODRlOWQyZmY4YTUwZWM5OTViNzc1Mjc0YmIwNTBhIiwiaG 9zdCI6ImtleWJhc2UuaW8iLCJraWQiOiIwMTIwMmEwMzUzNzdlOGIzMzIxMWIwOWE4ZDdmM2IzMDc0ODU0

@aronasorman
aronasorman / sample_program.py
Last active September 8, 2016 01:22
Sample program for ricecooker
from ricecooker import raise_for_invalid_channel, guess_file_format, Channel, Video, Audio, Document
from ricecooker.exceptions import UnknownContentKindError
from fle_utils.constants import content_kinds, presets, languages, licenses
SAMPLE_TREE = [
{
"title": "Western Philosophy",
"id": "abd115",
"description": "Philosophy materials for the budding mind.",
"children": [

Testing out KA Lite and pt-BR on Linux

  1. Add the bleeding edge PPA:
sudo apt-get install sudo add-apt-repository ppa:learningequality/ka-lite-proposed
  1. Install KA Lite:
@aronasorman
aronasorman / grading-candidates.md
Last active March 1, 2016 16:19
How to rank our candidates based on criteria

How to rank criteria:

Technology depth:

1 - Uses a language without any knowledge of its idioms and conventions. As an example, writes Python code that looks like C or Java.

2 - Is aware of basic idioms taught in a tutorial. For Python, these would be using for ... in list rather than for i in range(len(list)), and other similar basic python constructs.

3 - Knowledge of community idioms and the standard library. with statements, using os.path for handling file paths are indications of this level.

4 - Adept of use of a language and its ecosystem found only after writing a lot of code with it.

Line # Mem usage Increment Line Contents
================================================
92 @profile
93 def initialize_content_caches(force=False):
94 """
95 Catch all function to regenerate any content caches in memory that need annotation
96 with file availability
97 52.445 MB 0.000 MB """
98 138.328 MB 85.883 MB for lang in i18n.get_installed_language_packs(force=True).keys():
99 52.457 MB -85.871 MB logging.info("Preloading exercise data for language {lang}.".format(lang=lang))
#!/usr/bin/env python
#
# iwlistparse.py
# Hugo Chargois - 17 jan. 2010 - v.0.1
# Parses the output of iwlist scan into a table
import sys
import subprocess
interface = "wlan0"