This question is a bit complicated. It is recommended that the subject introduce the environment and startup parameters, the number of running processes, and how to run it.
In the absence of these conditions, I would like to talk about this problem based on my own understanding. The original intention of this question is to use gevent to improve performance, but it is found that the performance is reduced. At this time, it is necessary to examine where the performance is reduced. .
The questioner’s criterion for measuring performance degradation is that it takes longer to obtain data. Here I will share my personal opinion. First of all, the questioner does not know how gevent works. The role of gevent is to run multiple coroutines in one thread. It is suitable for multiple IO operations. If it is mixed with a little more CPU operations, it will be difficult to grasp the time. For example, the question asked here requires tens of milliseconds. What if one of your coroutines runs a CPU of one or two hundred milliseconds? operation, then no matter how fast your other coroutine IO is, it will not help.
Also, it needs to be emphasized that introducing gevent will not speed up the speed of obtaining data. For example, it was originally 30ms. After the introduction, it will not become less, but will only become more. So what are the benefits of introducing it? It turns out that you can receive 33 client requests within 1 second. After the introduction, you may be able to receive 100/s or 300/s. This is the benefit of gevent.
I can only give so many suggestions without fully understanding the subject's environment. If the subject does not understand, you can provide further analysis of the previous information.
This question is a bit complicated. It is recommended that the subject introduce the environment and startup parameters, the number of running processes, and how to run it.
In the absence of these conditions, I would like to talk about this problem based on my own understanding. The original intention of this question is to use gevent to improve performance, but it is found that the performance is reduced. At this time, it is necessary to examine where the performance is reduced. .
The questioner’s criterion for measuring performance degradation is that it takes longer to obtain data. Here I will share my personal opinion. First of all, the questioner does not know how gevent works. The role of gevent is to run multiple coroutines in one thread. It is suitable for multiple IO operations. If it is mixed with a little more CPU operations, it will be difficult to grasp the time. For example, the question asked here requires tens of milliseconds. What if one of your coroutines runs a CPU of one or two hundred milliseconds? operation, then no matter how fast your other coroutine IO is, it will not help.
Also, it needs to be emphasized that introducing gevent will not speed up the speed of obtaining data. For example, it was originally 30ms. After the introduction, it will not become less, but will only become more. So what are the benefits of introducing it? It turns out that you can receive 33 client requests within 1 second. After the introduction, you may be able to receive 100/s or 300/s. This is the benefit of gevent.
I can only give so many suggestions without fully understanding the subject's environment. If the subject does not understand, you can provide further analysis of the previous information.