This file contains 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
[uwsgi] | |
;this will encode uwsgi messages into JSON, encode requests to JSON and leave application output unchanged | |
;if this output from application has msgName string | |
logger = default stdio | |
logger = secondlogger stdio | |
log-route = secondlogger msgName | |
log-route = default ^((?!msgName).)*$ | |
log-encoder = json:default {"@timestamp":"${strftime:%%Y-%%m-%%dT%%H:%%M:%%S.666Z}","source":"uwsgi", "message":"${msg}"} |
This file contains 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
-- | |
(* | |
this small script will launch iterm and open several tabs and run ssh connection to each server in list | |
*) | |
set servers to {"sandbox-19", "sandbox-19", "sandbox-19", "sandbox-19"} | |
tell application "iTerm" | |
activate | |
tell the first window | |
repeat with server in servers |
This file contains 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
nginx.conf: | |
... | |
log_by_lua_block { | |
ngx.log(ngx.ERR,ngx.var.request_uri) | |
ngx.log(ngx.ERR,ngx.req.get_headers()["Cookie"]) | |
} | |
... |
This file contains 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
If you redis initial replication fails with error like | |
"5101:M 20 Feb 18:14:29.130 # Client id=4500196 addr=71.459.815.760:43872 fd=533 name= age=127 idle=127 flags=S db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=13997 oll=1227 omem=192281275 events=rw cmd=psync scheduled to be closed ASAP for overcoming of output buffer limits. | |
means that slave buffer is not enough and you should increase it (at master!) with command like | |
redis-cli config set client-output-buffer-limit "slave 836870912 836870912 0" | |
more info: https://redis.io/topics/clients |
This file contains 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
If you have many hosts glued together by SSL haproxy you may encounder high CPU usage - that is because defaul TLS cache is not enough | |
to hold all keys and they regenerate each connection. | |
Solution is to increase tune.ssl.cachesize parameter. |
This file contains 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
I have Lua script that manipulates cookies and headers based at GET parameters. | |
This script didnt work well at one location, strangely the ngx.var.args was empty with ordinary request. | |
The trick was that in location we have: | |
location /x/ { | |
header_filter_by_lua_file /etc/nginx/lua/referrer_cookie.lua; | |
rewrite ^/x/(.*) /$1 break; | |
try_files $uri /x/index.htm; |
This file contains 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
Sometimes newrelic fails to connect to local agent at CentOS 7 server. | |
That is because newrelic-daemon do not listen at ipv6 address: | |
( newrelic.daemon.port = 8888 ) | |
typical errors from log files are: | |
warning: daemon connect(fd=6 port=8888) returned -1 errno=ECONNREFUSED. Failed to connect to the newrelic-daemon. Please make sure that there is a properly configured newrelic-daemon running. For additional assistance, please see: https://newrelic.com/docs/php/newrelic-daemon-startup-modes | |
and |