Extremely slow file upload

I am currently running ghost off of A2 hosting, using NGINX. the site is working fine, and loads fast enough, but when I am adding images to a post, it usually takes 10-20 seconds for the image to upload.

it’s even worse for video. I am currently trying to upload an 11 minute video (1.37GB), which I would expect to take a bit, but it’s been over an hour and the video is barely 10% done.

It’s entirely possible that A2 just has terribly upload speed, and I can live with that if so, but does anyone know of a method I can use to test it, to determine if the hosting is slow, or if there is an issue with my NGINX setup?

EDIT: the video finished uploading after a few tries, but it displayed in a broken state, and then the site crashed, and I can’t get it to start again.

EDIT2: example error from the ghost log:

{"name":"Log","hostname":"server.pearcesjournal.com","pid":421,"level":50,"version":"5.44.0","err":{"id":500,"domain":"https://pearcesjournal.com","code":"ECONNREFUSED","name":"DatabaseError","statusCode":500,"level":"critical","message":"connect ECONNREFUSED","help":"\"Unknown database error\"","stack":"Error: connect ECONNREFUSED\n    at /var/www/pearcemichal/html/versions/5.44.0/node_modules/knex-migrator/lib/database.js:57:19\n    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)","hideStack":false},"msg":"connect ECONNREFUSED","time":"2023-05-29T02:18:11.153Z","v":0}

OK, so you’ve got multiple issues here and I’m going to answer the one about slow uploads.

You can use a speed-test site like Fast.com and check your upload speed in general. That can tell you if your own ISP is throttling the upload.

Second, you could time a different upload method to A2, like scp’ing the file to the host, just to see how long it takes.

Finally, unless you changed some settings, a 1.37 GB video may exceed the maximum allowed upload size for Nginx or Ghost.

Your issue about crashing and the error log may or may not be related. The error logs show that you can’t connect to MySQL (port 3306). You should make sure MySQL is running.

Thanks for the response!

mysql is definitely running. I am able to log in using the username and password in the ghost config, and query tables and such. I also tried creating a new user in mysql, granting it all privileges, and updating the config to use the new user, but it didn’t change anything.

at this point, I am ready to give up on the video thing. I will just post longer than usual videos to youtube or something. I just want to get the site working again T_T

I will add that the only thing I changed before all of this happened was I updated the nginx config to increase the client_max_body_size to 5000M (from 1000M). was that too much?

I was able to fix it. Ultimately, I had to uninstall and reinstall mysql. However, all of the data is still there, which is nice, if a little spooky.