The user davidkingham reports slow or timed-out uploads on their Discourse site, with logs showing a DistributedMutex timeout related to image optimization. Falco clarifies the issue is server-side image processing, not CDN or S3 configuration. davidkingham confirms the problem persists even after updates and disabling enable_s3_uploads, suggesting the issue is tied to Digital Ocean Spaces. pfaffman and Don point to known reliability issues with Digital Ocean’s SFO2 and AMS3 data centers, recommending Amazon S3 or switching to New York. davidkingham confirms the issue is resolved after switching to New York, and asks how to remap existing images—suggesting a rebake may be sufficient.
In the past couple of weeks, we have started noticing extremely slow upload times on our site for attachements, and sometimes the upload even times out (see related logs below). My setup is digital ocean space for s3, and bunny.net for CDN. I also turned on the new composer media optimization image enabled, but I think it was happening before this. It’s a bit hit and miss trying to repro this problem. Any ideas?
Timeout log
DistributedMutex("optimized_image_32792_50_33"): held for too long, expected max: 60 secs, took an extra 66 secs
Message (122 copies reported)
DistributedMutex("optimized_image_32792_50_33"): held for too long, expected max: 60 secs, took an extra 66 secs
Backtrace
/var/www/discourse/lib/distributed_mutex.rb:54:in `warn'
/var/www/discourse/lib/distributed_mutex.rb:37:in `block in synchronize'
/var/www/discourse/lib/distributed_mutex.rb:29:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:29:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:14:in `synchronize'
/var/www/discourse/app/models/optimized_image.rb:18:in `lock'
/var/www/discourse/app/models/optimized_image.rb:68:in `create_for'
/var/www/discourse/app/models/topic_thumbnail.rb:21:in `find_or_create_for!'
/var/www/discourse/app/models/topic.rb:104:in `block in generate_thumbnails!'
/var/www/discourse/app/models/topic.rb:103:in `each'
Still having major issues with this, tried updating to latest and using safe mode which did not help. I tried turning off enable s3 uploads and the problem does go away. Any ideas?
Digital ocean had a huge issue with S3 in Amsterdam a while back (which I started using because a friend who worked there said it was their best data center, but things change and now he works for Google).
So another S3 service was going to be my suggestion too.
https://status.digitalocean.com/ shows issues with spaces in sfo2 for the past several days. It says “resolved” but I’m not recommending spaces anymore…
Yes, that is right. This is why I moved to Frankfurt. Since then works fine without any problem. AMS3 and SFO2 has a lots of issue, maintance and availability problem always.
Thanks guys, the DO space in San Fransico does seem to be the issue, I switched over to New York for now and may consider going back to Amazon if I have any more trouble. How do I go about remapping existing images over to the new space? Do I just do a rebake? I have copied all the files over to the new space.