Yehor 🇺🇦<p><a href="https://techhub.social/tags/TIL" class="mention hashtag" rel="tag">#<span>TIL</span></a><br />Well, not today, but this week.</p><p>Image processing on the server side is hard work for the simplest <a href="https://techhub.social/tags/Hetzner" class="mention hashtag" rel="tag">#<span>Hetzner</span></a> <a href="https://techhub.social/tags/VPS" class="mention hashtag" rel="tag">#<span>VPS</span></a>. I'm generating previews for the uploaded photos and 1 MB photos are already an issue.</p><p>First I made a queue of photos to process one by one, but that didn't help. The right solution was to delegate photo resize to another CPU core using <a href="https://techhub.social/tags/Dart" class="mention hashtag" rel="tag">#<span>Dart</span></a> <a href="https://techhub.social/tags/isolates" class="mention hashtag" rel="tag">#<span>isolates</span></a></p><p>There is a better solution, I suppose you are thinking about - <a href="https://techhub.social/tags/microservices" class="mention hashtag" rel="tag">#<span>microservices</span></a>. A separate service for photos processing. A separate service for, for example, email sending... But I'll leave this for phase 2 of my project. Or phase 3...</p><p><a href="https://techhub.social/tags/development" class="mention hashtag" rel="tag">#<span>development</span></a> <a href="https://techhub.social/tags/softwaredevelopment" class="mention hashtag" rel="tag">#<span>softwaredevelopment</span></a> <a href="https://techhub.social/tags/fullstack" class="mention hashtag" rel="tag">#<span>fullstack</span></a> <a href="https://techhub.social/tags/petprojects" class="mention hashtag" rel="tag">#<span>petprojects</span></a> <a href="https://techhub.social/tags/petproject" class="mention hashtag" rel="tag">#<span>petproject</span></a> <a href="https://techhub.social/tags/Dart" class="mention hashtag" rel="tag">#<span>Dart</span></a> <a href="https://techhub.social/tags/Flutter" class="mention hashtag" rel="tag">#<span>Flutter</span></a></p>