Skip to content

Instantly share code, notes, and snippets.

@hoangclinh
hoangclinh / nginx-tuning.md
Created October 10, 2019 04:02 — 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.

@hoangclinh
hoangclinh / image-proxy.conf
Created May 2, 2018 07:20 — forked from tmaiaroto/image-proxy.conf
Nginx Image Filter Resize Proxy Service
# Feel free to change this path of course (and keys_zone value as well, but also change the usage of it below).
proxy_cache_path /var/www/cache/resized levels=1:2 keys_zone=resizedimages:10m max_size=1G;
# Gzip was on in another conf file of mine...You may need to uncomment the next line.
#gzip on;
gzip_disable msie6;
gzip_static on;
gzip_comp_level 4;
gzip_proxied any;
# Again, be careful that you aren't overwriting some other setting from another config's http {} section.
@hoangclinh
hoangclinh / restore-zimbra-config+mails.sh
Created April 10, 2016 06:46 — forked from igalic/restore-zimbra-config+mails.sh
Restore Zimbra's ldap, mysql and config from backup, as well as the store
#!/bin/bash
# sources
# https://wiki.zimbra.com/wiki/LDAP_data_import_export
# http://wiki.zimbra.com/wiki/Mysql_Crash_Recovery
# http://wiki.zimbra.com/wiki/CLI_zmvolume
set -e
# set limits as per zmslapadd
ulimit -n 32768
ulimit -c unlimited
Prerequisite
One instance of Alfresco on mysql, one postgresl of exactly the same version (schema version).
Step 1. Dump database
mysqldump --port 3306 -u alfresco --password=alfloftux -h 127.0.0.1 --databases alfresco --skip-comments --skip-extended-insert --no-create-db --hex-blob --default-character-set=utf8 --skip-triggers --compact --no-create-info --skip-quote-names > mydump.sql
Step 2. Dump local Postgres schema
You can install a clean version of Alfresco to use as for schema dump
(need to insert command for dump here)