This file contains hidden or 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
#!/usr/bin/env sh | |
# 'ab' program freezes after lots of requests, why? | |
# http://stackoverflow.com/questions/1216267/ab-program-freezes-after-lots-of-requests-why | |
# Enter sudo mode | |
sudo -i | |
# net.inet.ip.portrange.first: 49152 -> 32768 | |
sysctl -w net.inet.ip.portrange.first=32768 |
This file contains hidden or 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
#!/usr/bin/env python | |
import sys, os, time, atexit | |
from signal import SIGTERM | |
class Daemon: | |
""" | |
A generic daemon class. | |
Usage: subclass the Daemon class and override the run() method |
NewerOlder