A user has the possibility of performing certain operations on the components of an application: scale, stop and resume the application components. Bear in mind that only those components that make sense and their definition is managed by Napptive will be able to scale up, stop and resume. A list of them is shown below.
Scaling a component in your application is a crucial task that enables you to adjust the number of replicas of a component based on the demand or workload. This section of the documentation guides you through the process of scaling a component using the user interface provided in your application.
To scale a component, start by navigating to the component you wish to scale in your application dashboard. Look for the “Replicas” information field which displays the current number of replicas. Adjacent to this field, you’ll find a button
Scale. Clicking on this button will enable the replicas input field, allowing you to modify the number of replicas. Carefully enter the new desired number of replicas, ensuring that it is feasible and within the limits of your application’s resources.
If you need to discard the changes—maybe because of a change of mind or an incorrect number—there’s a “Cancel” red button next to the “Confirm Scaling” button.
Once you’ve entered the new number, proceed by clicking on the “Confirm Scaling.Then accept the browser confirm dialog. This action initiates the scaling process, during which the system will start deploying or removing replicas according to the new number entered.
An important aspect of the scaling process is the auto-refresh feature. This feature updates the status of the scaling operation, continuing until the component is fully scaled or for a duration of 60 seconds, whichever is sooner.
The application can be scaled using the CLI, for that, execute the following command:
$ playground app scale <applicationName> --replicas <componentName>=<num_replicas> Target environment: accountName/envName STATUS INFO SUCCESS Application <applicationName> scaled successfully
Sometimes you may be interested in stopping an application, for example, to temporarily reduce an environment’s quota utilization to improve account quota utilization, to test to temporarily close access to an application, etc.
If you find that a particular application component is eligible for being stopped, you can initiate the stopping process by clicking the designated “Stop” button located immediately adjacent to the component’s status indicator. Concurrently, the system will begin auto-refreshing the data relevant to the component to provide up-to-date feedback on its state. This automatic refresh process is designed to continue for the duration of the stopping process or until a maximum of two minutes has passed. After this period, should the component not display a ‘stopped’ status, you have the option to manually refresh the status by clicking the “Refresh” button, thereby ensuring that you have the latest information on the component’s state.
Execute the following command:
$ playground app stop <applicationName> --component <componentName> Target environment: <accountName>/<environmentName> STATUS INFO SUCCESS Components [componentName] in application applicationName stopped successfully
After that, you can ask for the application info and check the component status is
STOPPED. The stop operation consists of adding a stop trait to the component
Once an application component is stopped, it can be resumed to run again.
Upon engaging the “Resume” feature to reactivate a stopped application component, the system mirrors the diligence of the stopping process with an equivalent auto-refresh mechanism. As the component begins its reinitialization sequence, the system automatically refreshes the relevant data at regular intervals to reflect the component’s transition back to its operational state. This auto-refresh is programmed to persist for two minutes following the activation of the “Resume” button, ensuring that you are consistently presented with the most current status of the component without the need for manual updates. This automatic update cycle allows you to monitor the component’s progress as it moves towards full functionality. If, after the two-minute auto-refresh window, the component has not yet reached an active state, or if you require the latest status update post the auto-refresh period, the “Refresh” button remains at your disposal for manual status checks. This harmonious balance between auto-refresh and manual control facilitates a user-friendly experience, ensuring that the system’s responsiveness aligns with operational demands and user expectations.
Execute the following command
$ playground apps resume <applicationName> --component <componentName> Target environment: <accountName>/<environmentName> STATUS INFO SUCCESS Components [<componentName>] in application <applicationName> resumed successfully