TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How Long Does a Deployment Take at Your Company

34 点作者 devtailz大约 2 年前
I&#x27;m curious to hear what kinds of deployment times everyone works with and what system they are running on. I would guess most have the same times for a staging environment vs. production, but if those are different please specify.<p>For example, I have a Next.js project currently deployed via Vercel and it&#x27;s about 40-60 seconds before becoming available. I have heard stories of several minutes to deploy and would love to hear what kind of spread there is.

28 条评论

throwaway118899大约 2 年前
Throwaway for obvious reason. But…<p>1-2 days. Multiple senior engineers cherry picking commits into a release branch with even more seniors doing atteststion. It’s a company-wide effort that happens every sprint. We have “staff” SREs who can’t figure out automated releases.
评论 #34841160 未加载
评论 #34840670 未加载
评论 #34844322 未加载
评论 #34841005 未加载
shoo大约 2 年前
I worked on a little web service in a much larger system, that was deployed to the company&#x27;s on-prem datacentres.<p>To deploy the entire system, maybe it&#x27;d take a few hours: there&#x27;d be 1-2 dozen services, a few databases, probably 20+ external integrations. Usually we&#x27;d only deploy the services or components that were changing. Deploying a single service would only take a few minutes, even with human in loop manually triggering the deploy scripts.<p>Deploying changes was decoupled from activating changes, to avoid outages due to deployments. There were two instances of the system running in production at all times, deployed to two datacentres. It was one giant monolithic blue-green deployment sitting behind a customer-facing load balancer. Suppose the &quot;blue&quot; prod system is currently the live instance of the system and &quot;green&quot; is the dark instance. You&#x27;d deploy your new release of your component to green, then once deployment was complete and seemed stable, someone would pull the big lever on the load balancer to start forwarding customer traffic to the green instance. For a while both prod instances would receive customer traffic, until all the timeouts for customer sessions being served by the blue instance kicked in, and they established new sessions with green. Then green would be live and blue would be fully dark. It&#x27;d usually take around 5 minutes or so to completely drain traffic from an instance.<p>If you saw error rates spike on some component and wanted to abort, then you&#x27;d need to jam the big metaphorical lever on the load balancer the other way to direct all the traffic back again. Might take 5 minutes or so, again governed by the client session timeouts designed into the system. Usually the technical speed wasn&#x27;t the bottleneck -- it&#x27;s more like it&#x27;d take 15 to 60 minutes to get the business stakeholders into a room to make a decision on if they were willing to live with the errors or wanted to roll back to the old version.<p>In this context the real bottleneck wasn&#x27;t deployment or activation time, they were both fine. The bottleneck was on the pre-release test process in staging. There was a single staging environment for dozens of services owned and maintained by different teams, which would all be tested manually in lockstep. Changes had to be planned and coordinated weeks or months in advance, to get a test window. Releases happened every four weeks or so, if your change wasn&#x27;t stable in time to enter the big heavy testing phase in the integrated staging environment, you missed the boat and you had to wait 4 weeks for another try.
评论 #34843811 未加载
ElfinTrousers大约 2 年前
Maybe an hour...if you get it right the first time. There&#x27;s nothing especially odd about the architecture of our app, but the person who used to have my job was the president of the Not Invented Here Syndrome Fan Club, and our deployment consists of a set of handrolled Python scripts and some partial documentation on how to use them. This is one reason, and far from the biggest, that his old job is no longer his.<p>The good news is, we have an engineer putting in about 70% of his time on converting this to Terraform, and every time I do a deployment, it gets a little quicker and easier.
manv1大约 2 年前
Depends if there&#x27;s a database migration or not.<p>If no database migration, than maybe a minute or two (via GitHub actions).<p>If there is a database migration it might take a while depending on how much data needs to get moved around.<p>Adding columns usually takes no time. Adding indexes to a big table takes a few hours.
评论 #34840999 未加载
评论 #34843093 未加载
theandrewbailey大约 2 年前
(FYI: I work with several clients on Salesforce Commerce Cloud, each with their own codebases and instances.) A deployment to staging involves a build that usually takes 5 or so minutes. Depending on the size of the codebase (~50 to ~200 MB), a deployment from staging to production takes 1 to 5 minutes, followed by a cache invalidation that takes up to 15 minutes.<p>All told, maybe 30 minutes from writing code to running in production. That turnaround is extremely rare, only when an urgent hotfix is needed. Most releases are heavily tested in staging for several days before moving to production.
anacrolix大约 2 年前
The longest part is getting Rust to build inside Docker (even cached warm builds take forever), and fly.io to figure its shit out when the image is pushed. Both are needlessly slow bottlenecks.
Rev359a大约 2 年前
It depends on country and companies.<p>If you are in the company which has consultancy, consultants and freelancers and permanent employees - it can take ages because consultancy, consultants and freelancers are all competing each other while sucking the money from the companies. Every deployment in this case will result in a disaster because they never work with each other - they are just sucking the money and the permanent employee suffers and they start leaving for better options<p>If you are in the company which has talented permanent employees and good visionary leaders who work with the spirit of team building and team work I can assure you it will be as easy as pie - they work with each other and they make good results and take responsibility.<p>Piece of advice look for silos in your company and make them work as a team and it will take less time.<p>Development time can be more but deployment should always be easy if you have the right people. Try to hire right people for the right job<p>Deployment now a days is all cloud managed with in house or service providers like aws, google or azure and mostly offers serverless solutions as most of the databases and services are available as a service and a good DevOps would do it easily without taking much time provided if your team has people who do not like to work in silos and compete with each other
liampulles大约 2 年前
About 20 minutes. Main time cost is running integration and acceptance tests, downloading libs, and compiling. Hopefully will start doing it on a dedicated VM to cache things a bit.
iends大约 2 年前
I work on a large enterprise SaaS. It depends on how long a services test take, but our deploys to production require approval by the security team, which all happens via JIRA approvals. So less than a day. If it&#x27;s break the glass urgent in under an hour, mostly constrained by test automation. If it was something insane, I could probably do it in under 10 minutes for a single amazon region by turning off the test automation, but never had to do this. Feature toggles only take about 5 minutes to propagate and much less work than doing a deploy.<p>We have Dev, Test, &amp; 10+ prod regions. The service I work on takes about an hour to run tests in each region, but that involves almost 10 years of test automation, building a custom AMI on EC2, and deploying. There is also cross region AMI copying which slows things down.<p>To bootstrap a new region takes about 2 months for the entire product with developers kinda working in the background. My service takes about a week worth of work, but lots of external dependencies and issues pop up. We do this about once a year so its&#x27; almost not worth optimizing for.
vixalien大约 2 年前
I have a Next.js app too, and it takes about 1m30 to deploy. it really takes longer to build when your app gets larger, and if I&#x27;d had to rebuilt the app focusing on build time, I&#x27;d probably go with Remix<p>(note this is with Vercel&#x27;s [proprietary] build cache, it takes longer when there&#x27;s no build cache)
nevon大约 2 年前
Around 8-10 minutes at minimum. We do blue-green canary deployments, so most of the time the full deployment would take longer to shift over traffic in order to have enough time for metrics to be evaluated. But for a yolo deploy it&#x27;d be about 8-10 minutes.
aviperl大约 2 年前
I have an app that takes 15 minutes to deploy. We use GitHub actions to run the process which includes a build of a next.js site, building containers, creating assets in AWS, installing Python dependencies, and publishing the whole thing.
gfarah大约 2 年前
As other have mentioned depending on what is being deployed.<p>Lambda&#x2F;Cloud Functions code: testing 1m-5m, deployment &lt;3m. We use NX for our monorepo so we usually only deploy a fraction of all of our serverless code.<p>Containers: testing 5m-1h (depending on build time and type of tests), deployment 3m-10m.<p>Migrations: anywhere from 1m up to 1h depending on the tables&#x2F;migration type and the number of affected PostgreSQL instances.<p>Infraestructure: anywhere from 2m up to 8h depending on what&#x27;s being changed.
ElevenLathe大约 2 年前
Depending on &#x2F;what&#x2F; is being deployed, somewhere between &quot;seconds&quot; and &quot;it&#x27;s literally impossible so let&#x27;s hope we don&#x27;t have to&quot;.
评论 #34841204 未加载
onelli大约 2 年前
I&#x27;m not a CTO or tech guy, but in our case deployment takes a few minutes (usually up to 5 mins, rarely more). Node.js on meteor
ktrnka大约 2 年前
If I remember right, my team&#x27;s pipelines took about 40-60 min on average. We deployed machine learning models and code to lambda via cdk. The things that made it slow were having to deploy dev staging and prod with no resource sharing between them, docker builds and uploads, and end to end tests.
Oldham-Made大约 2 年前
About 2 mins, most of that time is remote compile. Small team, we all have deploy ability, and it is a manual trigger of an &quot;automated&quot; deploy. CI but not quite CD just yet.
quickthrower2大约 2 年前
It would be good to distinguish build-and-deploy which Vercel does by default to other pipelines where you might build the artefacts, test them, then the deploy is more of a copying of those artefacts into production. In the latter case the “deploy” would be faster.
评论 #34842004 未加载
rozenmd大约 2 年前
OnlineOrNot&#x27;s frontend deploys in about 60 seconds if the cache is warm, two and a half minutes otherwise.<p>The backend services take about two minutes.<p>(It&#x27;s my own company, so I took the time to make deployments as fast as possible since I value short feedback loops)
mind-blight大约 2 年前
About 20 minutes for staging and 30 for production. We deploy to staging and verify before we deploy to production. We have CD set up, so we deploy to production around 10 times a day
wagslane大约 2 年前
I have a decoupled front and back end. Front end takes less than a minute, back end take 5 minutes. Biggest time sink is a rebuilding the docker image, it doesn&#x27;t cache super well.
contextnavidad大约 2 年前
From the deployment stage of the pipeline to live traffic hitting the new code, probably a couple of minutes. Limited by image pulls, application startup time and K8s rollout strategy.
stcroixx大约 2 年前
20 seconds maybe? However long it takes Tomcat to start.
Bjartr大约 2 年前
If tests have already been run on the branch, the deploy takes less than ten minutes. Sometimes a db migration can stretch that a little though.
rurban大约 2 年前
From git push to fly.io restart its docker about a minute. It&#x27;s not a firecracker I assume.
KronisLV大约 2 年前
The technical aspects:<p><pre><code> - CI steps to build and package containers usually take 1-10 minutes, depending on whether caches are used - running unit tests can take 1-5 minutes, depending on the system and infrastructure - running integration tests can take 5-30 minutes, depending on the system and infrastructure - scanning the build artifacts can take around 5 minutes (e.g. Trivy) - uploading them to a container registry will usually take 1-5 minutes, depending on the network speed - launching new containers will probably take 1-10 minutes, depending on whether there&#x27;s DB migrations etc. </code></pre> So, in short, typically under hour, sometimes a lot under an hour.<p>Things that are especially useful on a technical level: a package cache (e.g. Maven &quot;.m2&quot; folder) or a self-hosted package repository (like Sonatype Nexus), maybe both; some sort of a build cache, which you largely get out of the box when working with containers, especially if you do multi-stage builds with an optimized build order&#x2F;layers (e.g. first dependencies that change infrequently, then the code); a setup where you parallelize lots of the build steps and can add new runner&#x2F;follower servers for actually doing the steps<p>The human aspects:<p><pre><code> - the people delivering the software might not be the same ones running it, registering a release with instructions might take 30-60 minutes - the people who will run the new version might need to change all of the necessary configuration for the new version, which might take another 30 or so minutes - the people who will demand that a new version be launched on any given infrastructure might need to be made aware of the new release, which might take around 30 minutes - before anything goes into prod or moves across different environments, testing and further fixes might be necessary, which can take from a day to a few weeks </code></pre> This might be relevant to something closer to a consulting scenario, or when working across org units, but here is where you&#x27;ll spend the majority of the time.<p>Personally, I&#x27;ve been in scenarios where I&#x27;ve deployed new versions to prod in minutes, and I&#x27;ve seen cases where new releases of software haven&#x27;t been deployed to prod in months, despite technically being delivered. Everything from fully automated pipelines, to shipping manually built binaries (thankfully this was years ago, for nothing important; I promptly setup proper CI&#x2F;CD regardless).<p>Then again, the kinds of software that people work on might differ a lot. Here&#x27;s an interesting post from a while ago: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18442941" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18442941</a>
fragmede大约 2 年前
Y&#x27;all are running automated testing before each deploy, right?<p>...right?
faangiq大约 2 年前
Hahahhahaahahah