It takes too long for Android to upload pictures and wait for return. What's the problem?

I am doing a weak network environment test. I connect my Android phone to a wireless network that limits the upload speed. I upload pictures (the speed is limited to 10kb, about 450kb). I find that every time the picture is sent out, it is very fast, but it is very slow to wait for the background to return. (the background will return an image and id), will often time out

.

the background only does one operation, which is to save the picture and return the saved id to me

I would like to ask whether this problem should be solved by Android or backstage?

Dec.02,2021

what you should do is compare the time sent under the phone endpoint, and the time when the backend service received the first uploaded data. The interval between these two times is the network transmission time of the upload. An easier way is to test the background interface directly, rather than through the mobile phone. Several aspects that may have problems, service side, mobile phone application, are tested separately, and then analyzed comprehensively.


the speed limit is 10 kilobytes. After the picture is about 450kb,
calculate. It takes 45 seconds to send the picture

.

are you sure sends out pictures quickly every time is really fast?

if the backend returns ID in 45 minutes and 46 seconds, there is nothing wrong with it. It takes so long to collect the data.

I guess:
the picture is sent all at once on
Android.
because of the limited network speed, the bottom layer of the system is sending it slowly. It takes 45 seconds to finish sending
UI. You feel (it's actually an illusion) that you finished sending it all at once
.

you can see that you are in Android.
I think there are two possible things. Guess 1, you haven't finished uploading, and guess 2. After obtaining it at the backend, it is slow to store data in the database or other places eating io, resulting in slow id generation. Because once a json is generated, it is not very big, and the transmission is very fast.
there is a better solution to this:
use Qiniu or other stored clouds. Upload the id directly from the Android and return the uploaded id to the backend. The advantage is that your image will load faster with cdn, and there is no need for you to manage the image. You just need to know the address of the picture

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36d66-2c04e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36d66-2c04e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?