locustio / locust

Write scalable load tests in plain Python 🚗💨
https://locust.cloud
MIT License
25.06k stars 3k forks source link

Using Python's multiprocessing on Master #812

Closed ovanes closed 6 years ago

ovanes commented 6 years ago

Description of issue / feature request

I wonder if there any cautions to be taken if I plan to use Python's multiprocessing (e.g. https://docs.python.org/2/library/multiprocessing.html#using-a-pool-of-workers) library on locust master to process custom data. I am just afraid if underlying process forking might break smth. in locust Master. There were evaluations for that with slaves here: #12

Expected behavior

From the Locust's custom data event an item shall be placed in https://docs.python.org/2/library/multiprocessing.html#multiprocessing.JoinableQueue and using another Greelet mapped to a multiprocessing.Pool of workers.

Actual behavior

Currently the data slaves send fully utilizes a single thread used for greenlets and master lags pretty much behind.

Environment settings (for bug reports)

cgoldberg commented 6 years ago

I wonder if there any cautions to be taken if I plan to use Python's multiprocessing

why don't you try it?

ovanes commented 6 years ago

why don't you try it?

Why spending time if someone did it already? Just wanted to rely on experience of others.