This long, detailed, and entertaining article describes the history and design of --thunder-lock
: http://uwsgi-docs.readthedocs.org/en/latest/articles/SerializingAccept.html
But it doesn't help me decide when I need it!
When is and isn't --thunder-lock
beneficial?
Well... the answer is not that easy. But in general, you should use it when you're using multiple workers with multiple threads. But...
There are dozens of different operating systems and thunder locking is highly dependent on their capabilities. There are at least six different mechanisms of thunder locking, which are choosed by uWSGI based on operating system capabilities, some of them are better than other. If you're using for example Linux with robust pthread support, you're 99.999999% safe to use thunder-lock.
Some performance comparison using very simple and small example is available here
It's interesting that as you scale up the number of processes without the thunderlock for the "hello world" the response time goes up seemingly linearly as a function of the number of processes I have spawned. Presumably something checking whether a process is free is scaling with the number of processes.
The thunder-lock doesn't suffer as badly from that, although there's a slight performance degradation, although possibly from the OS having to manage that many processes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With