Related blog post: dpb587.me/blog/2013/01/14/terminating-gearman-workers-in-php.html
MIT License (http://opensource.org/licenses/mit-license.php)
# Sample Nginx config with sane caching settings for modern web development | |
# | |
# Motivation: | |
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools. | |
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh | |
# and juicy version of your assets available. | |
# At some point, however, you want to show your work to testers, your boss or your client. | |
# After you implemented and deployed their feedback, they reload the testing page – and report | |
# the exact same issues as before! What happened? Of course, they did not have developer tools | |
# open, and of course, they did not empty their caches before navigating to your site. |
#!/bin/bash | |
set -e #break on first error | |
JENKINS_DIRECTORY=/var/lib/jenkins | |
JENKINS_JOBS_DIRECTORY=/var/lib/jenkins/jobs | |
JOB_CONFIG_BACKUP_HOME=/root/jenkins_backups | |
NOW=$(date +%Y-%m-%d_%H-%M-%S) | |
JOB_CONFIG_BACKUP_TARGET=$JOB_CONFIG_BACKUP_HOME/$NOW | |
echo "backing up config.xmls of all jenkins jobs under $JENKINS_JOBS_DIRECTORY" |
Related blog post: dpb587.me/blog/2013/01/14/terminating-gearman-workers-in-php.html
MIT License (http://opensource.org/licenses/mit-license.php)
rds-modify-db-parameter-group {param-group-name} \ | |
--parameters="name=character_set_server, value=utf8, method=pending-reboot" \ | |
--parameters="name=collation_server, value=utf8_general_ci, method=pending-reboot" \ | |
--parameters="name=tmp_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \ | |
--parameters="name=max_heap_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \ | |
--parameters="name=query_cache_type, value=1, method=pending-reboot" \ | |
--parameters="name=query_cache_size, value=131072, method=pending-reboot" \ | |
--parameters="name=table_open_cache, value=2500, method=pending-reboot" \ | |
--parameters="name=join_buffer_size, value={DBInstanceClassMemory/64}, method=pending-reboot" \ | |
--parameters="name=thread_cache_size, value={DBInstanceClassMemory/12582880}, method=pending-reboot" \ |
# Set cache dir | |
proxy_cache_path /var/cache/nginx levels=1:2 | |
keys_zone=microcache:5m max_size=1000m; | |
# Virtualhost/server configuration | |
server { | |
listen 80; | |
server_name yourhost.domain.com; | |
# Define cached location (may not be whole site) |
Linux installation notes (tested under Ubuntu 12.04LTS), assuming VirtualBox is installed.
1 CPU in system; running 1 parallel copy of tests | |
Dhrystone 2 using register variables 24237227.4 lps (10.0 s, 7 samples) | |
Double-Precision Whetstone 2723.7 MWIPS (8.8 s, 7 samples) | |
Execl Throughput 1474.5 lps (29.8 s, 2 samples) | |
File Copy 1024 bufsize 2000 maxblocks 225342.8 KBps (30.0 s, 2 samples) | |
File Copy 256 bufsize 500 maxblocks 61650.3 KBps (30.0 s, 2 samples) | |
File Copy 4096 bufsize 8000 maxblocks 673875.3 KBps (30.0 s, 2 samples) | |
Pipe Throughput 364597.8 lps (10.0 s, 7 samples) | |
Pipe-based Context Switching 71409.3 lps (10.0 s, 7 samples) |
# uptime | |
06:36:02 up 228 days, 21:12, 1 user, load average: 0.00, 0.10, 0.06 | |
# free | |
total used free shared buffers cached | |
Mem: 765660 626028 139632 0 69096 272268 | |
-/+ buffers/cache: 284664 480996 | |
Swap: 786424 72188 714236 |
I was tired of Chrome eating all my laptop resources so I decided to put some limit to it with cgroup.
As I was using Ubuntu 12.04 with support for cgroup, I installed the package cgroup-bin
and add the following group to the file /etc/cgconfig.conf
:
group browsers {
cpu {
# Set the relative share of CPU resources equal to 25%
cpu.shares = "256";
}