MySQL packet submission and realtime Fsync

Source: Internet
Author: User
Tags commit

Group Commit and Real Fsync

Packet submission and Realtime Fsync

During The recent months I ' ve seen few cases of customers upgrading to MySQL 5.0 and have serious performance slow downs , up to the times in certain cases. What was the most surprising for them are the problem was hardware and even OS specific-it could Ion But. Even interesting performance may dramatically affected by–log-bin settings, which usually has just couple of perc ENT overhead. So what are going on?

In recent months, I've come across a handful of cases: Some customers are upgrading to MySQL 5.0, resulting in a severe drop in performance and, in some cases, even 10 times times below. What surprises them most, however, is that the problems are caused by hardware and even the operating system-problems with some version of the operating system but not in other versions. More interestingly, MySQL's performance is dramatically affected by the Log-bin settings-which typically only have a 2% impact on system capability. So, what's going on?

Actually we ' re looking at two issues here which interleave such funny way

Let's find out where the 2 interesting questions intersect:

Group commit is broken in MySQL 5.0 if binary loging are enabled (as it enables XA) in MySQL 5.0 if binary log (binary log) is enabled (XA also), the packet commit interrupts the Certain os/hardware configurations still fake Fsync delivering great performance at the cost of being non a CID some operating system/hardware configurations still only implement pseudo Fsync, because it is not acid, resulting in a lot of performance loss

The can is tracked by this bug. In the nutshell the problem Is-new Feature-xa is implemented in MySQL 5.0 which the don't did with work group commit Code. The new code for group commit however is never implemented. XA allows to keep different transactonal storage into sync, engines with together log. The XA are enabled if binary log is enabled to why this issue is trigered by enabled binary log. If binary log is disabled, then is XA and old group commit code works just fine.

The first question can see the bug. In a nutshell, this is a new feature-a new addition to the XA feature in MySQL 5.0, which does not support old packet-submission code. However, the new packet submission code has not been implemented at all. XA support keeps different transactional storage engines synchronized and is stored in binary logs. If binary logging is enabled, XA is also enabled, which is why it triggers this problem after the binary date is enabled. If you disable binary logging, both XA and the old packet submission code will be fine.

The

Second one is interesting. Actually we would hear much more people screaming about this problem if OS would to honest with us. Happily for us many os/hardware pairs are still lying about Fsync (). Fsync () Call suppose to place data on the disk securely, which unless your have battery backed up cache would give 80-200 sequential Fsync () calls/second depending on your hard drive. With fake Fsync () call the ' data is ' only ' written to ' drives memory and so can being lost if power goes down. However It gives great performance improvement and you might to the 1000+ of Fsync () calls per second. So if your OS isn't giving you real fsync your might not notice this bug. The performance degradation would still happen but it is much smaller, especially with large transactions.

The second question is very interesting. In fact, if the operating system is more honest, we will hear more users complaining. Fortunately, for us, many operating system/hardware combinations are based on Fsync (). Fsync () invocation If the data is securely placed on disk, only 80-200 consecutive fsync () calls per second can be achieved unless the standby battery cache is dependent on the drive speed of the disk. The pseudo Fsync () only writes the data in disk memory, and once the power is off, the data is lost. However, this can achieve high performance, about 1000 times per second Fsync () call. Therefore, if your operating system does not support real-time fsync () calls, you should pay attention to this bug. Performance will be reduced, but this will be less and fewer, especially in the course of a large transaction.

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.