I’m working with a Python script that saves/updates batches of data to a MySQL database and have observed a strange and dramatic difference in performance.
When I run my Python script from GitPod, it takes about 100 seconds to update 1,000 rows in the database.
When I run the same script on a DO droplet in the same datacenter as my database, it takes <1 second to update 1,000 rows in the database.
I don’t think it’s a bandwidth issue, the gitpod has great connection: Download: 1268.49 Mbit/s Upload: 962.83 Mbit/s
The only idea I’ve come up with is that DO is throttling the performance of queries that come from an external network, but the difference in performance seems pretty extreme.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hi there,
I believe that the DigitalOcean’s Managed MySQL Databases, typically do not deliberately throttle performance based on the query source.
There could be several other factors that might contribute to the performance difference you’re observing between running your script from GitPod and a DigitalOcean Droplet.
My guess here would be that this is due to the network latency. Even with high bandwidth, network latency can be a significant factor. The closer your application is to the database server, the lower the latency. Since your Droplet is in the same data center as your database, it benefits from very low latency, which isn’t necessarily the case with GitPod.
You can try performing a
traceroute
from GitPod to your DigitalOcean database to check for any network bottlenecks.Also if possible, consider hosting your application closer to your database to reduce the latency.
Let me know how it goes.
Best,
Bobby