Weird RDS issues and springboot's devtools

one,,,

It is said that today the customer encountered the problem of very slow statistical data query. The situation is rather strange, and it happened suddenly after a certain program upgrade.

In view of the previous performance of rds (mysql5.6), I thought it might be because the user's single table data was close to 10 million, which caused query problems and bottlenecks, resulting in iops running full all the time. However, after all the data is synchronized to the local mysql5.7, it is found that the local speed is very fast. . .

I had to start looking at aliyun's slow log, and found that some queries took nearly 20 minutes! Picking out these queries to explain, sadly found that the local and server query plans are completely different... The server does not use the index at all, although the index exists.

Then began a long analysis process, why why why... Later, I contacted a friend of the oracle master for consultation, and then I realized that this kind of shit is normal... In the end, I had an idea and deleted the server's The index is then rebuilt, and it is found that the query plan can finally use the index. It seems that the index has failed inexplicably!

This incident made me feel very unreliable about the rds mechanism. In addition, even if the index can be used, the index used by the server and the local is not the same. The joint index of rds mysql 5.6 will fall on another strange index.

Next, buy rds and try to buy 5.7. I think it should be caused by the unreliability of mysql5.6; in addition, the amount of data may need to be considered for partitioning.

two,,,

The development team had been working with jrebel in the idea when they used springboot before. As a result, after a new batch of developers came in, the jrebel installation was messy, which led to the need to restart the project to do anything, which really crashed.

So I investigated and found that the springboot-devtools dependency is the solution to this problem, which is really surprising, because I knew spring loaded a few years ago, which was also the basis for the automatic compilation and loading of grails 2.x at that time. It was not very useful. Now springboot has made a small plugin by itself, which doesn't seem to be troublesome.

The specific configuration is also relatively simple:

1. Add dependencies (maven or gradle)

2. Add code

System.setProperty("spring.devtools.restart.enabled", "false");

Otherwise, recompiling will cause the project to restart automatically

3.src/main/resources/config/application-dev.yml,spring.devtools.livereload.enabled: true

This configuration is more critical, it will be automatically loaded after compilation, and it is very easy to use.

In addition, if jrebel is started, devtools will be automatically disabled and jrebel is used; in addition, devtools does not seem to have the ability to automatically reload mybatis, and jrebel is the best for this requirement.

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326402000&siteId=291194637