# Image Processing Takes Long Time

**URL:** <https://forum.mattermost.com/t/image-processing-takes-long-time/22971>\
**Category:** Troubleshooting\
**Created:** [April 1, 2025, 5:28pm UTC](https://forum.mattermost.com/t/image-processing-takes-long-time/22971 "2025-04-01T17:28:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DeathCamel58](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/deathcamel58/32/8775_2.png) [@DeathCamel58](https://forum.mattermost.com/u/DeathCamel58)\
**Post date:** [April 1, 2025, 5:28pm UTC](https://forum.mattermost.com/t/image-processing-takes-long-time/22971/1 "2025-04-01T17:28:46Z")

</div>

**Summary**  
Uploading images on an Amazon EC2 `t3.small` (2 vCPUs, 2.0 GB RAM) is only about 1/2 of the speed of Slack at uploading images due to the processing. Is there a way to optimize this, or is there a way to change the image processing options?

**Steps to reproduce**  
Spin up an Amazon EC2 `t3.small` instance, and use the omnibus installation method to install `10.6.1`. Attempt to upload an image, and pay attention to the time.

**Expected behavior**  
Mattermost should be faster at processing images.

**Observed behavior**  
The image upload takes way longer than expected. Here’s some timing data that I’ve collected

Image Attachments (single post with 4 images):

- CFAB8D85-FFB1-4093-897D-8431D45F258B.jpg
- D4658D7A-97AE-46A7-A72D-A185AB4387B4.jpg
- 717E268F-ABBA-49F5-9F29-55150E0D5E6C.jpg
- 26BF1E2F-806F-4377-9445-8E114B69F388.jpg

Mattermost

- 62s
- 56s
- 56s
- 63s
- 63s

Slack

- 46s
- 51s
- 41s
- 52s
- 42s

Image Attachment (single post with one image):

- PXL\_20250326\_142113995.jpg

Mattermost

- 11s
- 12s
- 12s
- 11s
- 12s

Slack

- 7s
- 6s
- 6s
- 5s
- 6s

All test images are attached.

 ![26BF1E2F-806F-4377-9445-8E114B69F388](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/6/68aa9feb05ad310162813f43740776234e200f32.jpeg)  
 ![717E268F-ABBA-49F5-9F29-55150E0D5E6C](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/e/e528f0e8355e3afa61086d279f10b9984103e18e.jpeg)  
 ![CFAB8D85-FFB1-4093-897D-8431D45F258B](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/4/450891ee1d08ae5d8920747eadd34fc67e0175f6.jpeg)  
 ![D4658D7A-97AE-46A7-A72D-A185AB4387B4](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/b/b05825f7d3c9b41f14ae3ee48f81f222f6caa73d.jpeg)

---

<div class="post-metadata">

**Author:** ![john.combs](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/john.combs/32/7118_2.png) [@john.combs](https://forum.mattermost.com/u/john.combs)\
**Post date:** [April 1, 2025, 8:36pm UTC](https://forum.mattermost.com/t/image-processing-takes-long-time/22971/2 "2025-04-01T20:36:09Z")

</div>

Hi Dylan! Thanks for bringing this up. Optimizing image processing is a great idea. You might find it helpful to check out this guide on [configuration settings](https://docs.mattermost.com/configure/configuration-settings.htm), as it highlights key configurations that could improve speed. Let us know how it goes!

---

<div class="post-metadata">

**Author:** ![DeathCamel58](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/deathcamel58/32/8775_2.png) [@DeathCamel58](https://forum.mattermost.com/u/DeathCamel58)\
**Post date:** [April 1, 2025, 10:50pm UTC](https://forum.mattermost.com/t/image-processing-takes-long-time/22971/3 "2025-04-01T22:50:20Z")

</div>

Hey John,  
Do you have any particular configuration setting in mind, or are you just telling me to review the configuration settings in general? I’m not seeing any settings related to image processing in general.  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![john.oliver](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/john.oliver/32/6436_2.png) [@john.oliver](https://forum.mattermost.com/u/john.oliver)\
**Post date:** [April 2, 2025, 2:56pm UTC](https://forum.mattermost.com/t/image-processing-takes-long-time/22971/4 "2025-04-02T14:56:35Z")

</div>

So, this probably isn’t a fair comparison, as Slack is undoubtably a containerized platform that can spin up containers and schedule them to run on much beefier nodes than a t3.small! Have you watched `htop` or something similar on that node while performing that operation? I suspect you may see that RAM exhausted.

Also, we don’t recommend the Omnibus install for production use since it presents a huge single point of failure… you’re running your Postgres database on the same 2GB node as your Mattermost server. I bet if you repeated your test with 4GB, or better 8GB, you’d probably see better results.

---

<div class="post-metadata">

**Author:** ![DeathCamel58](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/deathcamel58/32/8775_2.png) [@DeathCamel58](https://forum.mattermost.com/u/DeathCamel58)\
**Post date:** [April 2, 2025, 3:31pm UTC](https://forum.mattermost.com/t/image-processing-takes-long-time/22971/5 "2025-04-02T15:31:42Z")

</div>

That explanation makes sense! Monitoring htop shows that it’s CPU bound during the processing step. Is there a way for us to allow tuning the image processing step? Maybe by changing the encoding options and such?

---

<div class="post-metadata">

**Author:** ![john.oliver](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/john.oliver/32/6436_2.png) [@john.oliver](https://forum.mattermost.com/u/john.oliver)\
**Post date:** [April 2, 2025, 6:00pm UTC](https://forum.mattermost.com/t/image-processing-takes-long-time/22971/6 "2025-04-02T18:00:11Z")

</div>

I’ve asked, but I really doubt it… you’re probably going to need a bigger instance, or divorce your Postgres onto its own instance. And even then, the t3.small may still not be optimal.
