In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Today's test activity related page, encountered a problem:
400 VUs, set to run by thread, multiple error reports, set to run by process, all run successfully, no error reports. So curious about the difference between the two, now roughly understand ~~~
What is the difference between a process and a thread?
In short, a program has at least one process, and a process has at least one thread. The thread partition scale is smaller than the process, which makes the concurrency of multithreaded programs high. In addition, processes have independent memory units during execution, and multiple threads share memory, thus greatly improving the efficiency of the program.
Threads are distinct from processes during execution. Each independent thread has an entry for program execution, sequential execution sequence, and exit for program execution. However, threads cannot execute independently and must be dependent on applications, which provide multiple thread execution control.
From a logical point of view, multithreading means that multiple execution parts of an application can be executed simultaneously. But the operating system does not treat multiple threads as separate applications for scheduling and managing processes and allocating resources. This is an important distinction between processes and threads.
Advantages and disadvantages of process mode and thread mode:
Choosing to run as a process will start one mmdrv process per user, and multiple mmdrv processes will consume a lot of memory and other system resources, which limits the number of concurrent users that can run on any load generator because the load machine's resources (memory and other system resources) are limited.
By default, the controller starts only one mmdrv process for every 50 users, and each user runs as a thread. These threaded users will share the memory segment of the parent process, which saves a lot of memory space and allows more users to run on a load generator.
Although selecting thread mode can reduce the number of mmdrv processes started and reduce the memory occupation, it is also easy to have a problem. For example, in the same test scenario, timeout failure or error will occur when using thread concurrency, while it is correct to use process concurrency. Why is that? Because thread resources are allocated from process resources, multiple threads in the same process will have shared memory space. Suppose thread a has to wait for thread b to release resources, and thread b is waiting for other resources to be released before continuing.
So if an error occurs during concurrency, try modifying the way concurrent users run.
Of course, the error may also be affected by other factors, but you can also try to gradually investigate the problem according to the cause of the error.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.