- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在使用 TomCat 编写服务,并试图了解 HTTP1.1 的流水线功能及其在 Tomcat 中的实现。
这是我的问题:
1] TomCat 中的流水线是并行的。即 => 在获得流水线请求后,是否将其分解为单个请求并并行调用所有请求?这是我做的一个小测试:从我的测试来看它看起来像,但我试图找到权威文档等?
public static void main(String[] args) throws IOException, InterruptedException
{
Socket socket = new Socket();
socket.connect(new InetSocketAddress("ServerHost", 2080));
int bufferSize = 166;
byte[] reply = new byte[bufferSize];
DataInputStream dis = null;
//first without pipeline - TEST1
// socket.getOutputStream().write(
// ("GET URI HTTP/1.1\r\n" +
// "Host: ServerHost:2080\r\n" +
// "\r\n").getBytes());
//
// final long before = System.currentTimeMillis();
// dis = new DataInputStream(socket.getInputStream());
// Thread.currentThread().sleep(20);
// final long after = System.currentTimeMillis();
//
// dis.readFully(reply);
// System.out.println(new String(reply));
//now pipeline 3 Requests - TEST2
byte[] request = ("GET URI HTTP/1.1\r\n" +
"Host:ServerHost:2080\r\n" +
"\r\n"+
"GET URI HTTP/1.1\r\n" +
"Host: ServerHost:2080\r\n" +
"\r\n"+
"GET URI HTTP/1.1\r\n" +
"Host: ServerHost:2080\r\n" +
"\r\n").getBytes();
socket.getOutputStream().write(request);
bufferSize = 1000*1;
reply = new byte[bufferSize];
final long before = System.currentTimeMillis();
dis = new DataInputStream(socket.getInputStream());
Thread.currentThread().sleep(20);
final long after = System.currentTimeMillis();
dis.readFully(reply);
System.out.println(new String(reply));
long time = after-before;
System.out.println("Request took :"+ time +"milli secs");
}
在上面的测试中,test2 中的响应时间不是 [20*3 = 60+ ms]。实际的 GET 请求非常快。这暗示这些正在并行化,除非我遗漏了什么?
2] Tomcat 中的默认管道深度是多少?我该如何控制它?
3] 当允许在服务器端为我的服务进行流水线操作时,假设客户端遵循 http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.1.4,我是否需要考虑其他任何事情?处理流水线时的规范?欢迎任何经验。
最佳答案
我有一个关于 Apache 如何工作的类似问题,在进行了几次测试后,我可以确认 Apache 实际上会等待每个请求被处理,然后再开始处理下一个请求,因此处理是连续的
关于apache - Tomcat 中的流水线 - 并行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5748897/
我需要多少档才能正确执行以下指令。我对我所做的事情有些困惑,所以我在这里看到专家的答案。 lw $1,0($2); beq $1,$2,Label; 请注意,检查是否会发生分支将在解码阶段完成。但是在
我正在用 C 语言编写这段代码,它计算并绘制 6 级流水线和超标量架构上的周期总数。代码编译得很好,但是当我运行它时,出现段错误。 我在此选项中遇到段错误。我输入我的选择为 1,然后输入总周期为 5。
我一直在阅读有关流水线的内容,也阅读了这个主题 - How to send a simple string between two programs using pipes? 我阅读了@jschmie
我刚刚在读这个Wikipedia article在 HTTP 流水线和图表中,似乎可以在一个连接上同时发送响应。我是不是误解了图表,或者这是允许的吗? Section 8.1.2.2 of RFC 2
我试图了解什么是 HTTP 流水线和 HTTP keep-alive 连接,并试图在这两个主题和 Server Sent 事件技术之间建立联系。 据我了解,HTTP keep-alive connec
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
背景 Rainbond 本身具有基于源码构建组件的能力,可以将多种编程语言的代码编译成 Docker 镜像,但是在持续集成的过程中,往往会需要对提交的代码进行静态检查、构建打包以及单元测试。之
前面我们创建的两个任务 test 和 build-and-push 都已经完成了,我们还可以创建一个流水线来将这两个任务组织起来,形成一个流水线,这里就是我们要使用的 Pipeline 这个 C
我将数据表与 pipelining 一起使用.我工作得很好,除非我试图输入一个额外的列来保存“编辑”链接。参见 this表。 这是显示列的 server_processing.php 片段: /
Go 新手。我正在尝试编写一个“流水线”,其中多个函数像 worker 一样工作,并在流水线中将一些数据结构传递给彼此,每个函数都对数据结构做一些事情。 type orderStruct struct
我正在尝试弄清楚 DataFlow 如何扩展某些操作以及如何使其表现最佳。首先,我刚刚创建了一个简单的流程,它从 BigQuery 中读取数据(约 2500 万行,总共 30GB),进行 JSON 提
我正在学习 BASH,我的问题如下。 我正在使用 tar -zxvf 解压缩一个文件,这会返回一个(我认为)是一个列表类型 ls -l 从它被提取的文件夹.我想要做的是使用 head -1 获取它的第
我必须在 Java 中实现一个 HTTP 客户端,对于我的需要来说,最有效的方法似乎是实现 HTTP 管道(根据 RFC2616)。 顺便说一句,我想对 POST 进行流水线处理。 (此外,我不是在谈
我每分钟有数千个小文件(大约 1 KB)要上传到 S3。如果我上传循环中的每个文件“发送我的 HTTP 请求 - 等待 S3 的 HTTP 响应 - 发送下一个请求 - 等待下一个响应......”,
假设我有一个来自机器 A 的 MPI_Send,其中包含一条巨大的消息,而在另一台机器(比如 B)上,它正在通过 MPI_Recv(或分别为 MPI_isend 和 MPI_irecv)接收。目前,B
有人可以确认 CacheManager.Net 是否支持 redis 流水线吗? 我在 documentation 中找不到它 非常感谢。 干杯,你 最佳答案 有点。CacheManager 不直接支
我最近一直在编写 x86 程序集(为了好玩),并且想知道 rep 前缀字符串指令是否真的在现代处理器上具有性能优势,或者它们是否只是为了向后兼容而实现的。 我可以理解为什么英特尔最初会在处理器一次只运
我正在学习本教程: https://www.linkedin.com/pulse/building-docker-pipeline-cloudbees-jenkins-jay-johnson 我在 D
我的公司已决定过渡到基于微/服务的架构。 在过去的几个月里,我们一直在做大量的研究,以了解这个东西的架构究竟会是什么样子。 到目前为止,我们已经确定: 用于服务开发的 Dotnet 核心(尽管与语言无
我想尝试使用 Cap'n Proto C++ RPC 进行 promise 流水线操作,但我不知道该怎么做。 这是我的模式: interface Test { getInt @0 () -> (i
我是一名优秀的程序员,十分优秀!