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
@mustafauysal
mustafauysal / apache-webp-rewrite.conf
Created August 11, 2020 19:20 — forked from seeekr/apache-webp-rewrite.conf
enabling apache to serve WebP image files if accepted by browser (and .webp files available)
## !! This snippet has been updated, but not tested in practice. It should work, please check / leave comments in case it doesn't. !! ##
# originally from https://groups.google.com/a/webmproject.org/group/webp-discuss/browse_thread/thread/196ac4ea705688d8
<IfModule mod_rewrite.c>
# TODO: don't forget to put
# AddType image/webp .webp
# in your mods-available/mime.conf
# (though this is optional because we're setting
# the mime type manually in the RewriteRule)
@mustafauysal
mustafauysal / nginx-tuning.md
Created May 20, 2019 15:28 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@mustafauysal
mustafauysal / nginx.conf
Created May 20, 2019 14:34 — forked from v0lkan/nginx.conf
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
<?php
add_action( 'bcn_after_fill', 'project_rebuild_breadcrumbs' );
/**
* Rebuild the breadcrumb created by Breadcrumb NavXT.
*
* @param bcn_breadcrumb_trail $breadcrumb Instance of the currently active breadcrumb trail.
*/
function project_rebuild_breadcrumbs( $breadcrumb ) {
@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 / 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
@mustafauysal
mustafauysal / gist:035b2d509186bb16df7500279d0b492a
Created January 23, 2018 23:14 — forked from chilic/gist:5803582
Debian memcached socket start script
#! /bin/sh
#
# chkconfig: - 55 45
# description: The memcached daemon is a network memory cache service.
# processname: memcached
# config: /etc/memcached.conf
# pidfile: /var/run/memcached/memcached.pid
# Standard LSB functions
. /lib/lsb/init-functions
@mustafauysal
mustafauysal / haproxy.cfg
Created March 27, 2017 17:21 — forked from GABeech/haproxy.cfg
Stack Exchange HAProxy
# This is an example of the Stack Exchange Tier 1 HAProxy config
# The only things that have been changed from what we are running are:
# 1. User names have been removed
# 2. All Passwords have been remove
# 3. IPs have been changed to use the example/documentation ranges
# 4. Rate limit numbers have been changed to randome numbers, don't read into them
userlist stats-auth
group admin users $admin_user
user $admin_user insecure-password $some_password
@mustafauysal
mustafauysal / about.md
Created January 6, 2017 13:05 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@mustafauysal
mustafauysal / nginx.conf
Created October 22, 2015 20:46 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048