Skip to content

Instantly share code, notes, and snippets.

View ishenkoyv's full-sized avatar

Yurii Ishchenko ishenkoyv

  • Selfemployed
  • Mykolaiv, Ukraine
View GitHub Profile
@ishenkoyv
ishenkoyv / gist:2956275
Created June 19, 2012 20:14
Производительность VPS poruch.net
# 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
<%
... code
%>
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)
# 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)
-- PostgreSQL 9.2 beta (for the new JSON datatype)
-- You can actually use an earlier version and a TEXT type too
-- PL/V8 http://code.google.com/p/plv8js/wiki/PLV8
-- Inspired by
-- http://people.planetpostgresql.org/andrew/index.php?/archives/249-Using-PLV8-to-index-JSON.html
-- http://ssql-pgaustin.herokuapp.com/#1
-- JSON Types need to be mapped into corresponding PG types
--
apt-get install php-pear
pear channel-discover pear.pdepend.org
pear install pdepend/PHP_Depend
pear channel-discover pear.phpmd.org
pear install phpmd/PHP_PMD
pear channel-discover pear.phpunit.de
pear channel-discover pear.symfony.com
pear install phpunit/phploc phpunit/phpcpd phpunit/PHP_CodeBrowser phpunit/PHPUnit phpunit/PHPUnit_MockObject phpunit/PHP_CodeCoverage
wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | apt-key add -

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";
 }
@ishenkoyv
ishenkoyv / gist:6f8d2c10e200c7a13c16
Created March 25, 2016 23:35 — forked from douglasjarquin/gist:2208690
Amazon RDS Performance Tuning Settings
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" \
@ishenkoyv
ishenkoyv / README.md
Created November 15, 2016 12:56 — forked from dpb587/README.md
Terminating Gearman Workers in PHP - locally and remotely stopping workers without interrupting jobs.