Skip to content

Instantly share code, notes, and snippets.

View eklitzke's full-sized avatar

Evan Klitzke eklitzke

View GitHub Profile
@eklitzke
eklitzke / percona.live.notes.md
Created February 17, 2011 01:04
percona live notes

Percona Server with XtraDB

Introduction

  • 2010 InnoDB 5.1 announced, will first ship with MySQL 5.5.
  • Historically InnoDB development lags while MySQL is trying to GA
  • lots of things fixed in InnoDB since MySQL 5.0
  • important note -- plugin version of InnoDB is not the default in 5.1
@eklitzke
eklitzke / httpbench.py
Created June 15, 2011 20:16
simple tornado httpclient benchmark
import os
import optparse
import signal
import time
import tornado.httpserver
import tornado.httpclient
import tornado.simple_httpclient
import tornado.curl_httpclient
import tornado.ioloop
@eklitzke
eklitzke / gist:1053328
Created June 29, 2011 07:34
add_callback example
import tornado.ioloop
loop = tornado.ioloop.IOLoop.instance()
def callback(*args):
loop.add_callback(callback)
callback()
loop.start()
@eklitzke
eklitzke / gist:1055597
Created June 30, 2011 03:51
add_callback benchmark
import optparse
import time
from tornado.ioloop import IOLoop
def main(iterations):
loop = IOLoop.instance()
counter = [0]
def callback(*args):
counter[0] += 1
/**
* A FunctionTemplate is used to create functions at runtime. There
* can only be one function created from a FunctionTemplate in a
* context. The lifetime of the created function is equal to the
* lifetime of the context. So in case the embedder needs to create
* temporary functions that can be collected using Scripts is
* preferred.
*
* A FunctionTemplate can have properties, these properties are added to the
* function object when it is created.
/**
* A FunctionTemplate is used to create functions at runtime. There
* can only be one function created from a FunctionTemplate in a
* context. The lifetime of the created function is equal to the
* lifetime of the context. So in case the embedder needs to create
* temporary functions that can be collected using Scripts is
* preferred.
*
* A FunctionTemplate can have properties, these properties are added to the
* function object when it is created.
1333743808.054205 --- SIGTERM (Terminated) @ 0 (0) ---
1333743808.054361 rt_sigreturn(0xf) = -1 EINTR (Interrupted system call)
1333743808.054589 socket(PF_FILE, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 7
1333743808.054789 connect(7, {sa_family=AF_FILE, path="/dev/log"}, 110) = 0
1333743808.054988 sendto(7, "<38>Apr 6 13:23:28 sshd[2330]: "..., 64, MSG_NOSIGNAL, NULL, 0) = 64
1333743808.055198 close(7) = 0
1333743808.055429 close(3) = 0
1333743808.055670 close(4) = 0
1333743808.055894 close(5) = 0
1333743808.056061 close(6) = 0
1
4 2
3
7 5
6
1->2->3->4 forms a loop
3->5->6->7 forms a loop
4 and 5 are slaves of 3
#include <stdio.h>
#include <unistd.h>
int main(int argc, char **argv) {
char buf[100];
chdir("//");
getcwd(buf, sizeof(buf));
printf("%s\n", buf);
return 0;
}
#include <assert.h>
#include <ctype.h>
#include <cxxabi.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>