-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chown in /start -- is it necessary? #135
Comments
Take a look at the Herokuish branch and project. I'd like to have this conversation based on how it's doing things since it'll be merged in and replace a lot of buildstep soon. |
There's also a relation to #133 - chowning the dir helps with the mounting of data volumes and random users as the permissions on for the mounted directories get „fixed“ before the app starts as unprivileged user, at least for volumes mounted below /app @tilgovi I've tried to replicate the impact on the checks plugin but haven't been able to create a fail due to a large app directory. Any indication what is needed to make the chown so slow that it has a noticeable impact? I tried with a dummy directory containing 131072 files in a 2 level hashed directory and even on my slowest drives it took less than a second. |
@yabawock I've seen the issue almost solely under high resource utilization. |
I can't seem to trigger a situation where the I'm pretty sure there is a usage mix that can trigger a failed check, but if that is „normal“ utilization of your host I'd consider removing the @progrium herokuish doesn't do anything different, the |
Wouldn't your underlying filesystem have a significant role in this? On Mon, Feb 16, 2015 at 2:58 PM, Morton Jonuschat [email protected]
Jeff Lindsay |
I've tried with both ext4 and btrfs. Maybe XFS (Redhat default?) is a possible candidate, there are contradicting reports, some say that XFS is slow for this kind of filesystem operation, others report it's faster than ext4 |
The box where I have this issue is actually very memory constrained. I
don't know if that's the cause but I suspect so. There's a fair bit of
swapping during this time.
If it's not reasonable to change this behavior then that's totally fine. I
just thought it would be worth discussing.
So, reasons for slowness aside, what are the reasons we couldn't run the
chown and checkpoint the result so that it's done already at deploy?
|
Given the current way things work the Would the user change on every start of the application (as it does on Heroku) the chown wouldn't be optional anymore since the ownership of /app would need to be adjusted for the current user. At the moment this isn't feasible due to bugs in docker, but that might change in the future. Weighting all pros and cons I would reason to keep the |
Any reason not to make that a distinct phase before deploy, though? |
The distinct phase before deploy would be something a container manager does, wouldn't it? |
Yes. I should maybe refile this against dokku. But first we'd need to On Tue, Feb 17, 2015, 13:26 Morton Jonuschat [email protected]
|
Please take into consideration that I know that the same situation can occur now if you are using a dokku version with zero downtime deploys, but at least it will be fixed on application restart if a deployment error occurs. When I originally implemented it, it was meant as a safeguard against „careless“ post processing of the slug and curtesy to docker volumes below /app. Currently it could be removed - in master as well as the herokuish branch - as both operate with the same user during build and run phase. All in all it seems like a band aid for a problem with a different root cause to me. I am not opposed to delegating the responsibility for correct permissions to the container manager if any kind of modification happens to the slug after the build phase, even mounting a volume. But I fear it will do more harm than good - especially since full user randomization was originally in the @progrium What's your take on the situation? |
If it can be removed, we can take it out in herokuish (which should be landing here soon) and revisit it as issues around it come up again. I'm all for experiments like that, especially if they end up simplifying or removing code. |
I am deploying a node.js app with dokku and running into the problem that this chown step runs forever and uses high system resources/io and somehow gets stuck I have 2 containers deploying the same code, one running as web and one running as worker, when they start up they are sometimes (strangely not always) stuck on the following:
vmstat
iotop shows these chown being the reason why the system is locked up:
looking at what files these chown processes are accessing it seems they are busy going through node_modules files
dokku is running on a VPS and this consumes all io available - sometimes after 20 minutes or so its finally finished and resources are released, when I Can I somehow disable this chown step if its not required? Im using this .buildpacks
|
Note: dokku no longer uses buildstep, so you are almost certainly running on an unsupported version of dokku. |
no Im running current version of dokku, but from your comment I realize it now uses herokuish which is doing the same chown step which takes forever in my case is that an issue that should be filed over at herokuish then or over at dokku or is it something altogether that Im just out of luck with?
|
Related herokuish issue gliderlabs/herokuish#114 , which you may wish to comment upon. |
The chown in /start can take time and messes with the consistency of things like the dokku checks timeouts. My understanding is that it's necessary in case something else (like a dokku plugin) modifies the filesystem after the compile step.
The text was updated successfully, but these errors were encountered: