We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
代码本来使用了ServiceComb版本2.8.6,切换为SpringMVC 版本5.3.31后,发现有一个上传文件的接口效率下降了
业务代码如下
@ResponseBody @PostMapping(value = "/uploadFile", produces = MediaType.MULTIPART_FORM_DATA) public Response upload1File(@NotNull MultipartFile file, HttpServletRequest request) { try (InputStream inputStream = file.getInputStream();) { // 具体业务 } }
分析了火焰图,发现使用了MVC框架后,主要在这部分消耗比较多时间
[40]48.31% 9,101 self: 0.02% 3 orglapache/tomcat/util/http/fileupload/MultipartStreamSItemInputStream.makeAvailable .. [41]30.95% 5,830 self 0.02% 3 org/apache/tomcat/util/http/fileupload/MultipartStreamSItemInputStream.findSeparator [42]30.93% 5,827 self: 30.93% 5,827 org/apache/tomcat/util/http/fileupload/MultipartStream.findSeparator
serviceComb 处理表单的方法 io.netty.handler.codec.http.multipart.HttpPostMultipartRequestDecoder#findMultipartDelimiter
想问下ServiceComb在对于MultipartFile文件接口有没有做什么优化,还是说可能只是底层一个是tomcat,一个是netty的原因
The text was updated successfully, but these errors were encountered:
java chassis的上传下载支持 REST over servlet 和 Rest over vert.x两种模式。 不同的模式相对于spring boot,都是完全重新实现的,不依赖于Spring MVC的实现。 参考: Java Chassis与Spring Boot 集成介绍
REST over servlet
Rest over vert.x
Sorry, something went wrong.
No branches or pull requests
代码本来使用了ServiceComb版本2.8.6,切换为SpringMVC 版本5.3.31后,发现有一个上传文件的接口效率下降了
业务代码如下
分析了火焰图,发现使用了MVC框架后,主要在这部分消耗比较多时间
[40]48.31% 9,101 self: 0.02% 3 orglapache/tomcat/util/http/fileupload/MultipartStreamSItemInputStream.makeAvailable
.. [41]30.95% 5,830 self 0.02% 3 org/apache/tomcat/util/http/fileupload/MultipartStreamSItemInputStream.findSeparator
[42]30.93% 5,827 self: 30.93% 5,827 org/apache/tomcat/util/http/fileupload/MultipartStream.findSeparator
serviceComb 处理表单的方法
io.netty.handler.codec.http.multipart.HttpPostMultipartRequestDecoder#findMultipartDelimiter
想问下ServiceComb在对于MultipartFile文件接口有没有做什么优化,还是说可能只是底层一个是tomcat,一个是netty的原因
The text was updated successfully, but these errors were encountered: