SAP Fiori应用发生超时错误的一个可能原因
Yesterday I spent almost the whole day to resolve a timeout issue in one CRM Fiori application “My Lead”. Finally the root cause makes me not know whether to launch or to cry. I share with you this story, in case you might meet with similar issue, you do not need to spend much time to debug as I did yesterday.
In CRM “My lead” application, end user can insert several products to a lead at the same time.
User can click “+” button to open product value help, then select the products they need to add to the lead.
The issue is, when the testing colleague uses the test user ( we say user A ) to insert the products to the lead, they will meet with time out error below, when the amount of selected products exceeds 15.
Much to my surprise, when I use my own user ( user B ) to test, the issue could not be reproduced, it only took 1 seconds to finish the insertion with 20 products selected. Why?!
My analysis process
(1) I debugged the insertion with test user A. The product insertion to lead is done by CRM function module CRM_ORDER_MAINTAIN. The product insertion within this FM is done via a LOOP internally, which means each product is inserted separately. For totally 20 product insertions, I trace the execution time, it took around 40 seconds to finish, which is definitely not acceptable.
(2) I use transaction code SAT to trace the single product insertion with test user A, it took around 2 seconds. It seems the execution time increases linearly with the number of product to be inserted. Also the 2 seconds for a single product insertion is not acceptable – too slow!!
(3) Unfortunately, through the SAT record, I cannot find a bottleneck of the execution. The complete execution, each stack, is very slow. But when I debug with my own user, each stack is very very fast.
What are possible elements which causes the difference
(1) I had made assumption that the two users are testing on different Lead transaction type. Different transaction type could have different callback registered, so when the lead is saved, different program could be executed. This element is eliminated after my check – both user are working on exactly the same transaction type.
(2) The backend implementation has some code like
CALL FUNCTION 'XXXXX'
EXPORTING
iv_user_name = sy-uname
The reason I made this assumption is since the execution differs based on user, so there must be some handling in code which is based on user name.
I did spend much time to go through the code and the answer is no.
Final answer
I felt frustrated and almost gave up. Suddenly I am thinking about the possibility of user setting difference??
Bingo! The testing user has switched on One order framework event trace via the user parameter CRM_EVENT_TRACE.
This trace functionality is expensive which leads to the overhead of the whole program execution. And since it is done centrally in the one order framework, it is the reason why I didn’t find any hint in my application code.
Lessons learnt
So here is lessons learnt:
Next time if I meet with the similar issue that the performance on the same application with different users varies greatly, besides the two mentioned checkpoints in chapter “What are possible elements which causes the difference“, there is last but not least one: check whether there are different users settings between the two users( for example tcode SU01, or any other customizing in your specific area ).
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- Laravel框架学习 -- php artisan down/up
- Spring中基于注解@AspectJ的AOP实现
- python提高--running-python-code-contained-in-a-strin
- linux shell 监控脚本 及 邮件发送
- Laravel框架学习 -- 安装
- Redis 键管理与小功能
- redis 数据持久化
- 不蒜子 | 给网站、博客文章添加阅读次数统计,我用两行代码 搞定计数
- redis 主从复制
- Spring 当一个接口多个实现时,怎么注入
- redis主从同步,显示master_link_status:down的解决思路
- CentOS自带Python被删 && YUM报错修复
- MySQL主从库--同步异常
- redis 哨兵机制
- C语言共享内存