콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
349 화면

I am facing performance issues when trying to print custom accounting reports to Excel. These reports cover a significant amount of data, typically spanning 6 months. Despite having the server running on 2 workers in Odoo.sh, the server occasionally crashes during this process.

I am unsure if I should focus on optimizing the code to handle the export process more efficiently or if there is a better approach for viewing and handling these accounting reports.

Could anyone share insights or best practices on how to handle large datasets in accounting reports? Should I look into code optimizations, or are there alternative methods for efficiently accessing and exporting these reports?

Thank you for your advice!

아바타
취소
베스트 답변

Hi,


Your server crashes because generating large Excel reports synchronously overloads worker memory and CPU. To fix this, focus on two solutions:


1- Optimize the Code: Replace slow ORM calls with efficient raw SQL queries in the report's data-fetching method. This lets the database handle the heavy lifting.


2- Change the Process: Implement asynchronous reporting. Use the queue_job module to generate reports in the background. Users get a notification with a download link when the file is ready, preventing server timeouts and crashes.


For immediate relief, encourage users to filter data and view reports as PDFs before exporting to Excel. The long-term, most effective solution is to adopt asynchronous processing.


Hope it helps

아바타
취소
작성자

Thank you for answering queue_job might be the answer I am looking for

관련 게시물 답글 화면 활동
1
9월 25
839
Server Slowness 해결 완료
2
5월 25
1125
0
9월 25
230
1
9월 25
950
3
9월 25
272