Thanks to minica it is very easy to create trusted SSL certificates that have a very long expiration date.
In order to get started you have to have the go tools installed and set up correctly in your environment.
Sometimes you need to edit a file on a remote server, but using vim/emacs is not very practical, due to lag and speed of screen refresh.
TextMate users have the classic rmate, but it was implemented in Ruby, which may not be available on the remote server.
A better option is to use this version of rmate, implemented in pure Bash. It's a single file, self-contained, and with no external dependencies.
Step by step:
require "pg" | |
require "benchmark" | |
require "faker" | |
def say(msg) | |
puts msg | |
end | |
conn = PG.connect(dbname: "postgres") |
On Tue Oct 27, 2015, history.state.gov began buckling under load, intermittently issuing 500 errors. Nginx's error log was sprinkled with the following errors:
2015/10/27 21:48:36 [crit] 2475#0: accept4() failed (24: Too many open files)
2015/10/27 21:48:36 [alert] 2475#0: *7163915 socket() failed (24: Too many open files) while connecting to upstream...
An article at http://www.cyberciti.biz/faq/linux-unix-nginx-too-many-open-files/ provided directions that mostly worked. Below are the steps we followed. The steps that diverged from the article's directions are marked with an *.
su
to run ulimit
on the nginx account, use ps aux | grep nginx
to locate nginx's process IDs. Then query each process's file handle limits using cat /proc/pid/limits
(where pid
is the process id retrieved from ps
). (Note: sudo
may be necessary on your system for the cat
command here, depending on your system.)fs.file-max = 70000
to /etc/sysctl.conf<?php | |
class Bahceli { | |
function __call($name, $args) { | |
if (preg_match('/yak|dov/i', $name)) { | |
return true; | |
} else { | |
return false; | |
} | |
} |
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.