create_upload often very slow


(Chrisj) #1

I’m working on adding support for importing media from Vanilla Forums. create_upload hangs for 30 - 110 seconds though I’ve also seen it fly through several images in a row with times in the range of 0.005 seconds. The images are stored in /shared/FileUpload/

Before I dive down into the code, is this a known problem or could it be the filesystem?

Update: Using v1.4.0.beta9 +46


(Kane York) #2

I’ve been having uploads hang for a while in the web interface recently… Long enough that I abandoned it and uploaded to an external service.

@zogstrip


(Sam Saffron) #3

Unlikely to be related, much more likely an issue with s3 integration


(Kane York) #4

I was uploading pictures to tdwtf which doesn’t use a cdn or s3.

(vacation pictures, I’ll share when I get back :wink: )


(Chrisj) #5

All of the time is spent here. The pngs that are really slow and the jpgs are really quick.

ImageOptim.new.optimize_image!(file.path) rescue nil

discourse/upload.rb at d456460d33859a3f6890062083ace6f64aa17266 · discourse/discourse · GitHub

I think the setup is 2 Intel Xeon 5160

Edit: Image compression results in artifacts

Looks like it is known to be slow.

I think I will disable compression for import.


(Kane York) #6

@zogstrip? seems like the time-space tradeoff is not set up correctly


(Sam Saffron) #7

Were the slow images you had issues with jpegs or pngs @riking?


(Kane York) #8

Right… looks like I had ~1MB jpegs. Good question.


(Jeff Atwood) #9

Whatever it was use try to test repro.