- place this config in
/etc/systemd/system/supervisord.service - kill all supervisord processes
sudo systemctl daemon-reloadsudo systemctl enable supervisord- start with
sudo systemctl start supervisordif already not started
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
| """A quick benchmark comparing the performance of: | |
| - msgspec: https://github.com/jcrist/msgspec | |
| - pydantic V1: https://docs.pydantic.dev/1.10/ | |
| - pydantic V2: https://docs.pydantic.dev/dev-v2/ | |
| The benchmark is modified from the one in the msgspec repo here: | |
| https://github.com/jcrist/msgspec/blob/main/benchmarks/bench_validation.py | |
| I make no claims that it's illustrative of all use cases. I wrote this up |
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
| function string:contains(sub) | |
| return self:find(sub, 1, true) ~= nil | |
| end | |
| function string:startswith(start) | |
| return self:sub(1, #start) == start | |
| end | |
| function string:endswith(ending) |
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
| """WARNING: not thoroughly tested and does not support full translation | |
| between the two libraries. | |
| Uses a pydantic root_validator to init the marshmallow schema. It attempts | |
| to map marshmallow field types to pydantic field types as well, but not all | |
| field types are supported. | |
| You can either use the pydantic_from_marshmallow function that does all of | |
| the above or just subclass MarshmallowModel and manually define your pydantic | |
| fields/types/etc. |
- using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml- using inventory:
127.0.0.1 ansible_connection=localMoved to git repository: https://github.com/denji/nginx-tuning
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.