Off when unused deployment mode now available
Tags: codesphere, previewdeployments, ondemand, hosting
Published: 2023-08-28 17:20:02

---
title: Off when unused deployment mode now available
published: true
date: 2023-08-24 08:16:28 UTC
tags: Codesphere,previewdeployments,ondemand,Hosting
canonical_url: https://codesphere.com/articles/off-when-unused-deployment-mode
---

 ![Off when unused deployment mode now available](https://codesphere.ghost.io/content/images/2023/08/deployment_mode_cover.webp)

This week we released another very exciting milestone. When creating a new workspace in Codesphere, you now have the option to chose between two different deployment modes. The default for paid plans is `always on` - until now all our paid plans are deployed like this, with dedicated 24/7 resources from our own datacenter.

The new deployment mode is called `off when unused` or sometimes referred to as standby or on demand workspaces. Workspaces deployed with this setting receive dedicated resources only when used and go into standby after ~60 minutes without usage. Upon receiving a request at the connected domain the server resources will boot up and restart your application (as long as there is a valid CI pipeline defined). Through under-provisioning, intelligent scheduling, and different deployment algorithms our servers have much faster cold starts (~1s) than those of competitors. Since these deployments only consume resources as they are used we can offer them at 10% of the cost of an `always on` deployment.

This allows teams to spam deployments more freely as cloud spend is only a fraction of what it would otherwise be. Imagine having a larger dev team, like at Codesphere for example, we have  ~600 branches and ~250 pull requests open in parallel on a given day. Each of them get's deployed automatically as preview deployments - this has made us roughly 6x faster but the cost can get considerable fast. We estimate that all things considered, our on demand deployments can make preview deployments 70% cheaper than with conventional setups.

![Off when unused deployment mode now available](https://codesphere.ghost.io/content/images/2023/08/standby_plans.webp)

You can read more technical details in the corresponding [doc page](https://docs.codesphere.com/getting-started/deployment-mode?ref=codesphere.ghost.io). In this article we want to explore some of the exciting use cases and advantages this opens up.  

### Use cases

Obviously you don't want a multi second delay for high traffic production setups but there are plenty of cases where this is totally acceptable.

The obvious example are preview deployments (read more about these here: [https://docs.codesphere.com/getting-started/preview-deployments](https://docs.codesphere.com/getting-started/preview-deployments?ref=codesphere.ghost.io)). These are used during the software development process to automatically deploy every committed code change and making a working version available to all team members. Developers can test things that require infrastructure not available locally easier, code reviews can be done much faster and you can even share pre-release versions of your software in client demos. Codesphere allows automating preview deployments from GitHub, Bitbucket & Gitlab (coming soon!) via our CI integrations.

Another use case is spinning up sandbox environments where you might still need ample computing power. For example we have been experimenting with self-hosted Llama2 LLMs. These are very resource intense applications but you might not be willing to spend big time just for trying things out. For example a smaller 7b param Llama2 runs fine on our Pro plan as we showed in another recent article (find it here: [https://codesphere.com/articles/self-hosted-chatgpt-in-codesphere](https://codesphere.com/articles/self-hosted-chatgpt-in-codesphere?ref=codesphere.ghost.io)). With the new `off when unused` deployment mode you can try this yourself for as little as $8/m.

Slightly less obvious but equally neat is the benefit this update provides to all of our free tier users. The free plan workspaces were always deployed with an `off when unused` logic but now they benefit from the same wakeup on domain access logic as all paid workspaces deployed in this mode. Imagine you are hosting a portfolio site where you showcase your amazing dev projects - typically these sites will not be high traffic (unless you're rockstar in your field which justifies an always on plan I'd say 😎). You can now host sites like this free forever - whenever someone wants to take a look at it, it will take a few seconds to boot up but will be available momentarily.

Happy Coding from the entire Codesphere team.