Comments (10)
seems reasonable and pretty easy to accomplish. The only difference will be in having a dedicated struct for all of the internal counters (instead of having them in the uwsgi_server huge struct). The only additiono to your plan is allowing the user to invert the default behaviour and choose the lower non-zero value (in some scenario could be useful)
from uwsgi.
I played a bit with it and come up with this
Usage: --cheaper-algo name[ interval],name[ interval],...
This idea needs a little bit of work, right now all algos fight with each other and in the end one plugin cheaps a worker while few seconds later another one respawns it.
from uwsgi.
The only solution I could think of is to allow all algos to spawn new workers, but allow only one to cheap them.
But I'm not sure if making all those changes is worth it, maybe if we had a lot more cheaper algos than it would make sense.
from uwsgi.
Ok, i have finally managed to make a big rewrite of the whole master process.
Now it should be a lot easier to make customizations (like graceful reloading for mules) and to monitor specific situations.
I am writing lot of comments to the code and writing a bunch of tests, so it would need still a bit of time to have a solid solution.
I am working right now on the cheaper part, so stacked cheaper algos should be available pretty soon
from uwsgi.
Ok, just take a look at my previous comments, multiple algorithms trying to come up with one number of workers that will make them all happy won't work very well. I would rather select one of them that will be able to stop workers while any could signal that additional are needed. Or just drop this concept and use code from cheaper busyness.
It's gonna be tricky
from uwsgi.
Why not simply taking the worst or the best (the user choose via config) value of the stacked functions ?
Ex.
listen_queue returns 1 worker needed
busyness returns 3 workers needed
if the user has choosen to use the worst value a single worker will be spawned, otherwise 3 workers will run.
from uwsgi.
AFAIR I've tried that and still there were issues, I can retest it tomorrow if You want, so that I could provide more details what issues I had.
from uwsgi.
I believe that the issues is that we have 3 types of values that cheaper algorithm can return:
< 0
- too much workers running, we should stop some
> 0
- not enough workers running, we should add some
those two above are working fine, but we also can return:
== 0
- but zero means both:
we have just the right amount of workers
and
I have no idea, ignore me
When an algorithm returns zero it can mean two things so it's hard to make a decision based on that. There are several cases where we get zero as return value, but we can't tell what case this is, examples:
- busyness returns zero since the load is between min and max user has set, so we should stick to that current number of workers despite the fact that other algos wants to cheap workers
- backlog returns zero since backlog is neither high or load, so other algos should decide
busyness algo works at full range of values it keeps track of while spare and backlog are only starting to work at low or high end of values, they are much more aggressive. Trying to make both types of algos to work together is going to have a lot of corner cases and I fear that it won't ever work the way user wants it.
Its gonna be much more predictable to have just one of the active at a time.
from uwsgi.
Also each algo will need different interval to come up with a value, backlog should check as often as possible while busyness needs more time for accuracy.
from uwsgi.
Ok, so let's close that :) It looks like it is more easy to write ad-hoc algos instead of trying to combine them
from uwsgi.
Related Issues (20)
- Segmentation Fault with Python3.12
- Not compatible with python 3.12 HOT 1
- BlockingIOError: [Errno 11] write could not complete without blocking
- OSError: [Errno 90] Message too long
- Why does uwsgi-docs suggests using uwsgi-2.0.20? HOT 1
- uWSGI 2.0.25: TypeError: sequence item 14: expected str instance, NoneType found HOT 9
- Missing release notes for 2.0.25 HOT 2
- UWSGI 2.0.25: static-expires-uri option does not work with libpcre2 HOT 5
- CVE-2024-24795 HOT 1
- uwsgi provides false debugging information
- Enable debugging in vscode (uwsgi and flask) HOT 3
- Integrate uwsgi with fastapi HOT 1
- BUG: flaky exit-code when using need-app and lazy-apps flags together(+FIX) HOT 3
- uWSGI build error - GCC 13 on Ubuntu 24.04 HOT 1
- uWSGI Segmentation Fault When Running with New Relic HOT 2
- Multiple HTTP sockets with map-socket: the second HTTP socket is very slow
- `ENOSYS` error in `pthread_mutexattr_setprotocol` for alpine based images
- uwsgi fails to compile with Python 3.13 HOT 1
- Errors that occur when uwsgi is running at high concurrency
- Graceful reload|shutdown doesn't work when no requests coming
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uwsgi.