CirrusGrid PaaS provides an out-of-box integration of the scalable Apache application server dedicated specially for the Python-based applications hosting. It is already optimized and prepared for immediate management, allowing to dive right into development without bothering about numerous orchestration tasks, i.e. making the hosting process maximally convenient for developers.
Through this article, you’ll get acquainted with the main tools and features available on the platform to provide the required level of Python cloud hosting.
To start hosting your Python application at CirrusGrid PaaS, you need to create the appropriate environment via the powerful topology wizard (accessible through the New Environment button at the dashboard’s top panel).
Switch to the Python language tab and select the desired engine version. Apache Python application server is automatically added in a bundle with the mod_wsgi module. Specify resource limits and nodes’ count, as well as add extra software stacks or options (e.g. Public IPs) if required.
Note: Each instance is a fully independent isolated container. Instances of the same layer are automatically distributed across available hosts ensuring high availability.
Currently, the following Python versions are supported:
You can select the required version of Python directly from the topology wizard during the creation of a new environment, as well as adjust it for already existing ones using container redeployment.
Deployment to the managed application servers (Apache Python) is automated by the platform and can be performed using one of the following flows:
Git flow provides a possibility of sequential or simultaneous deploy, as well as automatic re-deployment from the repository if new code changes appear.
Refer to the following guides for the detailed overview of the deployment process and the provided additional options:
Check examples of the Python-based application hosting at CirrusGrid:
In order to successfully deploy and run a Python application, some additional modules or other packages may be required to be installed. Herewith, it is a common practice to run Python web applications in isolated virtual environments, for example using the virtual environment tool, which allows managing projects independently and without the administrator privileges.
1. To create and start a new virtual environment, go to Settings > SSH > Web SSH and run the following commands:
2. The management of the required software packages is commonly provided by pip – a popular Python package management system for the PiPI repository. Below, some of the most common commands are listed:
Tip: In case of the preconfigured application packages (archives), all the dependencies are provided via the requirements.txt file, which is read during the deployment process to install the listed Python modules automatically. Also, it should contain the wsgi.py file with the entry point script for running an application inside a virtual environment using the mod_wsgi for Apache.
If needed, the default domain name of your Python application can be replaced with a custom one via:
In addition, Jelastic PaaS allows to switch traffic between two environments quickly and without downtime (e.g. to seamlessly redirect customers to the newer application version) using the swap domains functionality or with the help of the SwapExtIps API/CLI method.
Automatic vertical scaling implemented by CirrusGrid PaaS provides the exact amount of resources (RAM and CPU) that your application currently requires. As a result, you don’t need to waste your time continuously making load-related adjustments. And in combination with the Pay-as-You-Use pricing model, it ensures you never overpay for unused resources.
Just set the upper cloudlets limit (each one equals 128 MiB of RAM and 400 MHz of CPU) for your Python application server. Everything else will be handled by the platform automatically.
Refer to the automatic vertical scaling guide for additional details.
Horizontal scaling of the Python servers is no different from scaling any other instance at the platform – just specify the required number of nodes with the +/– buttons in the central part of the topology wizard. If needed, choose the preferred scaling mode:
Tip: For the proper distribution of requests, a load balancer instance is automatically added to the environment upon Python server scaling. Refer to the horizontal scaling documentation for more specifications.
Navigate to the environment Settings > Monitoring > Auto Horizontal Scaling section to set up custom triggers, which allow automatically increase/decrease the number of nodes due to the application load. Just choose a resource type to be monitored (CPU, RAM, Network, Disk) and the exact condition of scaling, the rest actions are automated. You’ll be informed about any changes with email notifications if the appropriate option is enabled.
A set of scalable and fully manageable database servers is available within CirrusGrid PaaS for you to easily install and use for the Python environment. To establish the connection, adjust your application following the instruction based on the database you require:
Besides, hosting at CirrusGrid allows using other built-in tools and features, for example:
Get your free trial account and start exploring Ruby hosting benefits within CirrusGrid multi-cloud platform for your own applications!
Powered by BetterDocs
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.