Hello,
When I am implementing the word to pdf conversion. It’s failing for files larger than 4MB. Hosting it in AWS, lambda is getting timed out. I am using the temporary license, to purchase the paid license we need to test with large docx files. Tried increasing the memory, didn’t help.
@ananyach03
It sounds like you’re encountering a timeout issue when trying to convert large Word documents to PDF using AWS Lambda. Here’s a structured approach to resolve this problem:
Cause: The default timeout for AWS Lambda is likely insufficient for processing large Word documents, leading to timeout errors during conversion.
Solution:
- Increase Lambda Timeout: Adjust the timeout setting in your Lambda function configuration to a maximum of 15 minutes to accommodate the processing time for larger files.
- Optimize Document Size: Reduce the size of the Word documents by compressing images, removing unnecessary content, or splitting the document into smaller parts.
- Use S3 for Storage: Store the Word documents in Amazon S3 to process them directly from there, which can enhance performance and scalability.
- Monitor Memory Usage: Allocate sufficient memory to your Lambda function, as increasing memory can improve performance and reduce processing time.
- Test Locally: Conduct local tests with similar large files to determine if the issue is specific to AWS Lambda or if it persists in other environments.
- Consider Alternative Services: If the problem continues, explore other AWS services like AWS Batch or EC2, which are better suited for handling larger workloads.
Next Steps: Implement the suggested changes, starting with increasing the Lambda timeout and optimizing document sizes. Monitor the performance after each adjustment to identify what works best.
If you have any questions or need further assistance, please let me know!
I am storing the input file in Lamda, reducing/ compressing the word file is not possible as it’s for regulatory submissions.
Can you share steps around ec2 implementation please
@ananyach03 Could you please attach the problematic input document here for testing? We will check the issue and provide you more information.