| 本文已被:浏览 2374次 下载 4307次 |
 码上扫一扫! |
|
|
| 基于动态和静态分析的单体应用FaaS改造方法 |
|
向麒麟1,2, 彭鑫1,2, 赤坂居纱美1,2, 李博文1,2
|
|
1.复旦大学 计算机科学技术学院, 上海 201203;2.上海市数据科学重点实验室(复旦大学), 上海 201203
|
|
| 摘要: |
| 作为Serverless架构的一种典型形态,函数即服务(function as a service,FaaS)架构将业务抽象为细粒度的函数,并且提供弹性的自动伸缩等自动化运维功能,能够大幅降低运维成本.当前,许多在线服务系统中的一些高并发、高可用、灵活多变的业务(如支付、红包等)都已经迁移到了FaaS平台上,但是大量传统单体应用还是难以利用FaaS架构的优势.针对这一问题,提出了一种基于动态和静态分析的单体应用FaaS改造方法.该方法针对指定的单体应用API,通过动态分析和静态分析相结合的方式识别并剥离其实现代码和依赖,然后按照函数模板完成代码重构.针对函数在高并发场景下的冷启动问题,该方法利用基于IO多路复用的主从多线程Reactor模型优化了函数模板,提高了单个函数实例的并发处理能力.基于该方法实现了针对Java语言的原型工具Codext,在开源Serverless平台OpenFaaS上,面向4个开源单体系统进行了实验验证. |
| 关键词: 单体应用 无服务器架构 函数即服务(FaaS) 轨迹分析 动态分析 静态分析 冷启动 |
| DOI:10.13328/j.cnki.jos.006377 |
| 分类号:TP311 |
| 基金项目:国家重点研发计划(2018YFB1004803) |
|
| FaaS Migration Approach for Monolithic Applications Based on Dynamic and Static Analysis |
|
XIANG Qi-Lin1,2, PENG Xin1,2, AKASAKA Isami1,2, LI Bo-Wen1,2
|
|
1.School of Computer Science, Fudan University, Shanghai 201203, China;2.Shanghai Key Laboratory of Data Science (Fudan University), Shanghai 201203, China
|
| Abstract: |
| As a typical form of the Serverless architecture, the function as a service (FaaS) architecture abstracts the business into fine-grained functions, and provides automatic operation and maintenance functionality such as auto-scaling, which can greatly reduce the operation and maintenance costs. Some of the high concurrent, high available, and high flexible services (such as payment, red packet, etc.) in many online service systems have been migrated to the FaaS platform, but a large number of traditional monolithic applications still find it difficult to take advantage of the FaaS architecture. In order to solve this problem, a FaaS migration approach for monolithic applications based on dynamic and static analysis is proposed in this study. This approach identifies and strips the implementation code and dependencies for the specified monolithic application API by combining dynamic and static analysis, and then completes the code refactoring according to the function template. Aiming at the cold-start problem of functions in high concurrency scenario, this approach uses the master-slave multithreaded Reactor model based on IO multiplexing to optimize the function template and improve the concurrency processing capability of a single function instance. Based on this approach, Codext, a prototype tool for Java language, is implemented and experimental verification is carried out on OpenFaaS, an open source Serverless platform, for four open source monolithic applications. |
| Key words: monolithic application Serverless function as a service (FaaS) trace analysis dynamic analysis static analysis cold start |