You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let us start from a practical example. Imagine we are writing
a traffic monitoring application. The purpose of application would be
to calculate a number of bytes sent by each IP address. To do that,
let create a structure that does that accounting:
Imagine a big office (your program), with many assets (shared resources)
and many employees (threads). For example, all employees share one common
resource - a toilet. They have agreed to use a label on a toilet's door (mutex).
When an employee wants to use the toilet he checks a label on a door
(locks a mutex). If it is "engaged" he waits (blocks on a mutex),
then when it is "free", he enters the toilet and changes the label to
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters