原创 如何設計高併發時高吞吐量的架構

高併發和高吞吐量是矛盾存在,能不用鎖就不要鎖,悲觀鎖或者樂觀鎖在使用的時候只有在查詢結果後要做處理,才需要鎖,這個時候往往事務即可支持,如果要粒度更小,可以不用事務。但是一旦鎖後要考慮其他查詢是否允許執行。

原创 python

[url]http://blog.csdn.net/moodytong/article/details/8136258[/url]字符串編碼常用類型:utf-8,gb2312,cp936,gbk等。pyth

原创 Httpclient 設置域名指向ip的兩種方式

httpRequest是由params和url構成 private static String send2(HttpUriRequest httpRequest, CookieStore cookie

原创 jackson json轉bean忽略沒有的字段 not marked as ignorable

@JsonIgnore註解用來忽略某些字段,可以用在Field或者Getter方法上,用在Setter方法時,和Filed效果一樣。這個註解只能用在POJO存在的字段要忽略的情況,不能滿足現在需要的情況。@

原创 linux 內存查看

free -h總內存使用查看佔用內存最多的10個程序使用ps -aux|sort -k 4 -rn |head -10命令查看top -d pid

原创 thread interrupt

Thread thread4 = new Thread(){ public void run(){ try { //synchronized(this){ //this.wait

原创 reset revet

revert to this revision sourcetree git裏的命令reset revert changes from this version sourcetre

原创 du -sh/df -h

[url]http://my.oschina.net/liting/blog/392051[/url]查看硬盤的使用情況df,-h單元爲根據大小適當顯示,-m單位爲M,查看指定目錄的文件大小du,查看當前目

原创 spring viewResolve源碼解讀

spring處理完請求後返回通過spring mvc的v去返回,我們這裏可以自定義[img]http://dl2.iteye.com/upload/attachment/0120/0627/1a6d4bb2

原创 將博客搬至CSDN

將博客搬至CSDN

原创 ServletServerHttpRequest getinputstream獲取不到字節數據

使用spring4.0的框架,重新定義messageconverter解析類,只加了一個自定義的jackson解析模型,直接copy MappingJackson2HttpMessageConverter類

原创 壓縮算法

[url]http://www.infoq.com/cn/news/2015/01/zstandard-compression-algorithm[/url][img]http://dl2.iteye.co

原创 substring

string s= "asdf"s.substring(0,s.length);end - start + 1= lengths.length 不是最後一位所以 s.length - 1 纔是最後一位第一位

原创 maven.test.skip和skipTests的區別

[url]http://blog.csdn.net/arkblue/article/details/50974957[/url]

原创 aws搭建pptp

搭建了一個shadowsocks,沒遇到什麼問題,只有在aws安全組的時候忘了配置端口,浪費了點時間。但是這個pptpd反而最浪費時間。不全資料https://leonax.net/p/3274/insta