Fuck, troubleshooting Python's slow process of writing to MySQL database (heart is broken)

Source: Internet
Author: User

Recently wrote a program, real-time read Rsyslog log, but encountered a problem: MySQL insertion speed delay, very slow, so began to troubleshoot;

1. Analysis procedures, will be considered more time-consuming place for threading analysis, invalid;

2. According to the online, multi-line insertion, commit has no effect;

3. Reload MySQL driver, invalid;

4. Write a simple test statement inserted into the database, found slower, further in MySQL to execute SQL statements found slower, OK is the problem of MySQL;

5. Check the MySQL log size, as well as the directory space, found that there are no problems, excluded;

6. Turn off the myql bin option, and find that the insertion speed is almost half, but still unacceptable, this is not the right approach;

7. Do you finally think that the IO load on the disk is too high? Troubleshooting when found that the disk IO speed is very slow, only 100 trillion, the initial positioning should be the problem;

8. Switch MySQL data directory to SSD, found that the problem is resolved, the original disk IO is too slow to cause the insertion speed too slow.

Of course, the above problem may be the case, if all the methods are discharged, may wish to see whether it is the problem I encountered.

Fuck, troubleshooting Python's slow process of writing to MySQL database (heart is broken)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.