sparckles / Robyn

Robyn is a Super Fast Async Python Web Framework with a Rust runtime.
https://robyn.tech/
BSD 2-Clause "Simplified" License
3.97k stars 203 forks source link

--fast flag inspired by sanic framework #636

Open tushar5526 opened 9 months ago

tushar5526 commented 9 months ago

Sanic has its own webserver along with support for external webservers. Servers like uvicorn, gunicorn leave it up to the users to tweak the value of processes, workers or threads to find the best combination which gives the best performance.

But Sanic's own webserver has a --fast flag which automatically optimises these values according to your server. Robyn should support something like it to tweak the values of processes and workers.

sansyrox commented 9 months ago

Hey @tushar5526 👋

That is a great idea. Thank you. I will have a look 😄

mn3711698 commented 7 months ago

Currently encountering high concurrency issues, please as soon as possible @sansyrox thank you

sansyrox commented 7 months ago

Hey @mn3711698 👋

Can you please explain a bit more ? What do you mean by this

Currently encountering high concurrency issues, please as soon as possible

How are you running Robyn?

mn3711698 commented 7 months ago

@sansyrox

i know just lite english. my website running Robyn.

[program:ro19] environment =PYTHONPATH=/var/vcom/,LANG=zh_CN.UTF-8,LC_CTYPE=zh_CN.UTF-8,LC_ALL=zh_CN.UTF-8 directory = /var/vcom/ command = /usr/local/bin/python3 ./run_apiro19.py --workers 5 autostart = true autorestart=true user = root redirect_stderr = true stdout_logfile = /var/log/ro19.log

[program:ro20] environment =PYTHONPATH=/var/vcom/,LANG=zh_CN.UTF-8,LC_CTYPE=zh_CN.UTF-8,LC_ALL=zh_CN.UTF-8 directory = /var/vcom/ command = /usr/local/bin/python3 ./run_apiro20.py --workers 5 autostart = true autorestart=true user = root redirect_stderr = true stdout_logfile = /var/log/ro20.log

[program:ro21] environment =PYTHONPATH=/var/vcom/,LANG=zh_CN.UTF-8,LC_CTYPE=zh_CN.UTF-8,LC_ALL=zh_CN.UTF-8 directory = /var/vcom/ command = /usr/local/bin/python3 ./run_apiro21.py --workers 5 autostart = true autorestart=true user = root redirect_stderr = true stdout_logfile = /var/log/ro21.log

Robyn should support something like it to tweak the values of processes and workers ?

sansyrox commented 7 months ago

Hey @mn3711698 👋

It is super easy to do that in Robyn 😄

Just do python3 app.py --workers=N --processes=M

sansyrox commented 7 months ago

https://robyn.tech/documentation/api_reference/const_requests#muli-core-scaling

sansyrox commented 7 months ago

Also, @mn3711698 , I would love to see your website 😄 You can share it with me on Discord if that is more comfortable.