英文:
Dynamics AX 2012 Formdatasource::executeQuery calls a lot more methods on specific remote servers
问题
所有AX客户端都通过RDS访问。
我们几周前收到了一张关于某个应用程序性能不佳的工单。我们进行了调查,但无法重现问题。经过一些测试,似乎问题只发生在两台特定的远程桌面上,而不是其他远程桌面上。
然后,我们开始在两台服务器上使用跟踪工具跟踪应用程序,我注意到在慢服务器上,executeQuery调用了更多与快速服务器相同的方法,特别是SysQueryRun::next和QueryBuildDataSource::findRange。
因此,我决定设置一个非常简单的测试表单,具有与存在问题的应用程序相同的基本逻辑,这似乎是可以重现的,尽管调用比实际应用程序要少得多。
表单上使用的逻辑非常简单。在标题-formdatasource的活动中,我们调用详细-formdatasource的executeQuery并将筛选器应用于详细表。
在快速服务器上:
在慢速服务器上:
发生这种情况的原因是什么?这肯定会产生影响。
我尝试了以下几件事:
-
大量搜索,但没有相关的搜索结果,但可能是搜索关键词非常通用
-
重新启动AOS,远程桌面服务器
-
CIL编译
-
重新创建表单以隔离问题,但问题仍然存在
英文:
All the AX clients are accessed through RDS.
We received a ticket a few weeks ago that a certain application had bad performance. We were looking in to it but could not reproduce the problem. After some testing around, it seemed that the problem only occurs on 2 specific remote desktops, and not on the others.
Then we started tracing the application on both servers with the Tracing cockpit and I noticed that on the slow-server, the executeQuery calls a lot more of the same methods as the fast-server, in particular, SysQueryRun::next and QueryBuildDataSource::findRange
So I decided to setup a very simple testform with the same basic logic as the application with issues, and this seems reproducible, albeit a lot less calls than the actual application.
The logic used on the form is very simple. In the active of the header-formdatasource, we call the detail-formdatasource executeQuery and apply the filters to the detail-table.
On the fast-server:
On the slow-server:
What could be the reason this happens? It certainly has an impact.
I tried the following things:
-
Googled a lot but no relevant search results, but could be the case that the search keywords are very generic
-
Restart AOS, remote desktop servers
-
CIL-compile
-
Recreated the form to isolate the issue and it does remain
答案1
得分: 0
我曾经看到类似的问题发生在AUC/KTI缓存文件损坏时。它们可以安全地删除,并在每次打开新客户端时重新生成。
我编写了一个小的PowerShell脚本,您可以在受影响的服务器上运行它,它将帮助您删除这些文件。它还将执行一个“模拟”删除,以便您可以在删除之前查看将被删除的文件。
您需要确保用户未登录到服务器上的AX,否则某些文件的删除将失败,因为它们将被锁定。如果发生这种情况,不用担心...只需将用户从AX中退出并重新运行脚本,直到一切都正确删除为止。
Write-Host "对于服务器 $($env:COMPUTERNAME),此脚本将删除AX用户应用程序特定的缓存文件。这与'Usage Data'不同,不会受到影响。" -ForegroundColor Green
Write-Host "具体来说,它会从每个用户的%LOCALAPPDATA%目录中删除*.AUC/*.KTI文件,以及位于'%LOCALAPPDATA%\Microsoft\Dynamics Ax'中的文件。" -ForegroundColor Green
Write-Host "它还会将记录保存到桌面。" -ForegroundColor Green
while(-not (($choice= (Read-Host "您是否要继续?(不会删除,仅模拟删除)[Y/N]") -match "^[YNyn]{1}$"))){ "Y or N ?"}
$DoDelete = ($true, $false)[!($choice -eq 'Y')]
Start-Transcript -Path (Join-Path ([Environment]::GetFolderPath("Desktop")) "UserCacheDelTranscript.log") -Append
if (!$DoDelete)
{
Write-Host "模拟删除中..."
}
Get-ChildItem -Path "C:\Users" -Directory | ForEach-Object {
$DelPath = "$($_.FullName)\AppData\Local\*"
if (Test-Path $DelPath) {
# 删除*.auc/*.kti文件
Get-ChildItem -Include *.auc, *.kti -Path $DelPath | ForEach-Object {
Write-Output ("正在删除 '{0}'" -f $_.FullName)
if ($DoDelete) {
Remove-Item $_
}
}
}
# 删除其他杂项缓存文件
$DelPath = "$($_.FullName)\AppData\Local\Microsoft\Dynamics Ax"
if (Test-Path $DelPath) {
Get-ChildItem -Path $DelPath | % {
Write-Output ("正在删除 '{0}'" -f $_.FullName)
if ($DoDelete) {
Remove-Item -Path $_.FullName -Recurse -Confirm:$false
}
}
}
}
Stop-Transcript
这是您要的翻译结果。
英文:
I've seen similar issues happen when the AUC/KTI cache files get corrupted. They're safe to delete and get rebuilt every time a new client is opened.
I wrote a little PowerShell script that you can run on the affected server(s) and it will delete the files for you. It also will do a "simulate" delete so you can see what will be deleted if you want beforehand.
You need to make sure the users are not logged into AX on the server or the delete will fail on some files because they'll be locked. If that happens, it's no big deal...just kick the user(s) out of AX and rerun the script until everything is deleted correctly.
Write-Host "For the server $($env:COMPUTERNAME), this script will delete AX user application specific cache files. This is different than 'Usage Data' which will not be affected." -ForegroundColor Green
Write-Host "Specifically it removes *.AUC/*.KTI files from each user's %LOCALAPPDATA% directory and the files located in '%LOCALAPPDATA%\Microsoft\Dynamics Ax' for each user." -ForegroundColor Green
Write-Host "It will also save a transcript to the desktop." -ForegroundColor Green
while(-not (($choice= (Read-Host "Do you want to continue? (No will simulate, but not delete) [Y/N]")) -match "^[YNyn]{1}$")){ "Y or N ?"}
$DoDelete = ($true, $false)[!($choice -eq 'Y')]
Start-Transcript -Path (Join-Path ([Environment]::GetFolderPath("Desktop")) "UserCacheDelTranscript.log") -Append
if (!$DoDelete)
{
Write-Host "Simulating delete..."
}
Get-ChildItem -Path "C:\Users" -Directory | ForEach-Object {
$DelPath = "$($_.FullName)\AppData\Local\*"
if (Test-Path $DelPath) {
# Remove *.auc/*.kti files
Get-ChildItem -Include *.auc, *.kti -Path $DelPath | ForEach-Object {
Write-Output ("Deleting '{0}'" -f $_.FullName)
if ($DoDelete) {
Remove-Item $_
}
}
}
# Remove other misc cache files
$DelPath = "$($_.FullName)\AppData\Local\Microsoft\Dynamics Ax"
if (Test-Path $DelPath) {
Get-ChildItem -Path $DelPath | % {
Write-Output ("Deleting '{0}'" -f $_.FullName)
if ($DoDelete) {
Remove-Item -Path $_.FullName -Recurse -Confirm:$false
}
}
}
}
Stop-Transcript
答案2
得分: 0
检查所有服务器和客户端的内核版本是否相同,方法是转到 帮助>关于
。
或者,您可以检查用户日志(\菜单\系统管理\查询\用户\用户日志),在常规选项卡上显示登录的不同构建号。通常,我会个性化该表单并将其移动到网格上。这样我就可以轻松上下滚动,查找客户端不匹配的情况。
英文:
Check that all servers and clients have the same Kernel builds by going to Help>About
.
Alternatively, you can check the user log (\Menus\SystemAdministration\Inquiries\Users\User log), and on the general tab it shows the different build #'s for the logins. I typically personalize that form and move it to the grid. That way I can just scroll up/down and look for client mismatches.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论