Using an external mysql server the remote uploads become very slow. Using an 1gbps port and a external mysql server with 9ms of latency I got 800KB/seg. Using curl in the command line I got 70MB/seg.
This problem is caused by the method remoteUrlCurlProgressCallback in the uploader.class.php. This function is called several times per second making 1 update query every time.
Setting CURLOPT_BUFFERSIZE to reduce the number of times that remoteUrlCurlProgressCallback is called doesn't work for 2 reasons: The first is that curl documentation states that setting CURLOPT_BUFFERSIZE is treated as a request, not an order. The second is that CURLOPT_BUFFERSIZE must not be > than CURL_MAX_WRITE_SIZE. The default value for CURL_MAX_WRITE_SIZE is 16k and it's static.
The solution is disabling the callback or track time inside the callback function, performing the query only 1 every X seconds.
This problem is caused by the method remoteUrlCurlProgressCallback in the uploader.class.php. This function is called several times per second making 1 update query every time.
Setting CURLOPT_BUFFERSIZE to reduce the number of times that remoteUrlCurlProgressCallback is called doesn't work for 2 reasons: The first is that curl documentation states that setting CURLOPT_BUFFERSIZE is treated as a request, not an order. The second is that CURLOPT_BUFFERSIZE must not be > than CURL_MAX_WRITE_SIZE. The default value for CURL_MAX_WRITE_SIZE is 16k and it's static.
The solution is disabling the callback or track time inside the callback function, performing the query only 1 every X seconds.