search

Home  >  Q&A  >  body text

mongodb - what does mysql thread mean?

For example, if I open a website, how do I understand its connection thread? What are multi-threading and multi-process? Please help me.

过去多啦不再A梦过去多啦不再A梦2742 days ago735

reply all(1)I'll reply

  • 某草草

    某草草2017-05-17 10:05:51

    Professional explanation http://www.ruanyifeng.com/blo...

    In layman’s terms, threads and processes are all designed to make full use of CPU resources. In order to let the CPU execute the program in a more orderly and efficient manner, the program needs to be divided into blocks. The operating system can schedule the program as a process, and there are as many processes as there are running programs. However, some programs may occupy a large amount of CPU resources. If the process cannot be subdivided and the CPU resources cannot be used more efficiently, the process will be divided into multiple threads. How to divide threads is up to the program itself.

    MySQL is a multi-threaded architecture. A query or a process can be divided into multiple threads for calculation according to its operation attributes. The number of threads is determined by the configuration. Most of us do not need to care about the number of MySQL threads, except for the need to deeply optimize MySQL. An instance of mysql is a process. Generally, there is only one mysql process, but multiple MYSQL instances can also be started at the same time, and then there will be multiple MYSQL processes.

    In practical applications, it is uncommon to use multiple MYSQL instances. If you are worried that the WEB service and MYSQL process competing for resources will affect the efficiency of data processing, you can divide MYSQL into independent servers.

    reply
    0
  • Cancelreply