Comments (7)
Yes there is actually! The log files are explicitly named with the process number to eventually support something like this (i.e. web.00.log
instead of web.log
).
Two points I'm looking at first though:
- How to handle multiple web processes? - Currently Dokku forwards a single port per deployed app. If you have multiple, separate web processes you need to be able to forward traffic to each of them.
- Where to house the config data for this? - I'm thinking of having an additional file in the Dokku app home directory for it. Something like SCALE. It would have the number of processes of each type to spin up for each process type in the Procfile. It needs to be separate from the command itself so that subsequent deployments via "git push" can reuse the previously set value.
from dokku-logging-supervisord.
This has been added to the plugin. The post-release process now checks for a SCALE file in the app's home directory and uses that to determine how many processes of each type to run. If it does not exist then it will default to just one per process type.
You can also also scale via the command line:
dokku scale myapp web=1 worker=4
Everything still runs in the same container though so for web > 1 to work your web processes must be able to share the listening socket (lookup SO_REUSEPORT for how to do this).
Try it out and let me know how it goes!
from dokku-logging-supervisord.
Sorry to comment on an old issue...
How exactly do you go about using SO_REUSEPORT?
from dokku-logging-supervisord.
How exactly do you go about using SO_REUSEPORT?
It's a socket option when you're creating a server socket that listens on a port. The specifics of how to configure it will depend on your programming language. Your best bet is to do a search for it plus your language/framework for a working example.
from dokku-logging-supervisord.
So on a nginx (dokku's), gunicorn, flask, Python stack, would it be handled
by gunicorn? Seems like each of those supports it in some form.
On Saturday, 1 August 2015, Sehrope Sarkuni [email protected]
wrote:
How exactly do you go about using SO_REUSEPORT?
It's a socket option when you're creating a server socket that listens on
a port. The specifics of how to configure it will depend on your
programming language. Your best bet is to do a search for it plus your
language/framework for a working example.—
Reply to this email directly or view it on GitHub
#1 (comment)
.
from dokku-logging-supervisord.
You wouldn't have to touch nginx. I think it also supports that option but it's outside the scope of what I'm describing here.
Using the option within a dokku app is to allow for separate web processes to listen on the same port. That way when nginx forwards a web request to your app, it can be processed by any one of the processes. Without the SO_REUSEPORT option, whichever web process binds to the port first will "win" and the rest will be rejected from listening on it as it's already in use.
Note that it's probably simpler to use a web stack that handles this internally without SO_REUSEPORT and stick to web=1. For example gunicorn supports forking multiple processes and will automatically handle them listening on the same port.
from dokku-logging-supervisord.
Thanks @sehrope, your comments gave me the direction I needed to research. There isn't always much information on how all the components of the web stack interact. I've now got a deeper understanding, and have taken on board your suggested gunicorn method of handling multiple processes.
from dokku-logging-supervisord.
Related Issues (19)
- Failure to start app HOT 21
- dokku-logging-supervisord causes dokku deployment to fail HOT 10
- /var/log/app/ does not exist in the container HOT 1
- How to make it not apt-get install supervisord every deploy HOT 2
- Problem After try to config:set something HOT 1
- Cannot define custom stdout/stderr output HOT 4
- No longer appears to work. HOT 1
- Scale filename should be the same as Dokku uses HOT 2
- Don't work with Dokku 0.4
- Docker hangs with dokku-logginer-supervisord installed HOT 4
- Restarting app hangs on supervisor install HOT 6
- Runs commented out processes in the Procfile
- Railsapp with Unicorn: invalid argument: -p -c (OptionParser::InvalidArgument) HOT 2
- Disable for app
- Does this break zero downtime deploys? HOT 6
- Scale operation does not restart application HOT 2
- You cannot attach to a stopped container, start it first HOT 4
- Docker 0.10.0: remote: 2014/04/11 15:51:28 Invalid namespace name (app), only [a-z0-9_] are allowed, size between 4 and 30 HOT 1
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 dokku-logging-supervisord.