This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
php -d xdebug.collect_params=4 -d xdebug.collect_return=1 \ | |
-d xdebug.collect_includes=1 -d xdebug.auto_trace=1 pareto.t.php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ran with valgrind --tool=callgrind mysqld ... | |
# mysql -e 'select sleep(10)' | |
# callgrind_control -b | |
Frame: Backtrace for Thread 24 | |
[ 0] pthread_cond_timedwait@@GLIBC_2.3.2 (1 x) | |
[ 1] Interruptible_wait::wait(st_mysql_cond*, st_mysql_mutex*) (1 x) | |
[ 2] Item_func_sleep::val_int() (1 x) | |
[ 3] Item::send(Protocol*, String*) (2 x) | |
[ 4] Protocol::send_result_set_row(List<Item>*) (2 x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.beans.PropertyVetoException; | |
import java.io.IOException; | |
import java.sql.Connection; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.sql.Statement; | |
import java.time.Instant; | |
public class C3P0DataSourceExample { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.beans.PropertyVetoException; | |
import java.io.IOException; | |
import java.sql.Connection; | |
import java.sql.SQLException; | |
import com.mchange.v2.c3p0.ComboPooledDataSource; | |
public class DataSource { | |
private static DataSource datasource; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pid_file_path=/var/lib/mysql/mysqld.pid | |
for d in $(cat dbs-list.txt); do | |
#if ! grep $d important-dbs.txt; then continue; fi | |
mysql $d -BNe 'show tables' > /tmp/tables.txt | |
for t in $(cat /tmp/tables.txt); do | |
while true; do | |
test -s "$pid_file_path" && break |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create ext4 RAID | |
sudo mdadm --create --verbose /dev/md0 --level=10 --raid-devices=4 \ | |
--name=mysql /dev/sdb /dev/sdc /dev/sdd /dev/sde | |
sudo mkdir /mysql-ext4 | |
sudo mkfs.ext4 /dev/md0 | |
sudo mount -o rw,relatime /dev/md0 /mysql-ext4 | |
sudo mkdir /mysql-ext4/msb | |
sudo chown revin.revin /mysql-ext4/msb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "centos/7" | |
config.vm.provider "virtualbox" do |v| | |
v.memory = 4096 | |
v.cpus = 2 | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env SANDBOX_BINARY=/home/jervin/mysql make_sandbox 5.7.190 -- \ | |
--upper_directory=/mysql-ext4/msb --my_clause=innodb_buffer_pool_size=38G \ | |
--my_clause=innodb_log_file_size=536870912 --my_clause=innodb_flush_method=O_DIRECT \ | |
--my_clause=bind-address=0.0.0.0 --my_clause=skip_name_resolve=1 \ | |
--my_clause=thread_cache_size=48 --my_clause=performance_schema=off \ | |
--my_clause=max_allowed_packet=33554432 --my_clause=innodb_page_cleaners=8 \ | |
--my_clause=innodb_lru_scan_depth=2048 --my_clause=innodb_io_capacity=5000 \ | |
--my_clause=innodb_io_capacity_max=10000 --my_clause=innodb_flushing_avg_loops=5 \ | |
--my_clause=innodb_flush_neighbors=2 --my_clause=innodb_buffer_pool_instances=8 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DISK=xvdb | |
BACKUPVOL=xvdc | |
USER=ubuntu | |
KERNEL=$(uname -r) | |
wget https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release -sc)_all.deb | |
sudo dpkg -i percona-release_0.1-4.xenial_all.deb | |
sudo apt -y update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DISK=xvdb | |
USER=ubuntu | |
IP=$(ip -4 ad sh scope global | grep 'scope global' | awk '{print $2}' | cut -d'/' -f1 | head -n1) | |
KERNEL=$(uname -r) | |
wget https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release -sc)_all.deb | |
sudo dpkg -i percona-release_0.1-4.xenial_all.deb | |
sudo apt -y update |