[PR #11] [MERGED] Fix OOM issues for PDF generation and increase Kubernetes resource limits #43
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
webgrip/invoiceninja-application#43
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/webgrip/invoiceninja-application/pull/11
Author: @Copilot
Created: 9/6/2025
Status: ✅ Merged
Merged: 9/6/2025
Merged by: @Ryangr0
Base:
main← Head:copilot/fix-10📝 Commits (5)
3235a69Initial plan5263669Fix OOM issues for PDF generation and add resource limits3552555Add comprehensive documentation for PDF memory fixc173fb7Set opcache.enable_cli=0 and remove test script per review feedback2e237a8Merge branch 'main' into copilot/fix-10📊 Changes
5 files changed (+104 additions, -5 deletions)
View changed files
➕
docs/pdf-memory-fix.md(+66 -0)📝
ops/docker/application/Dockerfile(+3 -0)➕
ops/docker/application/php.ini(+30 -0)📝
ops/docker/nginx/config/default.conf(+3 -3)📝
ops/helm/invoiceninja-application/values.yaml(+2 -2)📄 Description
This PR resolves Out of Memory (OOM) issues that were occurring during PDF generation in the Invoice Ninja application running on Kubernetes.
Problem
The application was experiencing pod crashes when generating PDFs due to insufficient memory allocation. The base Invoice Ninja image had a PHP memory limit of only 128M, while the Kubernetes container was limited to 512Mi, both inadequate for complex PDF generation operations.
Root Cause Analysis
memory_limit = 128MSolution
PHP Configuration Optimizations (
ops/docker/application/php.ini)memory_limitfrom 128M to 512M for PDF processingupload_max_filesizeandpost_max_sizemax_execution_timeto 300 seconds for complex operationsopcache.enable_cli = 0per review feedbackKubernetes Resource Adjustments (
values.yaml)Nginx Configuration Updates
client_max_body_sizefrom 20M to 50Mfastcgi_read_timeoutfrom 300s to 600sTesting
Created comprehensive integration tests that verify:- PHP memory configuration properly applied (512M)- Upload limits correctly set (50M)- Memory allocation functionality (100MB test allocation)- Configuration load order and precedenceUpdated: Removed test bash script per review feedback
Expected Impact
Fixes #10.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.