随笔分类 -  java

tomcat8优化积累/http协议对比
摘要:https://zhuanlan.zhihu.com/p/73620440 https://events.static.linuxfound.org/sites/events/files/slides/TomcatConnectorsEU_0.pdf https://mp.weixin.qq.com 阅读全文

posted @ 2019-12-12 08:31 CreatorKou 阅读(183) 评论(0) 推荐(0)

java多线程的意义
摘要:https://www.zhihu.com/question/332042250 阅读全文

posted @ 2019-12-12 08:24 CreatorKou 阅读(247) 评论(0) 推荐(0)

tomcat外观模式的意义(安全)
摘要:《How Tomcat works》,中文版结合看。 第一章是简单的web服务器实现,简单HTTP请求后进行返回,这个需要了解HTTP的请求和响应的组成。然后会使用Socket和ServerSocket就可以模拟简单的实现。大概的思路就是HTTP请求后,解析后返回响应,浏览器根据响应的格式返回特定的 阅读全文

posted @ 2019-11-29 14:41 CreatorKou 阅读(235) 评论(0) 推荐(0)

netty DefaultAttributeMap(比hashmap节省空间)源码学习AtomicReferenceArray/AtomicReference/ConcurrentHashMap乐观锁cas/悲观锁synchronized
摘要:DefaultAttributeMap : private volatile AtomicReferenceArray<DefaultAttribute<?>> attributes; 寻址方式: Attributekey父类: public abstract class AbstractConst 阅读全文

posted @ 2019-11-28 15:19 CreatorKou 阅读(357) 评论(0) 推荐(0)

disruptor和ArrayBlockingQueue和LinkedBlockingQueue队列性能对比
摘要:https://www.cnblogs.com/dafanjoy/p/10345897.html disruptor的workhandler特点也可以用来作为线程池,替代jdk自带的基于阻塞队列线程池,实测性能也有很大提升。 阅读全文

posted @ 2019-11-27 15:03 CreatorKou 阅读(503) 评论(0) 推荐(0)

守护线程的作用和前台线程的区别
摘要:https://www.cnblogs.com/albertrui/p/8384189.html https://www.cnblogs.com/ziq711/p/8228255.html 阅读全文

posted @ 2019-11-18 21:23 CreatorKou 阅读(215) 评论(0) 推荐(0)

java读取资源文件/打jar包后读取资源文件的区别
摘要:https://www.iteye.com/topic/483115 我们常常在代码中读取一些资源文件(比如图片,音乐,文本等等)。在单独运行的时候这些简单的处理当然不会有问题。但是,如果我们把代码打成一个jar包以后,即使将资源文件一并打包,这些东西也找不出来了。看看下面的代码: Java代码 / 阅读全文

posted @ 2019-10-21 11:21 CreatorKou 阅读(1086) 评论(0) 推荐(0)

netty优化学习积累+++++++
摘要:一、 c/s-Handler在需要发送消息时,不一定必须调用writeandFlush(),如果对于一些零碎的消息都writeAndFlush(),那么多次频繁的调用对应多次的syscall系统调用,如何减少系统调用提高效率? write()函数,对于多次要发送的零碎的消息都采用write()函数, 阅读全文

posted @ 2019-10-14 20:12 CreatorKou 阅读(275) 评论(0) 推荐(0)

aio的缺陷和问题(linux aio, java aio(nio.2)
摘要:https://lwn.net/Articles/671649/ https://stackoverflow.com/questions/20973754/linux-aio-poor-scaling 高性能网络服务器编程:为什么linux下epoll是最好,Netty要比NIO.2好? http: 阅读全文

posted @ 2019-10-14 10:48 CreatorKou 阅读(751) 评论(0) 推荐(0)

netty pooled vs unpooled ByteBuf
摘要:Whats the difference between Pooled vs Unpooled and Direct vs Heap in ByteBuf? Like , what does pooled means in context of a message received , becaus 阅读全文

posted @ 2019-10-12 19:48 CreatorKou 阅读(1217) 评论(0) 推荐(0)

scatter/gather IO原理
摘要:https://stackoverflow.com/questions/10520182/linux-when-to-use-scatter-gather-io-readv-writev-vs-a-large-buffer-with-frea The main convenience offered 阅读全文

posted @ 2019-10-10 19:50 CreatorKou 阅读(360) 评论(1) 推荐(0)

Maven项目依赖外部jar进行打包的两种方式
摘要:https://blog.csdn.net/abcwanglinyong/artic 项目中除了pom.xml依赖之外,有时还依赖了其他jar包,如图: 依赖的方式如下: 点击Project Structure进行项目设置,在Modules中Dependencies标签中点击+号 添加lib下的所有 阅读全文

posted @ 2019-10-09 08:11 CreatorKou 阅读(2386) 评论(0) 推荐(0)

java命令行工具打包
摘要:https://introcs.cs.princeton.edu/java/85application/jar/jar.html 自己写的manifest.mf注意: https://blog.csdn.net/neareast/article/details/8875342 (1)后缀名必须为.m 阅读全文

posted @ 2019-09-30 21:18 CreatorKou 阅读(393) 评论(0) 推荐(0)

Http-Netty-Rpc-Service系统改造:不要在springboot的启动主线程中阻塞,nettyserver的postconstruct注解的init方法中不要写future.channel().closeFuture().sync();
摘要:常规的demo级别的netty服务端的代码写法是这样的: 在这里面future.channel().closeFuture().sync();这个语句的主要目的是,方便测试,方便写一个非springboot的demo,比如一个简单地junit test方法,closeFuture().sync()可 阅读全文

posted @ 2019-09-29 11:34 CreatorKou 阅读(4974) 评论(0) 推荐(0)

maven打包插件的区别(jar,assembly, shade)
摘要:https://medium.com/@randilfernando/when-to-use-maven-jar-maven-assembly-or-maven-shade-ffc3f76ba7a6 阅读全文

posted @ 2019-09-27 09:12 CreatorKou 阅读(1041) 评论(0) 推荐(0)

非对称密码学,摘要,加密,数字签名,数字证书
摘要:非对称密码学,摘要,加密,数字签名,数字证书,https://www.jianshu.com/p/4932cb1499bf https://www.cnblogs.com/lovelinux199075/p/9022589.html https数字证书被篡改?CA的权威性,申请认证具有门槛https 阅读全文

posted @ 2019-09-24 11:34 CreatorKou 阅读(200) 评论(0) 推荐(0)

jmeter压力测试netty-rpc-service
摘要:只发送消息,不等待结果,线程太快,有些channel还没有写完数据,就stop了,所以本来设置了1000个samples,结果只有337次发送到服务端 jmeter的threadgroup中的每个thread在启动时,拿到public class TestDemo extends AbstractJ 阅读全文

posted @ 2019-09-20 23:43 CreatorKou 阅读(2270) 评论(1) 推荐(0)

jmeter java request需要executable jar需要打包,,javac,jar打包,,maven shade打包,maven assembly打包,全依赖包,可执行包,assembly包太大,maven取消传递依赖exclusions
摘要:jmeter初学,用http request sampler作为sampler,有限制,自己写的tcp c/s代码需要压测,只能再写一个springboot controller + tomcat,在controller中创建客户端,连接服务器,然而这些还需要tomcat dispacher 分派h 阅读全文

posted @ 2019-09-20 11:45 CreatorKou 阅读(383) 评论(0) 推荐(0)

jmeter学习总结
摘要:jmeter5.1.1: 使用jmeter客户端生成jmx后缀的测试脚本,在TestPlan节点下的ThreadGroup,等其他子节点,按照从上到下顺序执行,badboy脚本录制软件没有下载, 添加HttpRequest Defaults设置一些默认的信息,添加一个空的HttpCookieMana 阅读全文

posted @ 2019-09-17 21:04 CreatorKou 阅读(306) 评论(0) 推荐(0)

On Windows, I got "Unable to delete directory". What's wrong?
摘要:On Windows, I got "Unable to delete directory". What's wrong? For instance, clean could fail if you already have opened a command line with target as 阅读全文

posted @ 2019-09-12 08:49 CreatorKou 阅读(196) 评论(0) 推荐(0)

导航