相关疑难解决方法(0)

Apache 基准测试 multipart/form-data

我正面临 ap​​ache 基准测试文件的一个奇怪问题。

我需要强调一个处理文件上传的功能。所以,我用谷歌搜索,找到了一篇描述如何正确构建帖子文件的帖子。其内容如下:

--1234567
Content-Disposition: form-data; name="user_id"

3
--1234567
Content-Disposition: form-data; name="file"; filename="cf_login.png"
Content-Type: image/png

[base64 encoded file content]
--1234567--
Run Code Online (Sandbox Code Playgroud)

ab 线是这样的:

$ ab -c 1 -n 5 -v 4 -T 'multipart/form-data; boundary=1234567' -p post_file.txt http://localhost:3000/files
Run Code Online (Sandbox Code Playgroud)

当 ab 发出请求时,生成的标头如下:

INFO: POST header == 
---
POST /files.json/ HTTP/1.0
Content-length: 229
Content-type: multipart/form-data; boundary=simpleboundary
Host: localhost:3000
User-Agent: ApacheBench/2.3
Accept: */*


---
LOG: header received:
HTTP/1.1 500 Internal Server Error 
Content-Type: text/html; charset=utf-8
Content-Length: 13265
X-Request-Id: 9ad57d19cd71886a1bb817d00fac651b
X-Runtime: 0.015504
Server: WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20) …
Run Code Online (Sandbox Code Playgroud)

performance benchmarking ruby-on-rails apachebench

1
推荐指数
1
解决办法
3865
查看次数