Skip to content

Instantly share code, notes, and snippets.

View mustafauysal's full-sized avatar
💭
addressing some issues... 🧑🏻‍💻

Mustafa Uysal mustafauysal

💭
addressing some issues... 🧑🏻‍💻
View GitHub Profile
<?php
// MASTER machine
$wpdb->add_database(array(
'host' => DB_HOST,
'user' => DB_USER,
'password' => DB_PASSWORD,
'name' => DB_NAME,
'write' => 1,
'read' => 0,
@mustafauysal
mustafauysal / db-config.php
Last active February 3, 2020 10:08
BuddyPress HyperDB example
<?php
$wpdb->add_database( array(
'host' => 'global.db.example.com',
'user' => 'globaluser',
'password' => 'globalpassword',
'name' => 'globaldb',
) );
$wpdb->add_database( array(
'host' => 'bp.db.example.com',
@mustafauysal
mustafauysal / db-config.php
Created February 24, 2019 13:47
HyperDB multisite example
<?php
$wpdb->add_database( array(
'host' => 'global.db.example.com',
'user' => 'globaluser',
'password' => 'globalpassword',
'name' => 'globaldb',
) );
$wpdb->add_database( array(
@mustafauysal
mustafauysal / db-config.php
Last active February 24, 2019 13:44
HyperDB config examples
<?php
// MASTER machine
$wpdb->add_database(array(
'host' => DB_HOST,
'user' => DB_USER,
'password' => DB_PASSWORD,
'name' => DB_NAME,
'write' => 1,
'read' => 0,
@mustafauysal
mustafauysal / wp-update.sh
Created December 22, 2018 10:08 — forked from pacoorozco/wp-update.sh
Backup and update a Wordpress Site using wp-cli
#!/usr/bin/env bash
##########################################################################
# Shellscript: Backup and update WordPress using wp-cli
# Author : Paco Orozco <paco@pacoorozco.info>
# Requires : wp-cli
##########################################################################
# Changelog
# 20170125: 1.0
# Adds a default option to upgrade only when it's needed.
# 20161220: 0.1
@mustafauysal
mustafauysal / 4-vCPUs-8G-compare.md
Created December 17, 2018 20:38
DO vs Vultr Disk Benchmark

DO

sysbench --test=fileio --file-total-size=50G --file-test-mode=rndrw --init-rng=on --max-time=300 --max-requests=0 run

Operations performed:  284700 Read, 189800 Write, 607354 Other = 1081854 Total
Read 4.3442Gb  Written 2.8961Gb  Total transferred 7.2403Gb  (24.713Mb/sec)
 1581.66 Requests/sec executed

Test execution summary:
    total time:                          300.0011s
    total number of events:              474500
@mustafauysal
mustafauysal / docker-compose.yml
Created September 1, 2018 17:45
Graylog docker compose file
version: '2'
services:
# MongoDB: https://hub.docker.com/_/mongo/
mongodb:
image: mongo:3
# Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docker.html
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.3
environment:
- http.host=0.0.0.0
@mustafauysal
mustafauysal / powered-cache-purge-all.php
Last active September 27, 2023 15:40
Purge all page cache when a post update happen.
<?php
add_action( 'powered_cache_advanced_cache_purge_post', function ( $post_id ) {
\PoweredCache\Utils\clean_page_cache_dir();
} );
@mustafauysal
mustafauysal / DO-1G-Old.md
Last active December 17, 2018 20:27
CPU benchmarks

sysbench --test=cpu --cpu-max-prime=20000 run

sysbench 0.4.12:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 1

Doing CPU performance benchmark
@mustafauysal
mustafauysal / commands.sh
Created January 24, 2018 10:27 — forked from hassansin/commands.sh
Web Server Performance Comparison #sysbench #benchmark
# Ref: http://wiki.mikejung.biz/Sysbench
# CPU
sysbench --test=cpu --cpu-max-prime=20000 run
sysbench --test=cpu --cpu-max-prime=20000 run --num-threads=4
#FILE IO
sysbench --test=fileio --file-total-size=4G prepare
sysbench --test=fileio --file-total-size=4G --file-test-mode=rndrw --max-time=300 --max-requests=0 --file-extra-flags=direct run
sysbench --test=fileio --file-total-size=4G cleanup