Skip to content

Instantly share code, notes, and snippets.

View shijinkui's full-sized avatar

JK shijinkui

View GitHub Profile
@shijinkui
shijinkui / gist:2247944
Created March 30, 2012 06:48
caches使用点滴
1. 线程池的大小根据程序调整,最好使用默认配置。
如果是声明单例对象,就把池子开大点,如果是worker里的实例对象,根据处理能力做调整。
@shijinkui
shijinkui / gist:2274288
Created April 1, 2012 10:25
git remote command
添加remote
$ git remote add origin git://github.com/paulboone/ticgit.git
$ git remote -v
origin git@192...:/opt/git/sohutw-timeline.git (fetch)
origin git@192...:/opt/git/sohutw-timeline.git (push)
@shijinkui
shijinkui / gist:2341194
Created April 9, 2012 03:32
关闭spotlight
sudo mdutil -i off
sudo mdutil -d
@shijinkui
shijinkui / gist:2368040
Created April 12, 2012 15:14
netstat command
netstat -an | grep 11214 |awk '{print $5}' |awk -F ':' '{print $1}' |sort -n |uniq -c
@shijinkui
shijinkui / gist:2410568
Created April 18, 2012 02:06
Java程序员常用工具集
http://www.blogjava.net/killme2008/archive/2012/04/17/374936.html
我发现很多人没办法高效地解决问题的关键原因是不熟悉工具,不熟悉工具也还罢了,甚至还不知道怎么去找工具,这个问题就大条了。我想列下我能想到的一个Java程序员会用到的常用工具。
一、编码工具
1.IDE:Eclipse或者IDEA,熟悉尽可能多的快捷键,《Eclipse常见快捷键列表》
2.插件:
(1) Findbugs,在release之前进行一次静态代码检查是必须的
(2) Clover,关心你的单元测试覆盖率
@shijinkui
shijinkui / gist:2516914
Created April 28, 2012 07:39
git global ignore
git config --global core.excludesfile ~/.gitignore
http://f2e.us/wiki/git-ignore.html#!/
@shijinkui
shijinkui / gist:2658840
Created May 11, 2012 10:28
TDDL动态数据源使用示例说明
http://rdc.taobao.com/team/jm/archives/1645
@shijinkui
shijinkui / gist:2658878
Created May 11, 2012 10:34
TDDL淘宝的分库分表开源产品
svn co http://code.taobao.org/svn/tddl-dynamic-datasource/trunk tddl-dynamic-datasource
@shijinkui
shijinkui / gist:2760459
Created May 21, 2012 03:39
Proxool配置详解
Proxool连接池是sourceforge下的一个开源项目,这个项目提供一个健壮、易用的连接池,最为关键的是这个连接池提供监控的功能,方便易用,便于发现连接泄漏的情况。开源项目地址是: http://proxool.sourceforge.net/
Proxool提供了很多配置属性,其属性意义如下,当然还是建议直接查看官方文档http://proxool.sourceforge.net/properties.html:
simultaneous-build-throttle:
This is the maximum number of connections we can be building at any one time. That is, the number of new connections that have been requested but aren’t yet available for use. Because connections can be built using more than one thread (for instance, when they are built on demand) and it takes a finite time between deciding to build the connection and it becoming available we need some way of ensuring that a lot of threads don’t all decide to build a connection at once. (We could solve this in a smarter way – and indeed we will one day) Default is 10.
是指在任一时刻,可以(同时)建立的最大连接数,也就是说,就是已经请求的、但还没可用的新连接数量。因为连接可以用多线程建立,从决定要建立连接到连接可用是需要一定时间的,所以我们需要一些方式来避免大量的线程想同时建立连接。(我们本应该找一个更聪明的方式来解决这个问题,总有一天我们会找到的)默认值是10
当我使用140个用户,进行压力测试时,发现偶尔,会有多于10个要求同时建立连接的请求,当请求数量超过限定的数值时,会出现连接失败的情
@shijinkui
shijinkui / gist:2794285
Created May 26, 2012 15:17
jmeter压力测试工具
http://jmeter.apache.org/