Skip to content

Instantly share code, notes, and snippets.

View IvanChepurnyi's full-sized avatar
🚀
Building awesome high performance microservices

Ivan Chepurnyi IvanChepurnyi

🚀
Building awesome high performance microservices
View GitHub Profile
@IvanChepurnyi
IvanChepurnyi / JIT
Created June 27, 2020 09:55
17k r/sec
wrk -c 500 -d 1m -t 12 -R 17k -L http://localhost:8888
Running 1m test @ http://localhost:8888
12 threads and 500 connections
Thread calibration: mean lat.: 33.914ms, rate sampling interval: 25ms
Thread calibration: mean lat.: 29.841ms, rate sampling interval: 26ms
Thread calibration: mean lat.: 25.915ms, rate sampling interval: 25ms
Thread calibration: mean lat.: 36.787ms, rate sampling interval: 27ms
Thread calibration: mean lat.: 44.106ms, rate sampling interval: 29ms
Thread calibration: mean lat.: 32.432ms, rate sampling interval: 26ms
Thread calibration: mean lat.: 42.213ms, rate sampling interval: 28ms
@IvanChepurnyi
IvanChepurnyi / JIT results
Last active April 29, 2021 12:33
Benchmark HTTP service
wrk -c 500 -d 30s -t 12 -R 20k -L http://localhost:8888
Running 30s test @ http://localhost:8888
12 threads and 500 connections
Thread calibration: mean lat.: 456.139ms, rate sampling interval: 3485ms
Thread calibration: mean lat.: 458.787ms, rate sampling interval: 3125ms
Thread calibration: mean lat.: 294.161ms, rate sampling interval: 1654ms
Thread calibration: mean lat.: 391.126ms, rate sampling interval: 3123ms
Thread calibration: mean lat.: 325.404ms, rate sampling interval: 2699ms
Thread calibration: mean lat.: 359.069ms, rate sampling interval: 2533ms
Thread calibration: mean lat.: 72.867ms, rate sampling interval: 222ms
@IvanChepurnyi
IvanChepurnyi / server.php
Last active October 28, 2023 15:34
Simple multi-process ReactPHP server with workers control
<?php
/**
* Copyright © EcomDev B.V. All rights reserved.
* See LICENSE.txt for license details.
*/
declare(strict_types=1);
$port = $argv[1];
$serverName = $argv[2];
@IvanChepurnyi
IvanChepurnyi / install-unison.sh
Created October 28, 2016 17:44
Install Unison on Ubuntu LTE 12.04 from source
#!/bin/bash
apt-get install python-software-properties
add-apt-repository ppa:avsm/ppa
apt-get update -y -f
apt-get install ocaml opam -y
mkdir -p /usr/src/unison/
cd /usr/src/unison/
@IvanChepurnyi
IvanChepurnyi / optimize-composer.sh
Created September 30, 2016 16:00
Optimizes autoloader for the best performance on production system
#!/bin/bash
magentodir=$1
cd $magentodir
read -d '' script << PHP
<?php
\$composer = json_decode(file_get_contents('composer.json'), true);
if (!is_array(\$composer['autoload']['psr-0'][''])) {
@IvanChepurnyi
IvanChepurnyi / php-fpm-cli
Created September 12, 2016 01:32
Benchmark Scripts (Root User Usage)
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Mathias Leppich <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@IvanChepurnyi
IvanChepurnyi / test.php
Created September 8, 2016 14:38
Sample counter server in ReactPHP
<?php
require 'vendor/autoload.php';
$counter = new stdClass();
$counter->counter = 100000;
$counter->requests = 0;
$app = function ($request, $response) use ($counter) {
if ($request->getPath() === '/favicon.ico') {
<?php
ini_set('memory_limit', '2G');
class ExampleByReference
{
public function __invoke(&$array)
{
foreach ($array as $index => &$value) {
$this->itemRoutine($value);

Usage is quite simple, you need to create in your $HOME a directory called .acme and place there such a config.yml file in it with the following options:

# E-mail to use for the setup.
# This e-mail will receive expiration notices from Let's Encrypt.
email: [email protected]

# List of certificates to issue.
certificates:
    # For each certificate, there are a few options.
    #
Verifying that +ivanchepurnyi is my blockchain ID. https://onename.com/ivanchepurnyi