Skip to content

Instantly share code, notes, and snippets.

View odoucet's full-sized avatar

Olivier Doucet odoucet

  • OXEVA
  • Paris, France
View GitHub Profile
@odoucet
odoucet / gist:8918221
Created February 10, 2014 15:47
#64827 with PHP 5.4.25 backtrace
#0 zval_mark_grey (pz=0x1419fd0) at /usr/src/build/php/php-5.4.25/Zend/zend_gc.c:388
#1 0x00000000007fdeb5 in zval_mark_grey (pz=0x1419fd0) at /usr/src/build/php/php-5.4.25/Zend/zend_gc.c:432
#2 0x00000000007fedd5 in gc_mark_roots () at /usr/src/build/php/php-5.4.25/Zend/zend_gc.c:501
#3 gc_collect_cycles () at /usr/src/build/php/php-5.4.25/Zend/zend_gc.c:795
#4 0x00000000007ff028 in gc_zobj_possible_root (zv=<optimized out>) at /usr/src/build/php/php-5.4.25/Zend/zend_gc.c:221
#5 0x00000000007ec0a0 in zend_hash_destroy (ht=0x1c63710) at /usr/src/build/php/php-5.4.25/Zend/zend_hash.c:560
#6 0x00000000007ddd9d in _zval_dtor_func (zvalue=0x1c64288) at /usr/src/build/php/php-5.4.25/Zend/zend_variables.c:45
#7 0x00000000007d0dad in _zval_dtor (zvalue=<optimized out>) at /usr/src/build/php/php-5.4.25/Zend/zend_variables.h:35
#8 _zval_ptr_dtor (zval_ptr=0x1c6b0d0) at /usr/src/build/php/php-5.4.25/Zend/zend_execute_API.c:436
#9 0x0000000000801167 in zend_object_std_dtor (object=0x1c13e88) at /usr/src/build/
@odoucet
odoucet / other infos
Created April 5, 2015 18:40
ZFS stall infos
process arc_adapt :
blocked in status D
/proc/(pidof arc_adapt)/stat :
1564 (arc_adapt) D 2 0 0 0 -1 2269248 0 0 0 0 0 24533 0 0 0 -20 1 0 911 0 0 18446744073709551615 0 0 0 0 0 0 0 2147483647 0 18446744072101946508 0 0 17 4 0 0 0 0 0 0 0 0 0 0 0 0 0
(no change to this file after 10s sleep so this process seems to have no activity - cannot run "top" to make sure, it hangs)
@odoucet
odoucet / modsecurity_id_extractor.php
Created May 6, 2015 12:23
Extract modsecurity rule ID from modsec_audit.log
<?php
/***************
* Extract rule ID from modsecurity log
* and print TOP hits by rule ID
*
* @author github.com/odoucet
*
* useful when using mod_security as DETECTION_ONLY mode
*
* USAGE :
@odoucet
odoucet / parse_namedstats.php
Last active September 8, 2015 13:36
Named statistics parser into CSV
<?php
$fp = fopen('/etc/named/named.stats', 'r');
$data = array();
$start = false;
$currentHost = '';
while($line = fgets($fp, 1024)) {
if (strpos($line, 'Per Zone Query Statistics ') !== false) {
@odoucet
odoucet / proc-slabinfo
Created April 13, 2016 15:16
100% system load with 0.6.5.6 - zfs_znode_hold_enter suspected
slabinfo - version: 2.1
# name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> : tunables <limit> <batchcount> <sharedfactor> : slabdata <active_slabs> <num_slabs> <sharedavail>
lio_r2t_cache 285 531 64 59 1 : tunables 120 60 8 : slabdata 9 9 0
lio_ooo_cache 0 0 64 59 1 : tunables 120 60 8 : slabdata 0 0 0
lio_dr_cache 325 413 64 59 1 : tunables 120 60 8 : slabdata 7 7 0
lio_qr_cache 996 1120 32 112 1 : tunables 120 60 8 : slabdata 10 10 0
lio_cmd_cache 476 489 1216 3 1 : tunables 24 12 8 : slabdata 163 163 108
t10_alua_tg_pt_gp_mem_cache 124 154 48 77 1 : tunables 120 60 8 : slabdata 2 2 0
t10_alua_tg_pt_gp_cache 124 176 248 16 1 : tunables 120 60 8 : slabdata 11 11 0
t10_alua_lu_gp_mem_cache 124 385 48 77 1
@odoucet
odoucet / haproxy-sample.cfg
Last active May 26, 2016 09:25
HAProxy 1.6.5 bug with "show servers state"
global
chroot /tmp
daemon
group users
user nobody
pidfile /var/run/haproxy.pid
log xxx local2 notice
nbproc 4
server-state-file /tmp/haproxy_server_state
@odoucet
odoucet / haproxy-sample.cfg
Created December 27, 2016 16:41
HAProxy bug with balance uri + option prefer-last-server + hash-type consistent
global
pidfile /tmp/haproxytest.pid
defaults
# we do web !
mode http
option httpchk /c
option http-keep-alive
option http-pretend-keepalive
@odoucet
odoucet / agregate-fioresults.php
Last active March 21, 2017 16:13
FIO benchmarking with stats per job
<?php
/**
* Agregate stats per job on a unique file compatible with fio2gnuplot
**/
if (!$argv[1]) {
echo "syntax: ".$argv[0]." <prefix-file>\n";
echo "Example : ".$argv[0]." nametest\n";
}
$tests = array('bw','lat','slat','clat','iops');
@odoucet
odoucet / zpool-histogram
Last active November 17, 2017 14:39
ZFS performance issues
# NOTE:
# /dev/zvol/xxxxx/test volume is tested by FIO
# volblocksize 16K
# compression lz4
# usedbydataset 50.4G
# logbias latency
# sync always
xxxxxxx sync_read sync_write async_read async_write scrub
req_size ind agg ind agg ind agg ind agg ind agg
@odoucet
odoucet / fio on zvol with volblocksize=128k
Created November 20, 2017 11:08
bad read performance investigation
random-read: (g=0): rw=randread, bs=256KiB-256KiB,256KiB-256KiB,256KiB-256KiB, ioengine=libaio, iodepth=256
fio-2.18
Starting 1 process
Jobs: 1 (f=1): [r(1)][100.0%][r=27.3MiB/s,w=0KiB/s][r=109,w=0 IOPS][eta 00m:00s]
random-read: (groupid=0, jobs=1): err= 0: pid=5216: Mon Nov 20 11:25:52 2017
read: IOPS=111, BW=27.1MiB/s (29.4MB/s)(1678MiB/60002msec)
slat (usec): min=937, max=48829, avg=8931.40, stdev=4220.94
clat (usec): min=6, max=2544.4k, avg=2225904.59, stdev=255594.73
lat (msec): min=10, max=2560, avg=2234.84, stdev=255.58
clat percentiles (msec):